Gentoo Archives: gentoo-alt

From: Perry Smith <pedzsan@×××××.com>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] Adventures with Prefix on AIX 5.3
Date: Tue, 14 Dec 2010 20:34:35
Message-Id: 52EFBE0B-285C-4D59-BE2E-55CEB8948ED8@gmail.com
In Reply to: Re: [gentoo-alt] Adventures with Prefix on AIX 5.3 by Michael Haubenwallner
1 On Dec 14, 2010, at 2:22 AM, Michael Haubenwallner wrote:
2
3 > (now with CC-ing list)
4 >
5 > On 12/14/10 01:08, Perry Smith wrote:
6 >>> A Library called 'libmpfr.a' without any version number in plain filename
7 >>> is calling for troubles[1].
8 >>>
9 >>> [1] http://bugs.gentoo.org/show_bug.cgi?id=213277#c11
10 >>
11 >> I can recreate this doing:
12 >>
13 >> LIBPATH=/lib gcc -o x x.c && ./x
14 >> exec(): 0509-036 Cannot load program gcc because of the following errors:
15 >> 0509-022 Cannot load module /gsa/ausgsa/projects/r/ruby/lib/libintl.a(libintl.so.8).
16 >> 0509-150 Dependent module /lib/libiconv.a(libiconv.so.2) could not be loaded.
17 >> 0509-152 Member libiconv.so.2 is not found in archive
18 >
19 >> I went back and rebuilt my libintl.a using absolute paths so the header looks like:
20 >
21 >> 3 /gsa/ausgsa/projects/r/ruby/lib libiconv.a libiconv.so.2
22 >>
23 >> and it still fails.
24 >
25 > This is interesting - I've not recognized that LIBPATH overrides absolute path too.
26
27 I asked "the higher ups" about this and they asked "do you have another library that referenced libiconv that did not have an absolute path?" So, I made a simpler test and sure enough, it does work. So, I have "x" which looks like:
28
29 > ***Import File Strings***
30 > INDEX PATH BASE MEMBER
31 > 0 /gsa/ausgsa-p9/06/ruby/bin/../lib/gcc/powerpc-ibm-aix5.3.0.0/4.5.0:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc/powerpc-ibm-aix5.3.0.0/4.5.0/../../..:/usr/lib:/lib
32 > 1 libc.a shr.o
33 > 2 /gsa/ausgsa/projects/r/ruby/lib libintl.a libintl.so.8
34
35
36 and libintl.so.8 that looks like:
37
38 > ***Import File Strings***
39 > INDEX PATH BASE MEMBER
40 > 0 /gsa/ausgsa/projects/r/ruby/lib:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc/powerpc-ibm-aix5.3.0.0/4.5.0:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc/powerpc-ibm-aix5.3.0.0/4.5.0/../../..:/usr/lib:/lib
41 > 1 libpthread.a shr_xpg5.o
42 > 2 libc.a shr.o
43 > 3 /gsa/ausgsa/projects/r/ruby/lib libiconv.a libiconv.so.2
44
45
46 and now I can do:
47
48 > LIBPATH=/lib ./x
49 > hi 4609
50
51
52 x.c is:
53
54 > #include <stdio.h>
55 > #include <libintl.h>
56 >
57 > int main(int argc, char *argv[])
58 > {
59 > printf("hi %d\n", libintl_version);
60 > }
61
62
63 I'm going to continue to explore and see if I can find all the libraries that reference libiconv, fix them, and then see if I can get gcc to work with LIBPATH set to /lib.
64
65 On the other topic of using import files, I've had some thoughts that I have not explored yet. First, I didn't think until today but one import file can reference multiple shared objects. The reason this is important to me is I believe that being able to do 32 and 64 bit applications is going to be very important to AIX users. I'm not asking Portage to support it out of the box but I'm also hoping that Portage does not make it next to impossible to implement.
66
67 I need to play with this more but my current train of thought is to have one import file. It could be like:
68
69 #! libfoo.X.a(libfoo_32.X.Y.so)
70 # 32
71 sym1
72 sym2
73 sym3
74
75 #! libfoo.X.a(libfoo_64.X.Y.so)
76 # 64
77 sym1
78 sym2
79 sym3
80
81 I have not experimented with any of that yet. But if that works, then the B, B1, B2, and C options become plausible to me. Likewise, if my experiments with absolute paths in the library files works, then it seems option A becomes plausible too.