Gentoo Archives: gentoo-alt

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] AIX linking adventure
Date: Mon, 21 Feb 2011 16:14:43
Message-Id: 4D628F54.9050809@gentoo.org
In Reply to: Re: [gentoo-alt] AIX linking adventure by Perry Smith
1 On 02/13/2011 04:07 PM, Perry Smith wrote:
2 >
3 > On Feb 10, 2011, at 11:26 AM, Michael Haubenwallner wrote:
4 >
5 >>>>>> Although runpath search is affected by LIBPATH, I'm just fine with that.
6 >>>>>> This is the outcome of using "-L" and "-l" linker flags together.
7 >>>>> I thought this was one of your objectives based on the fact that java sets LIBPATH
8 >>>>> to something weird and it breaks everything.
9 >>>> Nope. The problem with LIBPATH set by java was that there is nothing
10 >>>> like "soname". Iff my binary had searched for the /file/ "libiconv.so.2"
11 >>>> (either archive or not) instead of "libiconv.a(libiconv.so.2)", even with
12 >>>> LIBPATH set to "/usr/lib" it would not have found "/usr/lib/libiconv.a"
13 >>>> (without "libiconv.so.2" member), but continued along LIBPATH + runpath
14 >>>> until it found the "libiconv.so.2" file in its usual place.
15 >>> Hmmm... ok. I had forgotten that detail.
16 >>
17 >> Yes, a detail - but a really important one for package managers.
18 >
19 > It occurred to me that this was true in your particular situation but
20 > if Java (or a user) removes key paths from LIBPATH, the runtime
21 > search will fail. Having 100% hardcoded paths solves that issue.
22 >
23 > So, the system you have developed solves the particular issue
24 > with Java but not the bigger issue of setting LIBPATH to some
25 > whacko thing.
26
27 Well, having LIBPATH _set_ at all is calling for troubles anyway,
28 and is highly discouraged - not only within Gentoo Prefix.
29
30 But as Java is an IBM binary package I can't patch, and they add
31 /usr/lib:/lib only, this is no longer a problem for me now.
32
33 OTOH, when "libNAME.so.1" would be found somewhere else due to
34 LIBPATH being set, one should assume that this should be sufficient
35 too. This also allows for developers to try out a fix for libNAME.so.1
36 before needing to replace it at the final location.
37
38 But still, LIBPATH (as LD_LIBRARY_PATH in ELF) is for exceptional
39 circumstances only.
40
41 /haubi/
42 --
43 Michael Haubenwallner
44 Gentoo on a different level