Linking issues under Solaris (wrong ld)...

Matthew elricofgrans@yahoo.com
Thu Jun 18 02:57:00 GMT 2009


G'day,

I have deployed gcc on several Solaris 10 systems now for the application I develop, so I am getting pretty familiar with the things to look for, but this time I am stumped.  I will start with a dump of what I know to be relevant data:

$ which g++
/usr/local/bin/g++
$ g++ -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
Configured with: ./configure --with-gnu-ld
Thread model: posix
gcc version 3.4.6
$ g++ -print-search-dirs | grep prog
programs: =/usr/local/libexec/gcc/sparc-sun-solaris2.10/3.4.6/:/usr/local/libexec/gcc/sparc-sun-solaris2.10/3.4.6/:/usr/local/libexec/gcc/sparc-sun-solaris2.10/:/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/:/usr/local/lib/gcc/sparc-sun-solaris2.10/:/usr/libexec/gcc/sparc-sun-solaris2.10/3.4.6/:/usr/libexec/gcc/sparc-sun-solaris2.10/:/usr/lib/gcc/sparc-sun-solaris2.10/3.4.6/:/usr/lib/gcc/sparc-sun-solaris2.10/:/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../sparc-sun-solaris2.10/bin/sparc-sun-solaris2.10/3.4.6/:/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../sparc-sun-solaris2.10/bin/:/usr/ccs/bin/sparc-sun-solaris2.10/3.4.6/:/usr/ccs/bin/
$ ls -l /usr/local/libexec/gcc/sparc-sun-solaris2.10/3.4.6/
total 39526
lrwxrwxrwx   1 root     root          39 Jun  5 17:39 as -> /usr/local/sparc-sun-solaris2.10/bin/as
-rwxr-xr-x   1 bin      bin      6175052 Sep  5  2006 cc1
-rwxr-xr-x   1 bin      bin      7182392 Sep  5  2006 cc1plus
-rwxr-xr-x   1 bin      bin       227256 Sep  5  2006 collect2
-rwxr-xr-x   1 bin      bin      6609028 Sep  5  2006 f771
drwxr-xr-x   2 bin      bin          512 Jun  4 15:20 install-tools
lrwxrwxrwx   1 root     root          39 Jun  5 17:39 real-ld -> /usr/local/sparc-sun-solaris2.10/bin/ld
$ /usr/local/libexec/gcc/sparc-sun-solaris2.10/3.4.6/real-ld -v
GNU ld version 2.17

Everything looks to me as though it should work, but when I try to link:
/usr/ccs/bin/ld: illegal option -- start-group
/usr/ccs/bin/ld: illegal option -- end-group
...
Somehow, it is still trying to use Sun's linker.

I have tried putting /usr/local/sparc-sun-solaris2.10/bin into my PATH, putting another real-ld link in my PATH, tried some funny-business with GCC_EXEC_PREFIX (it worked once before!).  I would like to try renaming /usr/ccs/bin/ld to something else and see what happens (just for more information), but the sysadmin will not hear of it.  I have tried Google, but did not find anything I had not already tried.  Is there anything else I can try to resolve this issue?

Thanks,

Matthew


      Access Yahoo!7 Mail on your mobile. Anytime. Anywhere.
Show me how: http://au.mobile.yahoo.com/mail



More information about the Gcc-help mailing list