Gentoo Archives: gentoo-alt

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] Breaking news: Need to start over on AIX
Date: Mon, 21 Feb 2011 16:29:23
Message-Id: 4D6292CF.5070501@gentoo.org
In Reply to: Re: [gentoo-alt] Breaking news: Need to start over on AIX by Perry Smith
1 On 02/13/2011 04:04 PM, Perry Smith wrote:
2 > On Feb 11, 2011, at 3:23 AM, Michael Haubenwallner wrote:
3 >>
4 >> How I prefer doing "shared libraries" with "soname" on AIX now is:
5 >>
6 >> *) Create the shared object "shr.o" (using '-G' linker flag).
7 >> *) Set the LOADONLY flag for "shr.o" (using 'strip -e').
8 >> *) Create the Import File "shr.imp", containing
9 >> - this header line, being the "soname" emulation:
10 >> #! libNAME.so.1(shr.o)
11 >> - another header line telling the bits used:
12 >> # 32
13 >> or
14 >> # 64
15 >> - the list of symbols exported.
16 >> *) Create the archive library "libNAME.so.1.2.3" from both
17 >> "shr.imp" and "shr.o".
18 >> *) Create the symlinks as usual:
19 >> libNAME.so.1 -> libNAME.so.1.2.3
20 >> libNAME.so -> libNAME.so.1.2.3
21 >> *) Create the static library archive "libNAME.a" from static objects.
22 >
23 > Do you recall the advantage of having a import file plus the shared
24 > object in the archive? What problem does that solve that having
25 > just the shared object creates?
26
27 Actually I've used to do standalone both Import File libNAME.so and
28 shared object libNAME.so.1 - which indeed did work for Prefix so far.
29 However, to get a better chance for upstream integration - especially
30 into libtool, I've had to look at the Big Picture:
31
32 *) Multilib:
33 Using an archive, it is possible to provide both 32/64 bit shared
34 objects within one single file - much like AIX libc.a and others do.
35
36 We don't do multilib in Prefix.
37
38 *) Dynamically load both with and without version number:
39 dlopen("libNAME.so(shr.o)", RTLD_MEMBER), besides the preferred
40 dlopen("libNAME.so.1(shr.o)", RTLD_MEMBER), and even
41 dlopen("libNAME.so.1.2.3(shr.o)", RTLD_MEMBER) does work.
42
43 Must admit that I've not seen a package I've built on AIX so far
44 where this actually is necessary.
45
46 *) All-in-one file to call "shared library (with soname)":
47 This is necessary to allow wrapping the linker to support the '-soname' linker
48 flag, so existing packages without explicit AIX build support can work right
49 out of the box. This even includes those symlinks known from ELF-world.
50
51 For Prefix this does help a lot as sys-devel/native-cctools provides this
52 ld-wrapper now: I've been able to drop *all* AIX-specific patches and
53 handling from within app-arch/bzip2-1.0.6-r1 now.
54
55 These (and more) reasons are also listed in libtool-list archives:
56 http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html
57 http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html
58
59 /haubi/
60 --
61 Michael Haubenwallner
62 Gentoo on a different level