Re: semi-newbie | provs linking 32-bit lib on x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



f.query wrote:
I'm having some problems compiling/linking a 32-bit application on my Opteron (x86_64) box that is currently running Fedora 11 (with both 64- and 32-bit dev libs installed). Compilation works perfectly for the 64-bit version, but not the 32-bit. System runs gcc 4.4.1. Code is actually FORTRAN (using gfortran as compiler), but that isn't the issue. I also note that it all worked fine under Fedora 9 - I could built 32- and 64-bit apps without a problem.

Here is the compilation sequence (which again works perfectly for 64-bit).

1. compile Linpack library. Here is the makefile

COMPILER = gfortran
COPTIONS = -c -m32 -O2
Linpack.a:
$(COMPILER) $(COPTIONS) *.f
ar q Linpack.a *.o

What about looking what the 'Linpack.a' is ? There are many commands for this like 'file', 'readelf' etc.

gfortran *.o -o mms1 -L/home/me/Desktop/linMMS1/src-gfortran-6.x -lLinpack /usr/bin/ld: skipping incompatible /home/me/Desktop/linMMS1/src-gfortran-6.x/libLinpack.a when searching for -lLinpack
/usr/bin/ld: cannot find -lLinpack
collect2: ld returned 1 exit status
make: *** [mms1] Error 1

Well, the library libLinpack.a is definitely there, and was compiled with -m32, so I'm not sure at all what the problem is - especically, why it is incompatible.

Barely trusting something being what is expected is not wise when a simple command would tell the truth...

As noted, this problem only happens when I try 32-bit compilation. I tried adding -m32 to the linker call ($(LINKER) -m32 *.o -o mms1 -L/home/me/Desktop/linMMS1/src-gfortran-6.x -lLinpack), but that didn't change a thing. But, it did generate a new error message:

gfortran -m32 *.o -o mms1 -L/home/me/Desktop/linMMS1/src-gfortran-6.x -lLinpack
/usr/bin/ld: crt1.o: No such file: No such file or directory

Are you sure that your "Fedora 11 (with both 64- and 32-bit dev libs installed)" isn't bullshit? Does the '/usr/lib' have the same required
development files like 'crt1.o' as the '/usr/lib64' ?

Maybe your first link without '-m32' found the 64-bit stuff and then saw the 32-bit 'libLinpack.a' being incompatible with them...


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux