Gentoo Archives: gentoo-amd64

From: Samir Mishra <sqmishra@×××.ae>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Re: Difference between multilib & no-multilib stages
Date: Fri, 21 Apr 2006 12:08:41
Message-Id: 4448CA27.8020804@eim.ae
In Reply to: [gentoo-amd64] Re: Difference between multilib & no-multilib stages by Duncan <1i5t5.duncan@cox.net>
1 Thanks for a most thorough explanation. Your response should be included
2 in the AMD64 handbook.
3
4 > However, 32-bit is possible by adding the appropriate CFLAGS.
5
6 I assume this can be achieved by switching the CHOST environment variable to the X86 relevant one. In this instance, if I change the CHOST variable, is it also necessary to add -m32 to the CFLAGS, or for that matter, make any changes to the C[XX]FLAGS?
7
8 Also, given that I have the multilib libraries installed, is there any
9 way to ensure that only the 64-bit libraries are used when compiling, in
10 effect disable all 32-bit libraries during the compile stage? I'm more
11 interested in having things work, but I would like to keep track of all
12 packages that use any of the 32-bit libraries and upgrade these to the
13 full 64-bit versions when updates to the packages are available.
14
15 Thanks again.
16
17 Duncan wrote:
18 > Samir Mishra posted <44489DFB.4070705@×××.ae>, excerpted below, on Fri,
19 > 21 Apr 2006 12:55:23 +0400:
20 >
21 >
22 >> What's the difference between the multilib & no-multilib stages? If I'm
23 >> compiling all packages with the X86_64 CHOST flag, will packages always
24 >> compile with X86_64 libs even when 32-bit libraries are on the system if
25 >> I use multilib?
26 >>
27 >
28 > Multilib stages will have a 32-bit capable (both 64-bit and 32-bit) gcc,
29 > and will have glibc libraries for both bitnesses as well. I'm not sure if
30 > the portage sandbox is included in the stages or only added later (stages
31 > include bare-minimum cut-down versions of some things, cutting out
32 > dependencies they'd otherwise have), but if it's included, there'd be
33 > both 64-bit and 32-bit versions of it, as well. No-multilib will only
34 > include the 64-bit capabilities -- no 32-bit included. (To switch from
35 > multilib to no-multilib later on is therefore relatively easy, just switch
36 > your profile, merge grub-static replacing grub, and remerge gcc, sandbox,
37 > and glibc. The reverse, no-multilib to multilib, is far harder, the
38 > easiest way being to install from the multilib stages and go from there.)
39 >
40 > With the X86_64 CHOST and multilib, it'll default to 64-bit compiling,
41 > yes. However, 32-bit is possible by adding the appropriate CFLAG.
42 >
43 > Note that under normal circumstances, you'll not want to emerge anything
44 > in 32-bit mode (save for stuff like grub and glibc that are special cases
45 > it knows about -- grub is 32-bit only, glibc is compiled both ways
46 > automatically, if you have a multilib toolchain and profile), as portage
47 > can't track 32-bit and 64-bit dependencies separately, so forcing 32-bit
48 > compilation of some things, using the default 64-bit for others, is a FAST
49 > WAY TO A BROKEN SYSTEM!!
50 >
51 > Two ways around that: Either (1) use a dedicated 32-bit chroot, with its
52 > own 32-bit portage instance that doesn't know anything about the main
53 > system and just tracks 32-bit stuff, or (2) do all your 32-bit compiling
54 > from tarball, not using portage. The chroot option will be preferable if
55 > you do a lot of 32-bit compiling, as it will allow the 32-bit portage
56 > instance to do what package managers are supposed to do -- track
57 > dependencies for you. There's documentation available to help. If you
58 > are only doing a single 32-bit app or two, and the needed libraries are
59 > pretty basic/mainline, you can probably emerge the needed 32-bit
60 > compatibility libraries (binaries), and only merge the specific individual
61 > 32-bit app you need. This will be easier if you aren't doing enough
62 > 32-bit compiling to make the automated portage handling of 32-bit
63 > dependency tracking worth the trouble of maintaining an almost=complete
64 > 32-bit Gentoo installation in the chroot.
65 >
66 > FWIW, 64-bit binaries can't use 32-bit libraries, neither can 32-bit
67 > binaries use 64-bit libraries, and gcc is smart enough not to try -- if
68 > it can't find the right ones, it causes the compile to fail.
69 >
70 > One example of this is compilation against the OpenGL libraries.
71 > Unfortunately, opengl-update (or eselect opengl if you are running the
72 > newer eselect, which I believe is ~arch only at this point) doesn't always
73 > get the symlinks to the headers pointed to the correct ones, sometimes
74 > trying to use the 32-bit ones if the appropriate 32-bit compatibility
75 > libraries are merged, instead of the 64-bit ones. It's not uncommon for
76 > folks to have problems merging anything that depends on these, until they
77 > correct the symlinks manually, to point them at the 64-bit versions.
78 > However, if gcc can't find the right ones, it will simply error out,
79 > allowing you to fix the problem, as it can't compile properly against the
80 > wrong ones.
81 >
82 >
83
84 --
85 gentoo-amd64@g.o mailing list

Replies

Subject Author
[gentoo-amd64] Re: Re: Difference between multilib & no-multilib stages Duncan <1i5t5.duncan@×××.net>