This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/33598] gcc 4.2.1 ignores GNU ld on Solaris 9



------- Comment #16 from dhaliK at jla dot rutgers dot edu  2007-10-23 22:07 -------
Ok, so I'm back on the track of what's going on here. I built it with multilib
as you said, and it builds 32/64 fine on Solaris, but when it goes to link
internally it chokes on the 64-bitness. In other words, gcc looks like it
requires gnu ld in order to build 64bit on Solaris and that was why we had been
building two flavors of it. One built with gnu ld and one with sun ld. This is
what happens:

gcc -v -o
/usr/local/src/rpm-packages/BUILD/otp_src_R11B-5/bin/sparc-sun-solaris2.9/beam
-L/usr/local/lib/sparcv9 -L/usr/local/ssl/lib/sparcv9 -R/usr/local/lib/sparcv9
-R/usr/local/ssl/lib/sparcv9 
/usr/local/src/rpm-packages/BUILD/otp_src_R11B-5/erts/emulator/obj/sparc-sun-solaris2.9/opt/plain/erl_main.o
Using built-in specs.
Target: sparc-sun-solaris2.9
Configured with: ../gcc-4.2.2/configure --enable-shared --enable-threads
--with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --disable-libgcj
--disable-libffi --disable-libjava --disable-nls
Thread model: posix
gcc version 4.2.2
 /usr/local/libexec/gcc/sparc-sun-solaris2.9/4.2.2/collect2 -V
-R/usr/local/lib/sparcv9 -R/usr/local/ssl/lib/sparcv9 -Y
P,/usr/ccs/lib:/usr/lib -Qy -o
/usr/local/src/rpm-packages/BUILD/otp_src_R11B-5/bin/sparc-sun-solaris2.9/beam
/usr/local/lib/gcc/sparc-sun-solaris2.9/4.2.2/crt1.o
/usr/local/lib/gcc/sparc-sun-solaris2.9/4.2.2/crti.o /usr/ccs/lib/values-Xa.o
/usr/local/lib/gcc/sparc-sun-solaris2.9/4.2.2/crtbegin.o
-L/usr/local/lib/sparcv9 -L/usr/local/ssl/lib/sparcv9
-L/usr/local/lib/gcc/sparc-sun-solaris2.9/4.2.2 -L/usr/ccs/lib
-L/usr/local/lib/gcc/sparc-sun-solaris2.9/4.2.2/../../..
/usr/local/src/rpm-packages/BUILD/otp_src_R11B-5/erts/emulator/obj/sparc-sun-solaris2.9/opt/plain/erl_main.o
-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc
/usr/local/lib/gcc/sparc-sun-solaris2.9/4.2.2/crtend.o
/usr/local/lib/gcc/sparc-sun-solaris2.9/4.2.2/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.390
ld: fatal: file
/usr/local/src/rpm-packages/BUILD/otp_src_R11B-5/erts/emulator/obj/sparc-sun-solaris2.9/opt/plain/erl_main.o:
wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to
/usr/local/src/rpm-packages/BUILD/otp_src_R11B-5/bin/sparc-sun-solaris2.9/beam

You get an ELFCLASS error everytime it links with 64bit. The sun ld that gcc
was configured with thinks its being handed a 32bit file by default and chokes
on 64bit. I'm assuming gcc has no way of telling it to expect 64bit and thats
where it dies. The file I'm showing above had been build with gcc -mcpu=v9
-m64, so it should pass that along, but it doesn't. I'm guess I'm going to have
to have two flavors of gcc after all. 64bit with gnu ld and 32bit with sun ld.

Is there any chance of getting around this? I tried LD=/usr/local/gnu/bin/ld
but it ignore it.


-- 

dhaliK at jla dot rutgers dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |UNCONFIRMED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33598


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]