glibc breaks in i686 to i586 cross-compile

Jeremy Huntwork jhuntwork at
Wed Nov 9 10:24:26 PST 2005

David Higgs wrote:
> Good afternoon,
> I am wondering if anyone has experienced problems building glibc for an
> i586 target using an i686 build environment.

In a situation like this, you shouldn't need to cross-compile. Set those 
flags like you have done, -march=i586 is a good one. (Make sure you set 
it both for lfs and in chroot.)

Then use the uname hack. There's a kernel module you can compile and 
load which will work until you unload it (this method is probably 
preferable as it allows less room for mistakes). Google for it, or ask 
Jim G. about it.

Otherwise, you can create a wrapper script for uname:

mv /bin/uname /bin/uname.real
cat > /bin/uname << "EOF"
uname.real "$@" | sed 's/686/586/'

The drawback to the wrapper script is that you have to do it again after 
each install of coreutils.

Either of the above hacks should effectively create i586 binaries.


More information about the cross-lfs mailing list