gmp-5.0.2 installation in Solaris 10

Dennis Clarke dclarke at blastwave.org
Thu Sep 15 18:01:01 CEST 2011


[ a little off topic ]


> Thanks for the tips; I use both /usr/sfw/bin/gcc and Sun Studio, and,
> failed.
> Where I could find a precompiled package?

Please see :

   http://mirrors.med.harvard.edu/csw/unstable/

then pick your architecture, sparc or i386 ( x86_64 is in there also ) :

   http://mirrors.med.harvard.edu/csw/unstable/`uname -p`/

then your OS rev :

   http://mirrors.med.harvard.edu/csw/unstable/`uname -p`/`uname -r`

If you see this :

 gcc4-4.5.1,REV=2010.09.01-SunOS5.8-sparc-CSW.pkg.gz

do NOT fret over the SunOS5.8 in there. That just means that it was boot
strapped on Solaris 8 64-bit Sparc and all tests passed there. Then thanks
to the ABI in Solaris it works flawlessly on Solaris 9 and 10. The i386 an
x86_64 packages are different of course because Solaris 8 and 9 on i386
are 32-bit only. The Solaris 10 packages are x86_64 aware however work
fine as 32-bit compilers also.

There is a bucket load of dependecies you will need also.

In fact .. just do this :

1) download common-1.8.0,REV=2010.05.01-SunOS5.8-sparc-CSW.pkg.gz

gunzip it

pkgadd -d ./common-1.8.0,REV=2010.05.01-SunOS5.8-sparc-CSW.pkg


2) then go get pkgutil-1.8.0,REV=2010.03.08_rev=bw-SunOS5.8-sparc-CSW.pkg.gz

gunzip it

pkgadd it


3) then run /opt/csw/bin/pkgutil --catalog

4) then run /opt/csw/bin/pkgutil --install gcc4


sit back and watch everything install for you.

Be sure to set your CFLAGS and other environment vars to point to the new
gcc :

CC=/opt/csw/gcc4/bin/gcc
CXX=/opt/csw/gcc4/bin/g++

CFLAGS= whatever you need

LD=/usr/ccsw/bin/ld

AS=/opt/csw/bin/gas   or AS=/usr/ccs/bin/as

On Sparc go with the latter

LD_OPTIONS=\-R/opt/csw/lib/\$ISALIST:/opt/csw/lib \
           \-L/opt/csw/lib/\$ISALIST:/opt/csw/lib

etc etc

works like a charm

If you set up your env vars correct you can compile nearly anything, in
fact, everything just fine. Including some obscure stuff that links in
libs from the OS and drills into Sparc processor registers etc. GCC works
man .. use it.

Any binary you make should have RPATH and RUNPATH set correctly to
refernce the needed g++ libs or gcc libs :

$ ls -lap /opt/csw/gcc4/bin/gcc
-rwxr-xr-x   1 root     bin       640388 Aug 10  2010 /opt/csw/gcc4/bin/gcc
$ elfdump -d /opt/csw/gcc4/bin/gcc

Dynamic Section:  .dynamic
     index  tag               value
       [0]  NEEDED           0x2973            libc.so.1
       [1]  INIT             0x36150
       [2]  FINI             0x3616c
       [3]  RUNPATH          0x2989           
/opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/gcc4/lib/$ISALIST:/opt/csw/gcc4/lib
       [4]  RPATH            0x2989           
/opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/gcc4/lib/$ISALIST:/opt/csw/gcc4/lib
       [5]  HASH             0x100e8
       [6]  STRTAB           0x13ce0
       [7]  STRSZ            0x29d9
       [8]  SYMTAB           0x114f0
       [9]  SYMENT           0x10
      [10]  CHECKSUM         0x88ef
      [11]  VERNEED          0x166bc
      [12]  VERNEEDNUM       0x1
      [13]  PLTRELSZ         0x48c
      [14]  PLTREL           0x7
      [15]  JMPREL           0x16730
      [16]  RELA             0x166dc
      [17]  RELASZ           0x4e0
      [18]  RELAENT          0xc
      [19]  DEBUG            0
      [20]  FEATURE_1        0x1               [ PARINIT ]
      [21]  FLAGS            0                 0
      [22]  FLAGS_1          0                 0
      [23]  PLTGOT           0x63544
$



$ /opt/csw/gcc4/bin/gcc --version
gcc (Blastwave.org Inc. Mon Aug  9 07:10:45 GMT 2010) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$

I also have gcc 4.6.1 which runs beautifully but it is part of a new
release stack that I have not released yet.

see http://gcc.gnu.org/gcc-4.6/buildstat.html and click on 4.6.1 for
sparc-sun-solaris2.8

Real soon now :-)


Dennis Clarke




-- 
--
http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x1D936C72FA35B44B
+-------------------------+-----------------------------------+
| Dennis Clarke           | Solaris and Linux and Open Source |
| dclarke at blastwave.org   | Respect for open standards.       |
+-------------------------+-----------------------------------+



More information about the gmp-bugs mailing list