What is Multilib?

Multilib is the ability to execute software that was built for another architecture different from your system's. The most common example is that the user with an x86_64 CPU is wanting to execute software built to run on a 32-bit CPU. To better establish terms, x86_64 is 64-bit and AMD64, and 32-bit refers to the ix86 [1] architecture and IA-32. x86 in general refers to the architecture family, where 32-bit/IA-32 and 64-bit/AMD64 live.

Note

This book covers only the x86 family, specifically running instructions on x86_64/AMD64/64-bit, and does not cover multilib on architectures with similar capabilities like ARM.

How Does it Work?

At the barebones level, multilib can be achieved by having the hardware capable of 32-bit x86 emulation. However, 32-bit software often has dependencies, and those dependencies need to be in the same architecture as the software. Thus, multilib becomes more complex.

Distros often square this dependency by simply downloading the 32-bit libraries, sometimes requiring enabling a profile or database. This automatically resolves issues. The principle of the LFS family, though, is to compile almost everything from source with maximum control. The issue then starts to ultimately become "how can we compile 32-bit libraries on AMD64?" which the question itself becomes complicated, but the answer is straightforward.



[1] The x can vary from 3 to 6. The x can also be written as ? or *.