Go Back   The UNIX and Linux Forums > Operating Systems > Solaris
google site



Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-02-2010
Registered User
 

Join Date: Apr 2009
Location: Chennai
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Compiler - 32bit or 64bit?

Hi Gurus,

I need to check whether the compiler installed in my system supports 64bit compilation.

Server - Sun fire v490
OS - Solaris 5.9
Processor - Sparcv9 (64bit)
Install Directory - /opt/SUNWSpro
Compiler Model - Sun Forte C Compiler.

My development team is claiming that there are no files in /opt/SUNWspro/bin/sparcv9 directory.
Hence it doesn't support 64bit.

Can somebody help me out?

Thanks
HG
Sponsored Links
  #2  
Old 03-02-2010
ɹǝsn sıɹɐlosuǝdo
 

Join Date: Dec 2007
Location: Paris
Posts: 2,312
Thanks: 0
Thanked 24 Times in 22 Posts

Code:
$ echo "void foo(){}" >/tmp/foo.c
$ /opt/SUNWspro/bin/cc -c -m64 foo.c -o /tmp/foo.o
$ file /tmp/foo.o
/tmp/foo.o:	ELF 64-bit LSB relocatable AMD64 Version 1
$ ls -lL /opt/SUNWspro/lib/amd64
total 44
lrwxrwxrwx   1 root     root          33 juil. 28  2009 debugging.so -> ../../prod/lib/amd64/debugging.so
lrwxrwxrwx   1 root     root          21 juil. 28  2009 libblacs_openmpi.so -> libblacs_openmpi.so.1
lrwxrwxrwx   1 root     root          42 juil. 28  2009 libblacs_openmpi.so.1 -> ../../prod/lib/amd64/libblacs_openmpi.so.1
lrwxrwxrwx   1 root     root          20 juil. 28  2009 libcollectorAPI.so -> libcollectorAPI.so.1
lrwxrwxrwx   1 root     root          41 juil. 28  2009 libcollectorAPI.so.1 -> ../../prod/lib/amd64/libcollectorAPI.so.1
lrwxrwxrwx   1 root     root          14 juil. 28  2009 libCrun.so -> ./libCrun.so.1
lrwxrwxrwx   1 root     root          37 juil. 28  2009 libCrun.so.1 -> ../../prod/usr/lib/amd64/libCrun.so.1
lrwxrwxrwx   1 root     root          37 juil. 28  2009 libCstd.so -> ../../prod/usr/lib/amd64/libCstd.so.1
lrwxrwxrwx   1 root     root          37 juil. 28  2009 libCstd.so.1 -> ../../prod/usr/lib/amd64/libCstd.so.1
...

  #3  
Old 03-02-2010
Registered User
 

Join Date: Apr 2009
Location: Chennai
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
I got the below output

Quote:
[!]root: /opt/SUNWspro/bin/cc -c -m64 /tmp/foo.c -o /tmp/foo.o
cc: Warning: illegal option -m64
  #4  
Old 03-02-2010
ɹǝsn sıɹɐlosuǝdo
 

Join Date: Dec 2007
Location: Paris
Posts: 2,312
Thanks: 0
Thanked 24 Times in 22 Posts
Old compiler releases were requiring a different option, try:

Code:
/opt/SUNWspro/bin/cc -c -xarch=v9 foo.c -o /tmp/foo.o
file /tmp/foo.o

  #5  
Old 03-02-2010
Registered User
 

Join Date: Jan 2010
Location: Vienna, Austria
Posts: 174
Thanks: 0
Thanked 15 Times in 15 Posts
-m64 ist the gcc option for 64 bit. The corresponding option for the Sun Studio compiler is -xarch=v9.

Try:

Code:
/opt/SUNWspro/bin/cc -c -xarch=v9 foo.c -o /tmp/foo.o

  #6  
Old 03-02-2010
ɹǝsn sıɹɐlosuǝdo
 

Join Date: Dec 2007
Location: Paris
Posts: 2,312
Thanks: 0
Thanked 24 Times in 22 Posts
Quote:
Originally Posted by hergp View Post
-m64 ist the gcc option for 64 bit.
-m64 is used too with current Sun C compilers:

Quote:
Originally Posted by Sun Studio cc manual page
COMPILING FOR 64-BIT PLATFORMS:
The way to specify compilation of a 32-bit or 64-bit binary has changed in this release. The -xarch option no longer carries an implicit memory model, 32-bit
ILP32 or 64-bit LP64, with each definition, and is now used only to specify the instruction set of the target processor.

Use the new -m32 and -m64 options to specify the memory model of the target compilation.
  #7  
Old 03-02-2010
Registered User
 

Join Date: Apr 2009
Location: Chennai
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Hi jlliagre & hergp,

I got the below output. Can i conclude that the compiler supports 64bit compilation?


Code:
 
[!]root: /opt/SUNWspro/bin/cc -c -xarch=v9 /tmp/foo.c -o /tmp/foo.o
 @ /
[!]root: file /tmp/foo.o
/tmp/foo.o:     ELF 64-bit MSB relocatable SPARCV9 Version 1
 @ /

Thanks
HG

---------- Post updated at 05:32 PM ---------- Previous update was at 05:28 PM ----------

Hi Jlliagre and hgerp,

I meant to say, i am concluding that it is supporting 64bit compilation....Thanks for your valuable inputs.

HG
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pthread problems, 32bit vs 64bit jpelletier116 Red Hat 3 10-05-2009 09:46 PM
32bit to 64bit conversion. demuynckr Programming 7 08-11-2008 10:00 AM
Linux 32bit or 64bit manoj.solaris Linux 5 09-16-2007 05:02 PM
64bit- or 32bit- processor moxxx68 UNIX for Dummies Questions & Answers 2 01-27-2005 11:12 AM
32bit vs 64bit eloquent99 UNIX for Dummies Questions & Answers 1 07-26-2002 11:07 PM



All times are GMT -4. The time now is 07:49 AM.