Compiling 32bit on 64bit Fedora

Nathaniel McCallum nathaniel at natemccallum.com
Wed Sep 7 15:52:58 UTC 2011


"gcc -m32 -o foo foo.c" gives me:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory

If I copy the gnu/stubs-32.h file from the 32bit glibc-devel package
into the right place and run the command above again I get:
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.1/libgcc_s.so when
searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for
-lc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.1/libgcc_s.so when
searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status

Hrm...

Am I doing something wrong? Or is this a packaging bug? I can't think of
any reason why I shouldn't be able to compile at least a basic C program
with no deps as 32bit on 64bit.

Nathaniel


More information about the devel mailing list