Multilib Questions

Ken Moffat ken at
Wed Dec 14 14:20:13 PST 2005

On Wed, 14 Dec 2005, Tushar Teredesai wrote:

> Hi:
> I recently acquired an AMD64 desktop (yay!). Before installing LFS on
> it, I have some questions regarding multilib. If they have already
> been answered before, feel free to hit me with a cluebat and point me
> to it.
> 1. The book builds /cross-tools and then uses that to build /tools. If
> I am not performing a native build, can I skip the cross-tools
> section?

Hi Tush,

  I think you are misunderstanding _something_ here, but I'm not quite 
sure what.  The system we create in /tools is similar to what regular 
lfs puts in /tools (not much more than a minimum to build a new final 
system), so for an amd64 multilib build we will create a biarch x86_64 
toolchain and necessary tools (that is, 64-bit code, plus some 32-bit 

  Now, you say "I am not performing a native build", so you are coming 
from i686 ?  In that case, _how_ are you going to create a 64-bit 
toolchain if you don't cross-compile ?

  And if you already have a multilib host, still don't skip it - this is 
the 'CLFS' book, for multilib it's the only game in town, and we 
actually put glibc into /tools during the first chapter "Constructing 
Cross-Compile Tools".

> 2. If I understand multilib correctly, I don't need to install the
> 32bit libraries for all packages, but only for the dependencies that I
> require. For example, if I need 32-bit mozilla, I only need to have
> 32bit libraries for all direct and indirect dependencies of mozilla.
> Correct?

  Correct.  So perhaps only expat, png, freetype, fontconfig, X, jpeg, 
(maybe tiff and/or gif if your version of mozilla uses them), pkgconfig, 
glib, pango, atk, gtk, libIDL, mozilla - depends a bit on what you 
intend to do with a 32-bit mozilla, I assume plugins, so you might be 
able to drop some of these, or may need to add something else.

> 3. Is there any recommendation for where to put the 32bit related
> executables (such as -config scripts for packages)?

  Ryan's scripts (in the svn repo beside the BOOK) use a wrapper, and I 
think move the programs to -32.  Of course, you have to identify which 
programs are of interest.  I've tried just moving them to -32, and then 
passing the program names to configure, if possible, or sedding the 
Makefiles, or overriding with various things.  On balance, I think I 
prefer Ryan's approach but I haven't tried it yet, and I don't know how 
much it solves and how much still needs kicking.

  Expect particular pain with jpeg-32 (I used Ryan's enormous patch from 
scripts/ in the end), pango-32 (or perhaps pango-64, the problems seem 
to vary for different builders), and mozilla.  I used firefox-1.0.7 and 
the only thing worse than trying to build it as -m32 on x86_64 was 
trying to build it at all on a less popular multilib (I abandoned that, 
maybe a newer version will be easier).

  You'll also need to put a wrapper in front of the mozilla script 
(/usr/lib/mozilla/mozilla or whatever it is called), so that you can 
pass a different PANGO_RC_FILE to the main wrapper script.

  The bottom line for multilib BCLFS is that it helps to know what each 
package installs, and you can generally expect some pain in the most 
unlikely packages, so take your time and have fun!

  I'm threatening to produce a hint for firefox-1.0.7, but I haven't 
finished writing it up yet, my glib/gtk versions are old, and anyway 
I've still got pango issues with a plugin (which doesn't load the icons 
for media control buttons).

  das eine Mal als Tragödie, das andere Mal als Farce

More information about the cross-lfs mailing list