1 |
Nikos Chantziaras posted on Sat, 14 Nov 2009 17:16:35 +0200 as excerpted: |
2 |
|
3 |
> On 11/14/2009 01:45 PM, Cheng Renquan wrote: |
4 |
>>[...] |
5 |
>> Furthermore, if compiling any other 32bit program on gentoo-amd64, it |
6 |
>> may need other more 32bit of libraries, |
7 |
>> |
8 |
>> Comparing other linux distros like fedora-x86_64 and debian-amd64, I |
9 |
>> knew there is simple way to archive this goal, just install both |
10 |
>> binutils.x86_64 and binutils.i686 |
11 |
>> packages, but on gentoo-amd64, how can we do this in a similarly simple |
12 |
>> way? |
13 |
>> |
14 |
>> How about add USE multilib support of every package that contains |
15 |
>> libraries? |
16 |
> |
17 |
> Gentoo doesn't support this yet. Work is underway to enable real |
18 |
> multilib support though. |
19 |
|
20 |
Nikos is correct... as far as he goes, but there are actually ways around |
21 |
it that he didn't describe. |
22 |
|
23 |
First, for a limited subset of libraries, there are pre-compiled x86_32 |
24 |
compatibility versions available. This is the "fast" solution, workable |
25 |
for most mainstream stuff, but in addition to being limited to the |
26 |
mainstream libraries, it isn't really gentoo-like in some ways as the |
27 |
binaries are all precompiled, and for all the reasons that people choose |
28 |
Gentoo, that's just not really satisfying to many Gentooers. Never-the- |
29 |
less, it suffices for many apps and most 32-bit games. |
30 |
|
31 |
The operative hint you need here is app-emulation/emul-linux-x86-*. |
32 |
Those packages are the various more-or-less mainstream pre-compiled |
33 |
x86_32 libraries. FWIW, there's a limited number of executables, as |
34 |
well, normally with the -bin suffix. mozilla-firefox-bin is one |
35 |
example. These aren't as popular (some would say necessary) as they once |
36 |
were, as there are now various 64-bit binary plugins for stuff such as |
37 |
flash, but for quite some time 64-bit was out in the cold in that regard, |
38 |
so if you chose to run proprietary-ware at all, you generally found the |
39 |
32-bit versions helpful as they'd run the proprietary 32-bit-only plugins |
40 |
and codecs, etc. |
41 |
|
42 |
The far less limited (virtually unlimited) and perhaps more Gentoo-ish |
43 |
but also MUCH more complicated and MUCH more work second alternative is |
44 |
to run a 32-bit chroot. The problem is that at this point, none of the |
45 |
package managers (at least not portage, and I don't believe paludis or |
46 |
pkgcore have the feature either) can properly track multiple ABI/bitness |
47 |
versions of the same package. Thus, for amd64, the package manager |
48 |
assumes all the packages are 64-bit, and if you were to merge one as 32- |
49 |
bit, it would replace the 64-bit version of the same package. |
50 |
|
51 |
The way around this is the 32-bit chroot. The idea, basically, is to |
52 |
setup a second instance of Gentoo in a chroot, so the portage (or other |
53 |
PM) running there doesn't know about the main 64-bit system, and the 64- |
54 |
bit system for the most part ignores the 32-bit chroot because it's not |
55 |
in its way. You mount-bind a few subtrees, typically /tmp, often |
56 |
/home, a couple others (I was going to use etc, instead of "a couple |
57 |
others", but then realized that was ambiguous, NOT /etc!), into the |
58 |
chroot, so they're seen by both systems, start from a normal x86 stage |
59 |
tarball, and with some notable exceptions, basically, install an almost |
60 |
complete 32-bit system in the chroot. In theory, you can skip many of |
61 |
the services, syslog, cron, etc, because the main system provides them |
62 |
for both. In fact, since you have a nearly complete 32-bit system |
63 |
anyway, in many cases it's worth it to just do the whole thing (but maybe |
64 |
without the full X, kde/gnome, whatever, or maybe with it, depending on |
65 |
your goals for the respective sides), and then be able to dual boot to |
66 |
one or the other as desired. |
67 |
|
68 |
There's more documentation, including a nice Gentoo/AMD64 32-bit chroot |
69 |
guide, available. See the documentation section at the Gentoo/AMD64 |
70 |
project page. As you're asking about this, you probably haven't read the |
71 |
FAQ yet, so I'd start with that. You're likely to find a few of your |
72 |
other questions answered there. If after that (and reading the above) |
73 |
you're interested in the 32-bit chroot idea, you can read the 32-bit |
74 |
chroot guide and then decide if it's worth it or if you want to try the |
75 |
emul-linux-x86 stuff first. |
76 |
|
77 |
Here's the Gentoo/AMD64 project page link. |
78 |
Again, check the documentation section. |
79 |
|
80 |
http://amd64.gentoo.org |
81 |
|
82 |
One more possibility. If you only have one or two libraries you need |
83 |
that aren't available as precompiled binaries in the emul-* packages, |
84 |
once you have the 32-bit dependencies installed, you may well be able to |
85 |
compile them manually, outside portage, using -m32. However, once you |
86 |
get more than a couple to worry about, the complexity of trying to handle |
87 |
all the dependencies manually increases more or less geometrically |
88 |
proportional to the number of packages you're trying to handle, so it |
89 |
very quickly becomes easier to simply do the chroot and let portage's |
90 |
automation handle it. YMMV. |
91 |
|
92 |
Finally, a bit more detail on what Nikos hinted at. There's a couple of |
93 |
experimental projects whereby portage is modified to be able to handle |
94 |
multiple ABI installations in parallel. As a matter of practice, I don't |
95 |
know if they'll ever get merged, because we've gone this long without it, |
96 |
and as I mentioned, the worst need was along about 2006 or so, when a lot |
97 |
of folks had switched already but Flash and etc weren't yet available for |
98 |
64-bit, and even mainstream FLOSS apps like Open Office hadn't been |
99 |
ported. Since pretty much everything mainstream FLOSS has been ported |
100 |
now, and the proprietaryware folks are coming around to 64-bit as well, |
101 |
there's far less need for multilib in general than there used to be, and |
102 |
the need/demand will be ever weaker with time. If Gentoo/AMD64 got along |
103 |
this long without it, and since we're well past the hump, now, there's |
104 |
little real practical reason to worry about it -- for Gentoo/AMD64, at |
105 |
least. But of course there's other archs it would benefit as well, some |
106 |
of which have more than two variants, and at least for the devs and arch- |
107 |
testers, it could be very useful to be able to be able to install, test |
108 |
and otherwise work on multiple bitnesses at once. But AMD64 was the big |
109 |
one, and the others too have gone this long without it. So really, what |
110 |
it comes down to is whether enough devs prioritize it high enough to |
111 |
continue pushing it until it's not only working well, but until the other |
112 |
devs accept it as worth the hassle, an it becomes a part of portage (and/ |
113 |
or the other PMs) and Gentoo in general. Yes, there's a couple devs |
114 |
working on it, but whether their pet project will remain of /enough/ |
115 |
interest to them for long enough to be worth pushing into mainline |
116 |
Gentoo, is anyone's guess. |
117 |
|
118 |
-- |
119 |
Duncan - List replies preferred. No HTML msgs. |
120 |
"Every nonfree program has a lord, a master -- |
121 |
and if you use the program, he is your master." Richard Stallman |