This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Trouble linking 32-bit and 64-bit objects


I am having problems with binutils.  I want to build binutils so it will
generate 32-bit or 64-bit objects/executables on Solaris 9.  I am using
gcc-3.4.3 which is configured to use Sun as/ld by default.  I have been
working mainly with 2.15.97 but have also tried 2.15.

If I configure binutils with the default target (sparc-sun-solaris2.9),
I can build 32-bit objects/executables using gcc (gcc
-B/path/to/binutils/bin source.c).  If I attempt a 64-bit compile (gcc
-m64 -B/path/to/binutils/bin source.c), I get errors about incompatible
libraries.  

[x47264 tmp] 77 $ gcc -m64 -o hello -B/tmp/binutils/bin hello.c
/tmp/binutils/bin/ld: skipping incompatible
/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/l
ibgcc.a when searching for -lgcc
/tmp/binutils/bin/ld: skipping incompatible
/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/l
ibgcc_eh.a when searching for -lgcc_eh
/tmp/binutils/bin/ld: skipping incompatible /lib/sparcv9/libc.so when
searching for -lc
/tmp/binutils/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so
when searching for -lc
/tmp/binutils/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so
when searching for -lc
/tmp/binutils/bin/ld: skipping incompatible
/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/l
ibgcc.a when searching for -lgcc
/tmp/binutils/bin/ld: skipping incompatible
/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/l
ibgcc_eh.a when searching for -lgcc_eh
/tmp/binutils/bin/ld: skipping incompatible /lib/sparcv9/libc.so when
searching for -lc
/tmp/binutils/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so
when searching for -lc
/tmp/binutils/bin/ld: skipping incompatible /usr/lib/sparcv9/libc.so
when searching for -lc
/tmp/binutils/bin/ld: warning: sparc:v9 architecture of input file
`/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/
crt1.o' is incompatible with sparc output
/tmp/binutils/bin/ld: warning: sparc:v9 architecture of input file
`/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/
crti.o' is incompatible with sparc output
/tmp/binutils/bin/ld: warning: sparc:v9 architecture of input file
`/usr/ccs/lib/sparcv9/values-Xa.o' is incompatible with sparc output
/tmp/binutils/bin/ld: warning: sparc:v9 architecture of input file
`/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/
crtbegin.o' is incompatible with sparc output
/tmp/binutils/bin/ld: warning: sparc:v9 architecture of input file
`/var/tmp//cc2bjsRU.o' is incompatible with sparc output
/tmp/binutils/bin/ld: warning: sparc:v9 architecture of input file
`/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/
crtend.o' is incompatible with sparc output
/tmp/binutils/bin/ld: warning: sparc:v9 architecture of input file
`/proj/muostps/tps/gcc-3.4.3/lib/gcc/sparc-sun-solaris2.9/3.4.3/sparcv9/
crtn.o' is incompatible with sparc output

If I configure binutils as 64-bit (sparcv9-sun-solaris2.9), I have the
opposite problem, I can compile 64-bit code but get errors for 32-bit
code.  

When I compile using Sun as/ld, I can compile 32-bit or 64-bit with no
errors.

I have tried using
--enable-targets=sparcv9-sun-solaris2.9,sparc-sun-solaris2.9 as
suggested in binutils/README with no success.  I have also tried
--enable-64-bit-bfd --enable-targets=all with no success.

Can GNU-binutils be built to generate 32-bit or 64-bit
objects/executables using the same binaries on Solaris?
 

Thank you.
--
Mike Allmen 


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