configure: error: C compiler cannot create executables -- New flavor
There are a few threads posted in the past with this problem but mine seems to be of a different flavor. (Most of the others did not have a C compiler installed, but I have gcc.)
Overall, I'm trying to perform the "./configure" step on the Grub source code. The "configure" fails with the subject message. Digging into the "config.log" shows that "configure" is trying to compile a simple C program with the "-m32" flag, and is failing to locate some library:
configure:2421: checking for C compiler default output file name
configure:2424: gcc -m32 conftest.c >&5
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../libc.so when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../libc.a when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/libc.a when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
I'm running SUSE Linux 10.2
Linux 2.6.26.60
The architecture is x86-64
gcc version 4.1.2
binutils 2.20
As far as I know, the "-m32" flag tells gcc to build a 32-bit executable, so it is probably looking for some 32-bit library on an x86-64 machine.
I then tried to compile my own little "hello.c" program. It worked fine with
# gcc hello.c
but failed with the same error msgs for
# gcc -m32 hello.c
This stuff works okay on RedHat rhel5 (x86-64) so the notion of compiling with "-m32" on x86-64 is mainstream.
Any idea why gcc cannot find the library it is looking for?
|