how to cross-compile LFS5.0 with nALFS?

Marcus Furlong furlongm at hotmail.com
Tue May 18 08:20:17 PDT 2004


On Sunday 16 May 2004 21:22, vnevoa wrote:

> [...]

It's not nALFS, but I have some scripts that do x86 cross-compiling, I'll
send them on if you want. Currently it's 5.0ish, but I'll update for 5.1 as
soon as I can. It takes about an hour and a half to build a system on an
XP2000+. Normally, I take the hard disk out of the old machine, put it into
the new one and run the scripts to build the system. It has worked
successfully on a 486's and 586's, but the 386 build wouldn't boot because
the kernel wanted 4mb of RAM and I only had 2mb :-( (Anyone got a spare
Compaq 386s/20? This is one of those machines that only takes a certain
type of RAM made by Compaq for _their_ 386's!)
 
> Second: I have read the LFS hint on cross-compiling for the x86, and
> frankly, I don't like it. The whole "uname" hack is inelegant... as to
> the $CHOST variable, I've tried setting it to "i486-pc-linux-gnu" in the
> Chapter 5 files that establish environments, like binutils-pass1.xml,
> binutils-pass2.xml, gcc-pass1.xml, gcc-pass2.xml, and glibc.xml, but it
> didn't make any difference, I still get the "/tools/i686-pc-linux-gnu/"
> directory. Now the question: is there a clean and automated way to do
> this, or must I resort to the "uname" hack or set the CFLAGS and
> CXXFLAGS in almost every file??...

Lots of configure scripts use uname to get the architecture and won't pay
any attention to environment variables...

Personally, I use the uname module, but the x86 cross-compiling hint is
woefully out of date. The author has a newer (unfinished) version on his
website, google and you'll find it. I've fixed a lot of little things that
are broken with both versions of the hint... Unfortunately my notes went on
fire (really!) so if you want a list of changes you'll have to trawl
through the package descriptors...

Using the script, you only need the set the build architecture once, in a
config file. It loads the module and passes the appropriate flags to every
package build automatically.

Anyway, gimme a shout if you want a copy.

Marcus.



More information about the alfs-discuss mailing list