LFS 5.0 on AMD64 (x86-64)

Eric Johnson ejohns at ix.netcom.com
Sun Jan 4 12:06:04 PST 2004


I have built a system based on LFS 5.0 on my Opteron box and thought I would 
share my experiences here, since the topic is raised here sometimes.

My goal was to start with a recent, 32-bit only GNU/Linux system (I used 
Slackware 9.1) and build a basic GNU/Linux system with as much as possible built 
   for AMD64, but with the ability to build and run 32-bit binaries as well. 
Some notes on how I have done this are available at 
http://home.ix.netcom.com/~ejohns/glfs-amd64/index.html

The main differences between my build and LFS 5.0:

*  Since I was starting from 32-bit only system, I had to first build an AMD64 
cross-compiling toolchain.  Then, to run AMD64 binaries, I had to build and 
install a statically-linked AMD64 Linux kernel.  Both of these were installed in 
the host system before starting the LFS build.

*  For 32-bit compatibility, I needed a 32-bit glibc in addition to the AMD64 
one.  After completing chapter 6 (omitting grub), I build an i686 
cross-compiler, and built the 32-bit glibc using it.

*  After building the 32-bit glibc, I built gcc again with multilib enabled, so 
that the same build of gcc can produce both 32-bit and 64-bit AMD64 binaries.

*  Neither grub nor lilo would build natively for AMD64, so I built grub after 
building the multilib-enabled gcc.

I think the way I built the 32-bit glibc was not satisfactory; glibc-2.3.2 did 
not cross compile easily so I used glibc-2.3.1.  It would probably be better to 
build a 32-bit system to create the 32-bit glibc libraries, and copy them into 
the AMD64 system.

Everything in LFS 5.0, except grub, compiled natively for AMD64.  However, 
shadow had severe problems until I patched it (the patch is available at 
http://home.ix.netcom.com/~ejohns/glfs-amd64/patches/shadow-4.0.3-amd64-types.patch). 
  I have done very little with this system beyond the initial build; I would 
expect there are going to be problems with some of the other applications. 
AMD64 is a fairly new platform; anyone who tries to build their own system 
should probably expect to have to fix problems and seek out patches.





More information about the lfs-support mailing list