Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: Difference between multilib & no-multilib stages
Date: Fri, 21 Apr 2006 11:25:56
Message-Id: pan.2006.04.21.11.23.41.863239@cox.net
In Reply to: [gentoo-amd64] Difference between multilib & no-multilib stages by Samir Mishra
1 Samir Mishra posted <44489DFB.4070705@×××.ae>, excerpted below, on Fri,
2 21 Apr 2006 12:55:23 +0400:
3
4 > What's the difference between the multilib & no-multilib stages? If I'm
5 > compiling all packages with the X86_64 CHOST flag, will packages always
6 > compile with X86_64 libs even when 32-bit libraries are on the system if
7 > I use multilib?
8
9 Multilib stages will have a 32-bit capable (both 64-bit and 32-bit) gcc,
10 and will have glibc libraries for both bitnesses as well. I'm not sure if
11 the portage sandbox is included in the stages or only added later (stages
12 include bare-minimum cut-down versions of some things, cutting out
13 dependencies they'd otherwise have), but if it's included, there'd be
14 both 64-bit and 32-bit versions of it, as well. No-multilib will only
15 include the 64-bit capabilities -- no 32-bit included. (To switch from
16 multilib to no-multilib later on is therefore relatively easy, just switch
17 your profile, merge grub-static replacing grub, and remerge gcc, sandbox,
18 and glibc. The reverse, no-multilib to multilib, is far harder, the
19 easiest way being to install from the multilib stages and go from there.)
20
21 With the X86_64 CHOST and multilib, it'll default to 64-bit compiling,
22 yes. However, 32-bit is possible by adding the appropriate CFLAG.
23
24 Note that under normal circumstances, you'll not want to emerge anything
25 in 32-bit mode (save for stuff like grub and glibc that are special cases
26 it knows about -- grub is 32-bit only, glibc is compiled both ways
27 automatically, if you have a multilib toolchain and profile), as portage
28 can't track 32-bit and 64-bit dependencies separately, so forcing 32-bit
29 compilation of some things, using the default 64-bit for others, is a FAST
30 WAY TO A BROKEN SYSTEM!!
31
32 Two ways around that: Either (1) use a dedicated 32-bit chroot, with its
33 own 32-bit portage instance that doesn't know anything about the main
34 system and just tracks 32-bit stuff, or (2) do all your 32-bit compiling
35 from tarball, not using portage. The chroot option will be preferable if
36 you do a lot of 32-bit compiling, as it will allow the 32-bit portage
37 instance to do what package managers are supposed to do -- track
38 dependencies for you. There's documentation available to help. If you
39 are only doing a single 32-bit app or two, and the needed libraries are
40 pretty basic/mainline, you can probably emerge the needed 32-bit
41 compatibility libraries (binaries), and only merge the specific individual
42 32-bit app you need. This will be easier if you aren't doing enough
43 32-bit compiling to make the automated portage handling of 32-bit
44 dependency tracking worth the trouble of maintaining an almost=complete
45 32-bit Gentoo installation in the chroot.
46
47 FWIW, 64-bit binaries can't use 32-bit libraries, neither can 32-bit
48 binaries use 64-bit libraries, and gcc is smart enough not to try -- if
49 it can't find the right ones, it causes the compile to fail.
50
51 One example of this is compilation against the OpenGL libraries.
52 Unfortunately, opengl-update (or eselect opengl if you are running the
53 newer eselect, which I believe is ~arch only at this point) doesn't always
54 get the symlinks to the headers pointed to the correct ones, sometimes
55 trying to use the 32-bit ones if the appropriate 32-bit compatibility
56 libraries are merged, instead of the 64-bit ones. It's not uncommon for
57 folks to have problems merging anything that depends on these, until they
58 correct the symlinks manually, to point them at the 64-bit versions.
59 However, if gcc can't find the right ones, it will simply error out,
60 allowing you to fix the problem, as it can't compile properly against the
61 wrong ones.
62
63 --
64 Duncan - List replies preferred. No HTML msgs.
65 "Every nonfree program has a lord, a master --
66 and if you use the program, he is your master." Richard Stallman in
67 http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html
68
69
70 --
71 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] Re: Difference between multilib & no-multilib stages Samir Mishra <sqmishra@×××.ae>