Search This Blog

Wednesday, 13 March 2013

Building gcc 4.1.2 on solaris 10

Solaris by default comes with gcc 3.4.3 and binutils 2.15. Follow the following steps to build gcc 4.1.2 on solaris 10:

  1. Use ksh shell
  2. export CONFIG_SHELL=/usr/bin/ksh
  3. Copy/Create links to all gnu tools into one directory and remember to remove letter 'g' from the prefix of the name of executable.
  4. export PATH=/Mytools/binutils_2_18/bin:/gnutools:/sbin:/bin:/usr/bin:/usr/ccs/bin:/usr/sfw/bin
  5. export CC="/usr/sfw/bin/gcc -fPIC"
  6. export CXX="/usr/sfw/bin/g++ -fPIC"


  1. Install/Build gnu binutils version 2.18 using gcc 3.4.3(available in solaris by default).
  2. cd gcc_source_dir
  3. mkdir objdir && cd objdir
  4. ../configure --with-gnu-as --with-as=/binutils_2_18/bin/as --with-gnu-ld --with-ld=/binutils_2_18/bin/ld --prefix=$PREFIX --enable-threads=posix --enable-checking=release --with-system-zlib --enable-shared --disable-symvers --enable-languages=c,c++
  5. gmake #referring to gnu make
  6. gmake install

No comments:

Post a Comment