glibc breaks in i686 to i586 cross-compile

David Higgs dhiggs at spectracomcorp.com
Wed Nov 9 12:33:49 PST 2005


Heh, I guess I asked too soon; that was going to be my next attempt.

I started over fresh with a uname hack, and now everything so far
(through Ch. 5 glibc) is looking good.  I don't expect anything to break
from here out.

Thanks again!

--david

-----Original Message-----
From: cross-lfs-bounces at linuxfromscratch.org
[mailto:cross-lfs-bounces at linuxfromscratch.org] On Behalf Of Jeremy
Huntwork
Sent: Wednesday, November 09, 2005 1:24 PM
To: Cross-LFS Discussion List
Subject: Re: glibc breaks in i686 to i586 cross-compile

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"
#!/bin/sh
uname.real "$@" | sed 's/686/586/'
EOF

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.

--
JH

-- 
http://linuxfromscratch.org/mailman/listinfo/cross-lfs
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page



More information about the cross-lfs mailing list