What is MLFS (Multilib-LFS)?

Multilib-LFS is a variant of the LFS book. This variant builds a system which is able to execute 32-bit binaries.

That sounds trivial, but it isn't. Nowadays, nearly all CPUs in our computers are 64-bit, and most of them are Intel-compatible. Historically this has been same years ago where 16-bit CPUs (8086) were common and new 32-bit CPUs coming up (80386). Common to all this kind of CPUs is, they are able to execute machine instructions of previous architectures, that means, a 32-bit CPU can execute 16-bit instructions, a 64-bit CPU can execute 32-bit instructions and so on. The problem is that the binary format in which those instructions are stored differs.

Since this CPU architecture is there for decades now, there is also a lot of software written for it. Unfortunatly, some of this software is only available as compiled binary, no source code is available. That may have different reasons, source code got lost or the source code has never been published due to license issues or simply because the creater didn't want to release the source code. But the binaries where distributed.

Since the format of 64-bit and 32-bit binaries are different, those old software cannot be executed on modern systems. This is where the multilib systems come to play and therefore Multilib-LFS. Multilib systems provide the environment so that 32-bit binaries can be executed on a 64-bit OS as well. This needs support by the kernel, but it needs also several other core libraries to be available in 32-bit versions.

But thats not all. There is another architecture which is somewhat between 32- and 64-bit. Its called x32. That is, the binaries operate with the full instruction set of a 64-bit CPU, but address space is limited to 32-bit (~4GB). Executing such binaries does either need a system built explicitly for x32 or a multilib system which is capable to run those binaries.

The Multilib-LFS is based on the actual LFS book but has some extensions in the instructions. In most cases, this extensions are repeatitions of the build instruction but just in another mode (m32 and/or mx32).

Why would I want an MLFS system?

Usually, there is no need to run a multilib system. But there might be circumstances which requires one:

Old software only available as binary

There might be software you want to use but that software is 32bit and there are no sources available to recompile. Even when source code is available it might not be possible to recompile because of unresolvable dependencies to other (old) packages. A printer driver only available as 32bit binary was one of the reasons to kick-off the mlfs project.

Other software requires multilib

For virtualization (here VirtualBox) m32-multilib is named as a prerequisite. When you want to install VirtualBox on a LFS system to be your VM host, only four additional non-BLFS packages are need. If you want to rebuild the 64bit and 32bit guest additions a multilib OS is required to build them.

Read online

There are three versions of the Multilib-LFS online:

This books are created when the LFS trunk has been merged to the multilib branch. That merge is currently done manually and therefore, it might be a few days behind.

Limitations

MLFS is hard to test except there are such old binaries available. When such a binary is executable, it unfortunatly does not mean that any other of those binaries will run, too. There might be BLFS library packages required as dependencies in that particular multilib environment. Neither MLFS nor BLFS covers that at the moment (there is no MBLFS) but MLFS should give an idea how to build those multilib libraries.

Thanks to