Solaris falls back on CCS ld

Remko Troncon remko.troncon@cs.kuleuven.ac.be
Tue Apr 29 14:04:00 GMT 2003


Hi,

I am trying to compile a program on a Solaris 2.8 machine with gcc
3.2.1. I want GCC to use GNU ld instead of the default ccs/ld. The
manual dictates to use -B for this purpose, but this doesn't seem to be
enough. 

gcc, ld, and as are installed in /usr/local/gnu/bin. Running gcc gives
me the following output:
     my_machine$ gcc -v -B /usr/local/gnu/bin/ test.o

     Reading specs from
     /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
     Configured with: ../configure --disable-nls
     --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld
     Thread model: posix
     gcc version 3.2.1
      /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/collect2
      -V -Y P,/usr/ccs/lib:/usr/lib -Qy
      /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/crt1.o
      /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/crti.o
      /usr/ccs/lib/values-Xa.o
      /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/crtbegin.o
      -L/usr/local/gnu/bin
      -L/usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1
      -L/usr/local/gnu/bin/../lib/gcc-lib
      -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1
      -L/usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/../../../../sparc-sun-solaris2.8/lib
      -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/../../../../sparc-sun-solaris2.8/lib
      -L/usr/ccs/bin -L/usr/ccs/lib
      -L/usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/../../..
      -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/../../..
      test.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc
      /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/crtend.o
      /usr/local/gnu/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/crtn.o
      ld: Software Generation Utilities - Solaris Link Editors:
      5.8-1.281

Running gcc with the option -Wl,-E gives me the help screen of CCS ld,
which proves that it doesn't use the GNU ld. I tried it with or without
the space between -B path. The same command works perfectly on my Linux
machines, and it uses the compiler found in -B.

Can anyone help ?

thanks,
Remko



More information about the Gcc-help mailing list