Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: 64-bit or 32-bit?
Date: Tue, 12 Jul 2005 15:43:01
Message-Id: pan.2005.07.12.15.37.36.88361@cox.net
In Reply to: [gentoo-amd64] 64-bit or 32-bit? by Anand Buddhdev
1 Anand Buddhdev posted <42D3A936.8060306@×××××.org>, excerpted below, on
2 Tue, 12 Jul 2005 13:27:50 +0200:
3
4 > I'm getting a new AMD64-based computer, and I'd like to run gentoo on it.
5 > I have been doing a bit of reading about running linux on AMD64, and it
6 > seems that in general, it's not a problem. The main issues seem to be with
7 > firefox 32-bit plugins, and win32 codecs for use with mplayer. My reading
8 > seems to suggest that if I stick to firefox-bin and mplayer32, then I
9 > should be fine. However, I'd like to hear from people who're already using
10 > gentoo on amd64, and what their experience is. Is it simple to get these
11 > apps to work? Or was there a lot of frustration involved. I've used linux
12 > and BSD systems for a long time, so I'm used to hacking, and I'm not
13 > afraid to mess around with scripts and compilers. But I've reached a point
14 > when I'd just like to be able to install a system, and have it work.
15 > Fedora Core almost allows that, except that I'm a bit fed up of the
16 > multiple repository problems, and no proper way of picking and choosing
17 > what exactly I want. I could recompile some of the packages from SRPMS,
18 > and specify my choices. But I reckoned that if recompiling was the way to
19 > go, then I'd give gentoo a try.
20 >
21 > One of the choices I'm facing is whether to install gentoo 64-bit, or
22 > 32-bit. Installing 32-bit on the AMD64 would make life easy, but kind of
23 > defeats the purpose of having a 64-bit processor. Hence my request for
24 > opinions. Should I go 64-bit, or stay in the 32-bit world for now?
25
26 Wow! Where to start? ... Keep in mind that the following describes more
27 the issues you might come across, than the good things, so it's going to
28 seem FAR worse than it actually is.
29
30 Going 32-bit is slightly easier, as you mention, altho 64-bit is getting
31 more mainstream every day. 100% 32-bit mode uses the generally larger
32 amd64 cache (normally 1M L3 cache, compared to perhaps half that on most
33 32-bit only processors), but doesn't make use of the other strengths of
34 the amd64 architecture, the biggest one of which is probably the expanded
35 number of hardware registers available in 64-bit mode. x86 has
36 traditionally been a rather register-limited arch, and the amd64 CPUs in
37 32-bit mode remain so for compatibility reasons, so the additional
38 registers only come into play in 64-bit mode. OTOH, for many things,
39 unless you have more than 4G memory, 32-bit is quite enough and conserves
40 resources a bit better. For that reason, on archs less register bound
41 than x86(32), the switch to 64-bit mode often has more downside for many
42 uses, than it does upside. x86_64, however, due to those extra registers
43 only available in 64-bit mode and because x86(32) has always been register
44 bound, with a fairly limited number of them, tends to swing the balance
45 rather further in favor of 64-bit mode than with other archs -- 64-bit
46 performance is often markedly better than 32-bit performance of the same
47 source code on the exact same CPU and hardware, the only difference being
48 whether it's compiled with -m32 or -m64, 32- or 64-bit. So... yes, I'd
49 say that while possible, installing only 32-bit Linux on AMD64 is indeed
50 wasting resources, to some extent.
51
52 ...
53
54 You've obviously been doing your research, and correctly found that the
55 main issues tend to be in cases of binary-only releases of various plugins
56 and codecs. If it's available in source-code form, it's generally
57 available for use in 64-bit mode on amd64. The quote I have chosen for my
58 sig pretty well gives my position on proprietary binary-only code in the
59 first place, so the availability or lack thereof of 64-bit binary-only
60 codecs and plugins is less of an issue for me than for many others, since
61 I'd prefer not to have binary-only stuff on my computer in the first
62 place. If it's not available in standardized form, playable with an
63 open source product, there are other things I can be doing with my time
64 anyway, and I'll just skip the proprietary stuff. Of course, I recognize
65 that not everybody has the same strong opinions on the subject as I do.
66 For these folks, it's useful to keep in mind that the x86_64 arch, amd64
67 and the Intel version, is the clear mainline successor to x86. Therefore,
68 32-bit-only binary-only codecs and plugins will be less and less of a
69 problem, as eventually all popular software products, freedomware or
70 proprietary, will have 64-bit versions as well. Now that 64-bit MSWormOS
71 is out of beta (or soon to be, I no longer track MSWormOS close enough to
72 be sure), 64-bit versions of the various codecs and plugins should be
73 available fairly shortly, I'd guess.
74
75 Before moving from the subject of 32-bit binary packages, I should also
76 mention that OpenOffice.org has 64-bit issues, or at least the 1.x
77 versions do. 2.x is supposed to work on amd64. However, note that due to
78 its size and complexity, OOo is one of the few apps that even many
79 hard-core Gentoo users prefer to merge the (32-bit) binary package of,
80 rather than compiling their own copy themselves. Thus, as with firefox
81 and mplayer (and their various codecs), the 32-bit OOo can be merged, only
82 it's even MORE widely used and tested than the other bin-pkgs. Of course,
83 you may or may not have reason to merge and use OOo anyway. I've found no
84 need for the various Office suites, here, and if I did, since I use KDE on
85 my desktop anyway, I'd probably try KOffice first.
86
87 ...
88
89 There's one other set of issues specific (in one sense, tho the general
90 issue affects others) to /Gentoo/ amd64 (as opposed to Fedora or Mandriva
91 or SuSE or whatever) that needs to be mentioned, the multilib thing, which
92 Gentoo /currently/ treats a bit differently than most of the other
93 distributions.
94
95 On a dual-32/64-bitness arch, there are often two copies of various
96 libraries needed, the 32-bit version and the 64-bit version. The method
97 for how this is handled has come to be referred to as "multilib". The
98 Linux Standard Base (LSB) / File Hierarchy Standard (FHS) standard
99 solution uses two separate dirs, lib64/ (thus, /lib64/, /usr/lib64/,
100 /usr/local/lib64/, etc) for the 64-bit libraries, reserving the
101 traditional lib/ dirs (thus /lib/, /usr/lib/, etc) for 32-bit shared
102 objects. (Note that shared objects, *.so.*, are the "libraries" of Linux,
103 similar in function to the dynamic link libraries, *.dll, of MSWormOS, but
104 being around Linux for awhile, you already knew that, I'm sure. This is
105 just for others that may be following along. =8^)
106
107 Gentoo similarly uses two separate dirs, but because Gentoo amd64
108 implemented them before the FHS standard defined the names for amd64,
109 Gentoo took the opposite approach, reasoning that lib/ should contain the
110 native bitness libraries, in this case the 64-bit libraries, with the
111 32-bit libraries in lib32/. The FHS version makes more sense for
112 compatibility with existing 32-bit packages, particularly binary-only ones
113 that may simply assume lib/ is 32-bit, while Gentoo's approach makes more
114 sense (in the absolute, but see below) in an almost entirely 64-bit
115 system, and moving forward to a time when 64-bit is mainlined.
116
117 The problem for Gentoo is that when the LSB/FHS standard was defined, it
118 /did/ become the standard. Packages now come from upstream with that
119 assumption, and it's a lot of work, and becomes ever more work as 64-bit
120 heads toward mainline, to continually patch everything to use the
121 non-standard Gentoo locations. Individually, it's usually not much work
122 at all, just supplying the proper configure option, but the work adds up
123 over thousands of packages, and with the standard defined and amd64/x86_64
124 clearly going mainline, it's a lot of /unnecessary/ work, moving forward.
125
126 Therefore, Gentoo amd64 is currently in the middle of a year or more
127 process to safely reverse direction, moving 64-bit libs from lib to lib64
128 (almost done), and eventually, 32-bit libs from lib32 to lib. Currently,
129 lib is usually a symlink to lib64, so 64-bit packages that haven't been
130 fixed yet still work if they install to lib. (32-bit packages are handled
131 a bit differently, as discussed below.)
132
133 Another aspect of what amounts to the same issue -- how to treat what
134 could be duplicate packages installed in both 32-bit and 64-bit mode -- is
135 dependency tracking. Imagine what happens if the 32-bit and 64-bit
136 dependency databases aren't kept separate. You go to emerge a 32-bit
137 package, and it sees the 64-bit libs it needs are already merged, so it
138 tries to merge, and fails because it's trying to link against 32-bit
139 libraries that aren't there to link against! Even worse would be the
140 possibility of merging 32-bit libraries when doing an update, then erasing
141 the "old" 64-bit versions of the same libraries as unneeded!
142
143 Obviously, this will NOT work, so 32-bit and 64-bit package dependency
144 and current installation tracking must be kept separate. Unfortunately,
145 current versions of portage, the Gentoo package management system, cannot
146 directly handle this requirement. Portage-CVS is slated to get this
147 ability (if it hasn't already been added) by the time it is released, but
148 current versions are stuck having to work around the issue.
149
150 There are a several different ways of managing things, depending on how
151 many 32-bit packages you plan on installing. For certain core packages,
152 currently gcc, glibc, and portage itself, the normal 2005.0 profile (which
153 is multilib, not 64-bit only, tho that's a subprofile option) causes
154 /both/ the 32-bit and 64-bit versions to be installed, so portage can
155 continue to track just the single package. The rest of the 32-bit "system
156 base" libraries are currently normally installed as 32-bit binary-only
157 compatibility packages (emul-linux-x86-*).
158
159 That's the base 32-bit compatibility installation. If you are only going
160 to be installing binary-only 32-bit software such as games and the
161 various codecs and plugins, this, and bin-packages such as mplayer32 if
162 desired, are all one needs.
163
164 If, with such an all-binary 32-bit installation you do decide to compile
165 and install 32-bit stuff yourself, it's *HIGHLY* recommended that you do
166 NOT use portage/emerge for doing so. Rather, procure the tarballs
167 directly, and install "manually", resolving any 32-bit dependencies and
168 installing them manually if necessary as well. Obviously, this will
169 become a rather huge hassle rather quickly, however, if you have more than
170 a couple 32-bit packages you want to compile from source.
171
172 For those who have a large list of 32-bit packages they want to run,
173 there's another option, the 32-bit chroot. The idea is to install a
174 minimal 32-bit Gentoo installation, without system services such as syslog
175 and cron and without a 32-bit kernel of course, but with all the usual
176 libraries and the like, and pointedly, with its own 32-bit portage
177 installation. Because it's in a chroot, this 32-bit portage installation
178 will be entirely separate from the system-wide 64-bit portage, so the
179 dependency tracking systems won't conflict with each other, and any
180 arbitrary package in portage can be merged as 32-bit, without in any way
181 affecting the system-wide 64-bit dependencies. Note that once this is
182 setup, it's possible to add the chroot's library and bin dirs to the
183 system-wide paths, and execute your 32-bit binaries system-wide, not just
184 within the chroot.
185
186 Obviously, for someone only merging one or two 32-bit packages, the chroot
187 solution is a lot of unnecessary work, but not so much for someone doing
188 many such packages, where the work of manually tracking dependencies would
189 quickly become rather unmanageable. Thus, the different choices for
190 different purposes. There's more documentation on the chroot option in
191 the technotes and other locations, if you decide to go this route.
192
193 Again, let me stress that this current less-than-ideal situation is
194 temporary, and will be going away, once both the multilib and portage
195 multi-bitness issues are resolved. In terms of timetable, that now looks
196 to be targeted at the 2006.0 release. (It was hoped that it would be done
197 for 2005.1 coming up shortly, but that appears unlikely, now, particularly
198 for the portage multi-bitness dependency tracking stuff, as betas aren't
199 out for the next version yet, meaning it couldn't go stable in time for
200 the next release, 2005.1.)
201
202 Again, as I said at the top, the reality isn't quite as bad as all the
203 above surely makes it sound. In reality, most things "just work", with
204 the caveat that you understand that 32-bit libraries won't work in 64-bit
205 applications, and the reverse, which you've obviously already figured out
206 from your own research, since you mentioned it.
207
208 ...
209
210 Now, some more general Gentoo newbie hints...
211
212 Before you start your installation, READ THE GENTOO HANDBOOK!! The first
213 section covers installation procedures and most folks read that as they
214 are installing, but it pays to read it thru (for your chosen arch) first,
215 getting an overview of what you will be doing, before you start. As you
216 are doing so, figure out which stage install you plan to use. A stage-3
217 starts from a mostly bootstrapped system is initially faster to get up
218 and running, but takes longer to get everything fully customized. A
219 stage-1 install is initially slower and more complicated, but you end up
220 knowing far more about how a Linux system works behind the scenes, when
221 you are done. Here, computing is my hobby, not a job, and learning a
222 primary purpose, so there was no question, I did a stage-1. In fact, I
223 went even FURTHER than that, and took apart the bootstrap script and
224 executed it step by step, manually. In doing so, I learned a LOT about
225 the system I was building than I knew about Linux before, but it DID take
226 me quite some time to do it.
227
228 Partitioning... If you are like me and use lots of separate partitions (I
229 have about 20, all told), one thing you'll find is that your /usr/ needs
230 to be bigger than with other distributions, because that's where the
231 portage tree and all the sources are kept (unless you put the portage tree
232 on its own partition or locate it elsewhere than the default
233 /usr/portage/). Similarly, you may want a larger /var/ or /var/tmp/ than
234 normal, since by default, that's where portage does all its compiling.
235 For the portage tree and sources, you'll probably want 3G minimum, 5G
236 or more if you use FEATURES=buildpkg (discussed below). As mentioned
237 above, OOo is the largest package in terms of compilation space needed in
238 portage, needing some 5G of scratch space to successfully compile. Again,
239 you'll likely not be compiling it as even x86 folks often use the binary
240 package for it, but that gives you an idea of the sort of scratch space
241 normally required for /var/tmp/. (Here, I've changed both those settings
242 from the default, keeping the portage tree in its own partition mounted in
243 a different location, and telling portage to use /tmp/ for its work,
244 rather than /var/tmp/, so it's possible to change both, but I'm giving you
245 the default locations, above.)
246
247 Another very useful hint for after the initial install, after you've
248 started customizing your config files (/etc/* and the like). Do *NOT*
249 just tell etc-update to go ahead and auto-merge all the new config files
250 after an update (the negative options), without knowing EXACTLY what you
251 are doing. FAR better to go thru each one individually, and see what it's
252 going to change, then let it make the changes or not as desired, than to
253 find out it killed your customizations on something critical like
254 /etc/fstab! (With /etc/fstab itself, that's no longer a problem, as the
255 package now updates fstab.example instead, but the problem caught MANY an
256 unwary Gentoo newbie before they changed that behavior, and the issue
257 still exists with other files.) Just exercise the usual caution you
258 should exercise anyway when running as root, think about what a command
259 will actually do before hitting that enter key, and you'll be fine. Fail
260 to do so, and your failure will EVENTUALLY bite you! Of course, if you've
261 been running BSDs and Linux for years, this idea won't be at all new to
262 you, only the specifics as applied to etc-update.
263
264 Before you do the install, however, as well as again afterward when you
265 are actually ready to start working on your new system, I'd suggest
266 reading the REST of the handbook as well. The working with Gentoo and
267 working with Portage sections should be quite interesting to you coming
268 from other distributions, as they are all about what makes Gentoo
269 different from the others. Learning about how Gentoo's boot process and
270 dependency ordering differs from the usual numbered init levels with
271 numbered start and stop symlinks pointing to the appropriate scripts, the
272 system most other distributions use, is both interesting and educational,
273 or I certainly found it so, anyway. (Once you actually get a
274 system up and start investigating, you'll find that in practice,
275 the init levels are still there. Gentoo just lets you deal with
276 them by name instead of number, if desired. However, the way
277 Gentoo's boot scripts resolve boot-time dependencies is VERY
278 fascinating!) Likewise with how portage works and the many ways to
279 customize it. It was fascinating seeing how much more flexible it made
280 things for the typical sysadmin, as compared to the typical rpm or deb
281 package management system, yet how even with all that flexibility, it
282 still managed to keep things simple and decently manageable, without
283 confusion. By reading these things ahead of time, you'll understand far
284 more about what makes Gentoo, Gentoo, and parts of the install that might
285 otherwise seem entirely arbitrary will be instead entirely logical and
286 natural. Reading it again as you actually start working with a running
287 Gentoo, you'll find things just seem to naturally work the way you'd
288 expect them to, where otherwise they'd seem just an arbitrary series of
289 commands that didn't make a lot of sense.
290
291 Of course, beyond the handbook, Gentoo has lots of additional
292 documentation -- one of its strengths as compared to other distros. How
293 to configure printing, how to configure your sound system, how to manage
294 udev, all this and more the Gentoo documentation covers in
295 Gentoo specific step-by-steps that other distributions lack.
296
297 One other specific document I should mention: the Gentoo amd64 technotes.
298 These explain most of the differences between x86 and amd64, both in what
299 you can expect from the hardware, and in software. Last I looked, some of
300 the technotes were a bit dated (they still referred to gcc-3.3 in the
301 future, for instance), but it's still a very good overview, covering
302 things like the 32-bit chroot option mentioned earlier, and the thing
303 about OOo, as well as things like common hardware issues and what to do
304 about them. I'll mention one important note specifically. BEFORE YOU
305 INSTALL GENTOO AMD64, UPDATE YOUR BIOS from the manufacturer's web site.
306 Even if the system is new, that doesn't mean it has the latest BIOS, and
307 MANY have found that the troubles they initially had "magically" went
308 away, when they installed the latest BIOS. Likewise, continue checking
309 periodically for additional updates. I had the latest when I installed
310 Gentoo, but additional BIOS updates since then have increased system
311 stability and performance, rather more than I would have expected, in fact.
312 The technotes can be a bit harder to find than the Gentoo Handbook and
313 other documentation, so here's a direct link:
314 http://www.gentoo.org/proj/en/base/amd64/technotes/index.xml (The
315 technotes are also linked from the main project page at
316 http://amd64.gentoo.org, which is easier to remember, and has some other
317 information as well, but the link from there is harder to find, so I
318 suggest bookmarking the direct link.)
319
320 Another useful hint, about portage, this time. You'll understand the
321 significance of this a bit more after reading the portage features chapter
322 of the working with Gentoo section of the handbook, but setting
323 FEATURES=buildpkg in make.conf causes portage to routinely build binary
324 packages of everything it emerges. This can be very useful for several
325 reasons. First, it's very helpful if you somehow break gcc, preventing
326 emerging gcc again to fix the issue. =8^( If you have the binary package
327 already built, it's a simple matter to remerge the binary package and have
328 a working gcc again! =8^) If it was an upgrade that broke it, simply
329 emerge the previous version's binary package rather than the newest! If
330 portage itself breaks, that means you can't emerge stuff, but since the
331 binary packages are simply tar.bz2 tarballs with a bit of additional
332 metadata tacked onto the end, you can simply extract the portage binpkg
333 tarball directly over your live filesystem, replacing the broken portage
334 files with good versions, and be back in business! =8^)
335
336 However, rescue functionality isn't the only thing binpkgs are good for.
337 Additionally, it's easy to switch between versions to troubleshoot
338 something or other, if necessary -- FAR easier than having to recompile an
339 old version to see if that fixes whatever the problem is, then recompiling
340 the new one again to get it back. Also, again, the binpkgs are simply
341 tbz2 files with a bit of extra metadata at the end, so it's easy enough to
342 go find a binpkg to see what a particular default config file looks like
343 in it, as compared to your customized installed version, or whether a file
344 that should exist but is missing, existed in the package as installed (and
345 therefore as archived in the binpkg), so it got deleted later, or if it
346 was missing in the installed version as well. Of course, I'm running
347 ~amd64 (the ~ indicating unstable or testing), and in fact sometimes
348 installing packages before they are even marked testing, testing them
349 early, so all this troubleshooting ability is more useful here than it
350 would be to an ordinary stable amd64 user, but it's always useful to have,
351 none-the-less.
352
353 So... hopefully that's all helpful and not too overwhelming... If you
354 follow this list/group regularly (which I'd recommend, it's not so busy
355 as to prevent it and ypu'll find useful information on what's ahead from
356 time to time, even if the usual discussion isn't of interest to you),
357 you'll find that yes, my replies are /often/ this long and detailed. <g>
358
359 --
360 Duncan - List replies preferred. No HTML msgs.
361 "Every nonfree program has a lord, a master --
362 and if you use the program, he is your master." Richard Stallman in
363 http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html
364
365
366 --
367 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] Re: 64-bit or 32-bit? Kyle Liddell <kyle@××××××××××××××××.net>