Gentoo Archives: gentoo-alt

From: Perry Smith <pedzsan@×××××.com>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] AIX linking adventure
Date: Thu, 10 Feb 2011 00:58:00
Message-Id: 34D0C165-C369-4E40-8D6D-F63D99488695@gmail.com
In Reply to: Re: [gentoo-alt] AIX linking adventure by Michael Haubenwallner
1 On Feb 9, 2011, at 4:33 PM, Michael Haubenwallner wrote:
2
3 > Hi Perry,
4 >
5 > On 02/09/11 17:47, Perry Smith wrote:
6 >> Lets start over. I don't think I'm making any progress but I'll give it one last go.
7 >>
8 >> Here is the output of dump -H of my installed ruby:
9 >>
10 >> /usr/local/rvm/rubies/ruby-1.9.1-p378/bin/ruby:
11 >> ***Import File Strings***
12 >> INDEX PATH BASE MEMBER
13 >> 0 /usr/local/rvm/rubies/ruby-1.9.1-p378/lib:/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.3.1:/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.3.1/../../..:/usr/lib:/lib
14 >> 1 librtl.a shr.o
15 >> 2 /usr/lib libc.a shr.o
16 >> 3 /usr/lib libpthread.a shr_comm.o
17 >> 4 /usr/lib libpthread.a shr_xpg5.o
18 >> 5 /usr/local/rvm/rubies/ruby-1.9.1-p378/lib libruby.so
19 >
20 > Is this with our without your intervention in ruby's build process and/or toolchain setup?
21
22 This is after my toolchain changes.
23
24 >
25 >> Except for librtl.a, there are no relative paths anywhere. That is one of my objectives (and your's I believe).
26 >
27 > There is no "relative" path by the usual means of "relative" /anywhere/ here,
28 > there are only "absolute" paths here - a "relative" path does not start with "/".
29 > However, librtl.a is subject to "runpath search", while the others are not
30 > due to "hardcoded" (unsure about this term) paths - but still "absolute"
31 > paths everywhere.
32 >
33 > Anyway - taking "relative" as "with runpath search", and "absolute" as
34 > "without runpath search" or even "hardcoded" here now.
35
36 Yea. I need to use better terms. but I think you are following me. I'm
37 using the same term to mean two different things.
38
39 In the 0'th entry above, there are no entries like "." (so in that case, that term "relative path"
40 or "absolute path" is correct.)
41
42 The 1st entry is what I was calling "relative" but as you point out, that isn't the right term.
43 "affected by run path search" is too long for me. :-)
44
45 The 2nd through 5th items are those I was calling "absolute" but really they should be
46 called "not affected by run path search". Perhaps "fixed" in this case would work?
47 non-LIBPATH-able?
48
49 >
50 >> It is using /usr/local/rvm/rubies/ruby-1.9.1-p378/lib/libruby.so .
51 >> If I move that to somewhere else, like
52 >> /usr/local/rvm/rubies/ruby-1.9.1-p378/lib/other/libruby.so
53 >> ruby does not work and setting LIBPATH does not fix the problem.
54 >
55 > Of course, due to the hardcoded paths no runpath search is performed.
56 >
57 >> Thus, for an object (I'll use the word "object" to mean shared object or an executable)
58 >
59 > Usually, "binary" is the term to be used here, but ok...
60 >
61 >> that is linked without only absolute paths, it will not work in the directory that it is built in.
62 >
63 > Let me grasp that: "without only absolute" paths "it will not work" where built.
64 > Isn't this a typo and should read "*with* only absolute" ?
65
66 Yes. typo. sorry. I really do go back and proof read my emails.
67
68 >
69 >> In the case of ruby, it builds the library and executable in the same pass.
70 >> I think this is typical.
71 >
72 > Yep.
73 >
74 >> If you plan to run "make test" or "make check" (different packages call it different things)
75 >> before the install, you have a problem.
76 >
77 > Only if the paths are hardcoded - but this is unusual.
78 >
79 >> The way I solved that problem is to allow the object to have relative paths (or no path)
80 >> before it is installed, do the "make check",
81 >
82 > How exactly did you touch either the build process or the toolchain setup to "allow" that?
83
84 I put my ld in /usr/local/aixbin/ld and I put /usr/local/aixbin as the first element of PATH.
85 So my ld gets called instead of the real ld. My ld monkeys with things.
86
87 After everything is installed, I go back through with "rl". I did this by hand at the present time.
88 In the limited case that I'm experimenting with, everything is installed off in a directory that
89 is just the new ruby install. I can do a find for the binary files and then call rl on them and it
90 will make the changes.
91
92 >
93 >> then either fix the object just before install or fix it just after the install.
94 >> I choose to fix it just after the install with "rl".
95 >
96 > Same here: How to touch the build process or the toolchain setup to get "rl" used?
97
98 See above.
99
100 >
101 >> I don't see how you can have an object that has only absolute paths after it is installed
102 >> *and* is able to be used before the install so that "make check" or "make test" can be run
103 >> (except by some weird chroot tricks but no one wants to go down that path).
104 >
105 > Yep, that doesn't work.
106 >
107 >> Lets pause here and see if we can come to an agreement on these two items.
108 >> 1) objets have only absolute paths after they are installed
109 >
110 > Still not clear to me:
111 > Do you actually /prefer/ hardcoded paths (without runpath search)? Why?
112 >
113 > Although runpath search is affected by LIBPATH, I'm just fine with that.
114 > This is the outcome of using "-L" and "-l" linker flags together.
115
116 I thought this was one of your objectives based on the fact that java sets LIBPATH
117 to something weird and it breaks everything.
118
119 >
120 > It is unusual to use hardcoded path (without runpath search), which is the
121 > result of using /absolute/path/to/the/library.so instead of "-L" and "-l".
122 >
123 > So when ruby's build system uses /absolute/path/to/the/library.so, you should
124 > try to fix that to use "-L" and "-l", as well as "-blibpath" eventually instead.
125 >
126 >> 2) The "make check" must work before package is installed.
127 >
128 > Yep, agreed on this one.
129 >
130 > Seems we have to agree on some terms to be used first.
131
132 Yes.
133
134 I like "fixed" for entries not affected by runtime search.
135
136 The other tact would be to note that PATH is either empty or not.
137
138 "A path dependency with no path" or "a dependency with a path" ?
139
140 "binary" instead of "object" sounds better to me.
141
142 >
143 > What else to say:
144 > When libtool knows for a platform that linking libraries results in hardcoded
145 > paths, or there is no such thing like LIBPATH environment variable to temporarily
146 > override the runpath, it actually /does/ "relink" the binaries during installation.
147
148 I understood that part -- but
149
150 > OTOH, when the /absolute/path/to/the/library.so found at linktime is hardcoded into
151 > the resulting binary, installing into DESTDIR is broken - which is a prerequisite
152 > for package managers like portage to work properly.
153
154 Didn't understand this part. In particular, from the comma to the end ", installing ..."
155
156 >
157 > /haubi/
158 > --
159 > Michael Haubenwallner
160 > Gentoo on a different level
161 >

Replies

Subject Author
Re: [gentoo-alt] AIX linking adventure Michael Haubenwallner <haubi@g.o>