Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: Multilib or not?
Date: Thu, 27 Nov 2008 09:07:24
Message-Id: pan.2008.11.27.09.07.07@cox.net
In Reply to: Re: [gentoo-amd64] Re: Multilib or not? by Tonko Mulder
1 Tonko Mulder <tonko.mulder@×××××.com> posted
2 1227764120.6272.13.camel@Gaius, excerpted below, on Thu, 27 Nov 2008
3 06:35:20 +0100:
4
5 > tonko@Gaius ~ $ ls -dl /lib /lib64
6 > drwxr-xr-x 4 root root 46 nov 26 21:32 /lib
7 > drwxr-xr-x 10 root root 8192 nov 27 06:08 /lib64
8
9 OK, that's the problem, I believe. I too tried separate dirs, just to
10 see how it would go, and had problems.
11
12 It seems a few packages, probably lvm2 among them, use /lib some of the
13 time and /${LIBDIR} (which on amd64 equals /lib64) some of the time. In
14 particular, a couple packages I looked at (and lvm2 was probably one of
15 them but I've forgotten by this point) would install to one but the
16 initscripts would try to use the other.
17
18 Basically, they expect the usual Gentoo config which has a symlink one
19 way or the other (it doesn't particularly matter which way, various
20 Gentoo/amd64 stage releases have reversed each other). If each one is
21 its own dir, they fail, because they install to one and try to use the
22 other, at least part of the time.
23
24 So, preferably from single-user-mode or elsewise when there's nothing
25 that might crash due to their files temporarily moving out from under
26 them, move everything from one into the other, then delete the empty one
27 and create a symlink from it to the other.
28
29 As I said, which way you go shouldn't really matter. To some extent, it
30 depends on which one you think is the "proper" $LIBDIR in a 64-bit-only
31 system. If you think it's /lib because that's what you're used to using
32 on 32-bit or simply because it's shorter to type, make /lib64 the symlink
33 pointing at /lib. If you (like me) like the 64 specified, even in the
34 absence of any 32-bit, or if you want to stick closest to the LSB/FHS
35 standard [1] for amd64/x86_64, you'll make /lib the symlink pointed at /
36 lib64. In either case, if you ever decide you need to, you can always
37 reverse yourself later.
38
39 Technically, those rcscript/addons/*.sh do indeed belong in /lib since
40 they're shell scripts and as such are bitness independent [1, again].
41 However, I expect what's happening is that the initscripts are using
42 /${LIBDIR} for some of the calls, and on amd64 that's /lib64, so that's
43 where the initscripts are trying to find them at least for those calls.
44 As long as /lib and /lib64 ultimately resolve to the same place, it
45 doesn't matter, but if they are both real directories, BAD THINGS (tm)
46 happen.
47
48 ---
49 [1] As I understand it, the FHS, File Hierarchy Standard, part of the
50 LSB, is arguably inconsistent with itself in regard to $LIBDIR. Non-
51 native-code such as scripts and bytecode compiled stuff (python/perl/
52 java), where every arch gets the same files, pretty consistently belongs
53 in /lib and /usr/lib. But there's an inconsistency with where 64-bit
54 native-binary-code libraries go. On ia64 (itanic/itanium), 64-bit really
55 is seriously dominant and was intended to fully supplant 32-bit
56 immediately. It gets /lib. 32-bit is a distant also-ran that must be
57 content with (IIRC) /lib32.
58
59 On amd64/x86_64, the considerations were much different. Unlike ia64,
60 amd64 is real hardware dual-bitness and it was apparent even before it
61 came out (due to the flatlining of itanic, compared to predictions and
62 hype, at least) that many/most people wanted to be able to run both 32-
63 bit and 64-bit code on the same system at the same time. Due to the
64 dominance of existing 32-bit code, it was far easier to let it take /lib
65 so 32-bit packages wouldn't need any changes at all. Since the process
66 of making 64-bit packages already included porting the code, making sure
67 it was 64-bit safe, etc, adding the comparatively trivial task of having
68 it use /lib64 by default wasn't that big a deal, especially compared to
69 being forced to update all those otherwise perfectly fine 32-bit packages
70 to use something other than /lib. So unlike ia64, amd64/x86_64 let 32-
71 bit have /lib and standardized on /lib64 for 64-bit code. While this was
72 designed to let 32-bit and 64-bit exist at least semi-happily
73 side-by-side, once the standard was established it made little sense to
74 change it for 64-bit-only systems, so /lib64 it remains.
75
76 Of course then there's the whole (/usr)/libexec thing. The idea there is
77 that $LIBDIR (whether just lib or lib32/lib64) is for libraries and
78 $BINDIR is for executables designed to be run directly, but where are
79 executables really only designed to be called from other executables to
80 be placed? You don't want them in $BINDIR, since that's in $PATH and
81 thus users will see it with tab-completion and the like, and these
82 executables aren't designed to be run from the command line or otherwise
83 (from a WM menu) directly invoked by the user. Traditionally these went
84 in lib as well, generally in package level subdirs thereof, but some
85 people weren't happy with that and with the FHS standard, they decided
86 libexec was a more suitable standard location. So most systems now have
87 a libexec, but this bit of the standard isn't so well known and many
88 packages were already using lib by the time the standard came about and
89 didn't want to hassle the change, so only a relatively few packages
90 actually use libexec, despite what the standard says. Also, I've never
91 seen a root level /libexec, only /usr/libexec, so apparently it's only
92 for binaries not needed during early boot, only after /usr is mounted.
93
94 That's the story as I understand it for x86, ia64, and amd64/x86_64. I
95 really have no idea how the other archs, ppc and sparc at least of which
96 I know have both 32-bit and 64-bit variants, handle it, or what their FHS
97 spec might be.
98
99 --
100 Duncan - List replies preferred. No HTML msgs.
101 "Every nonfree program has a lord, a master --
102 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-amd64] Re: Multilib or not? Tonko <tonko.mulder@×××××.com>