Compiling 32bit on 64bit Fedora

Jakub Jelinek jakub at redhat.com
Wed Sep 7 15:56:31 UTC 2011


On Wed, Sep 07, 2011 at 11:52:58AM -0400, Nathaniel McCallum wrote:
> "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.

No, it is a user error.  The packaging goal is that nobody is forced to have
32-bit packages installed on x86_64 (and similarly for other architectures).
So, if you want to compile/link 32-bit packages, you need to install a
minimal set of 32-bit packages (at least
yum install glibc-devel.i686 libgcc.i686
).

	Jakub


More information about the devel mailing list