Cross-LFS build method

Ryan.Oliver at Ryan.Oliver at
Thu Jun 16 19:30:47 PDT 2005

-----lfs-dev-bounces at wrote: -----

>To: LFS Developers Mailinglist
>From: Jeremy Huntwork
>Sent by: lfs-dev-bounces at
>Date: 06/17/2005 07:34AM
>Subject: Re: Cross-LFS build method
>Archaic wrote:
>> On Thu, Jun 16, 2005 at 11:19:14PM +0200, wrote:
>>>In that case, that is the most common one, to create cross-tools is
>>>a maybe needed for purity and isolation from the host system. But
>to have to
>>>cross-compile the full final system look excessive.
>> I strongly agree with the excessive part.
>Yes, me too. I hadn't thought of that before. But I wonder if there's
>way to set the instructions for the final system such that they would
>work both if you were cross-compiling or if you were natively
>But then, if you're natively compiling without a chroot I suppose you
>lose some of the purity, eh?

Main reason for the native build is so configure will pickup everything
correctly, some assumptions do get made by autofoo when cross-compiling.

If you wanted speed you could
a) run configure on the target system, but cross-compile on the faster host
   You would
   1) create sysrooted cross-tools on the compile host with /lib /usr/lib
      and /usr/include nfs mounted from the target system into the
   2) nfs mount your build dir from the compiler host onto the target host
      in the same location
   3) run configure specifying CC, CXX etc as TARGET-gcc on the target host
   4) switch to the compile host and run make

b) Use distcc, you would setup a cross-toolchain on the faster host(s) as
   per 1 above, and specify CC=TARGET-gcc to configure so distcc uses the
   correct gcc on the other compile nodes

This way everything gets configured correctly, and those packages which
dont like being cross-compiled ( due to AC_RUN checks etc ) wouldn't be

This is of course completely out of scope.

If you want to try a full 1 pass cross-build, you can try it by using the
cross-lfs scripts and setting USE_SYSROOT to Y, but note it is the 2 pass
build method (with configures run native) which ensures everything is
built correctly for the final system...

 Best Regards

More information about the lfs-dev mailing list