Gentoo Archives: gentoo-alt

From: Johan Hattne <johan.hattne@××××××××××××.de>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] revdep-rebuild and install_name
Date: Thu, 10 May 2007 10:27:28
Message-Id: E4A156D2-3611-4E6B-B503-C325BBA6B82E@embl-hamburg.de
In Reply to: Re: [gentoo-alt] revdep-rebuild and install_name by Fabian Groffen
1 On 8 May 2007, at 22:01, Fabian Groffen wrote:
2
3 > The compiler, linker and runtime linker all default to /usr/local/lib,
4 > /usr/lib, /lib to search for libraries. This means, (also on
5 > Darwin in
6 > a way) that if there is no path given for a dynamic library, it is
7 > searched for in those three paths. You can influence that by
8 > setting a
9 > special variable, but that's in general considered to be a bad
10 > practise.
11
12 I think there will always be a path for a dynamic library: if one
13 wasn't set using -install_name, then whatever was given to -o will be
14 used. Every dynamic library has itself as a dependency, and this
15 dependency will end up as a dependency of whatever links against the
16 library.
17
18 > In Gentoo the libraries are never copied, but on GNU/ELF systems,
19 > LD-wrapper scripts are made. Because Darwin (and more systems) don't
20 > grok those scripts, we create symlinks for those systems. The reason
21 > why this is done, is because in some cases GCC decides to make a
22 > static
23 > binary instead of a dynamic one if it doesn't see a dynamic library in
24 > /usr/lib. I don't know the details of this, it's what I know from the
25 > eclass that does this creating of the wrapper or symlink.
26
27 I didn't know this.
28
29 >>> ncurses patch: no way, the main tree does it like that, so not
30 >>> going to
31 >>> change that.
32 >>
33 >> ncurses is configured with --libdir=/lib. Then, whatever parts
34 >> aren't
35 >> needed in /lib are moved to /usr/lib, with the effect that moved
36 >> items
37 >> would no longer be found in /lib. What I tried to do was to
38 >> configure with
39 >> --libdir=/usr/lib, move necessary things to /lib and create links
40 >> where the
41 >> moved things used to be.
42
43 Maybe I misunderstood something, but to me the idea is to _avoid_
44 moving stuff from their install location _without_ leaving a symlink/
45 wrapper behind. If stuff is moved without leaving something behind,
46 the linker will have to search for it elsewhere.
47
48 In the case of ncurses, libraries configured to /lib are moved to /
49 usr/lib without leaving symlinks/wrappers in /lib. Because most libs
50 will actually end up in /usr/lib, I thought configuring to /usr/lib
51 and then moving stuff to /lib while leaving suitable symlinks/
52 wrappers in /usr/lib would be sensible.
53
54 >>> readline patch: I don't understand it
55 >>
56 >> readline is configured with --libdir=/usr/lib. Then all libraries
57 >> are
58 >> moved to /lib. I wanted to create symlinks for all libraries
59 >> moved. I
60 >> guess the intention would have been clearer if I had configured with
61 >> --libdir=/lib and skipped the move altogether (not tested).
62
63 What I don't understand is why readline is configured to /usr/lib if
64 everything is going to be moved to /lib anyway? To me it seems
65 clearer to configure to /lib, and then create whatever symlinks/
66 wrappers in /usr/lib are needed to prevent static linking.
67
68 > It's good to put it on the table. I was a bit in a hurry when I
69 > replied, so I forgot to say that I like the feedback. I think
70 > there is
71 > no better way than keeping all platforms aligned wherever this is
72 > possible. And this library location problem seems to be not a problem
73 > on Darwin, but it does affect existing users, unfortunately. However,
74 > it is a one-time pain, and a risk of running the highly experimental
75 > Gentoo Alt/Prefix project ;)
76
77 I'm all for alignment, too. And I have a lot to learn!
78
79 // Cheers; Johan
80 --
81 gentoo-alt@g.o mailing list

Replies

Subject Author
Re: [gentoo-alt] revdep-rebuild and install_name Fabian Groffen <grobian@g.o>