From: Dan Debertin Date: 2003-07-10T11:57:56+09:00 Subject: Re: build problems with 1.8, solaris and sparc options Daniel Berger writes: This is compiled 64-bit: > gcc -fPIC -g -O2 -m64 -mcpu=ultrasparc -I. -I/usr/local/src/ruby > -I/usr/local/src/ruby -I/usr/local/src/ruby/ext/bigdecimal -c bigdecimal.c This isn't: > gcc -Wl,-G -L"/usr/local/src/ruby" -L"/opt/lib" -o bigdecimal.so > bigdecimal.o -ldl -lcrypt -lm -lc > ld: fatal: file bigdecimal.o: wrong ELF class: ELFCLASS64 > ld: fatal: File processing errors. No output written to bigdecimal.so > collect2: ld returned 1 exit status You can't mix 32-bit and 64-bit libraries/object files. At the link phase, ld doesn't know you're trying to make a 64-bit executable, so it looks under /usr/lib for -ldl, -lm, etc., instead of /usr/lib/64. (BTW, 'elfdump -e' can be invaluable in diagnosing problems like this.) An even nastier surprise is in store for you if you sneak -m64 into the CFLAGS of the second command -- your libgcc_s is probably compiled 32-bit, preventing it from being used with any 64-bit libs or programs. At this point, using gcc to build 64-bit executables under Solaris is IMO too much of an ordeal. Dan -- /^Dan Debertin$/ | The world is coming to an end ... airboss@nodewarrior.org | SAVE YOUR BUFFERS!!! www.nodewarrior.org |