1 |
(now with CC-ing list) |
2 |
|
3 |
On 12/14/10 01:08, Perry Smith wrote: |
4 |
>> A Library called 'libmpfr.a' without any version number in plain filename |
5 |
>> is calling for troubles[1]. |
6 |
>> |
7 |
>> [1] http://bugs.gentoo.org/show_bug.cgi?id=213277#c11 |
8 |
> |
9 |
> I can recreate this doing: |
10 |
> |
11 |
> LIBPATH=/lib gcc -o x x.c && ./x |
12 |
> exec(): 0509-036 Cannot load program gcc because of the following errors: |
13 |
> 0509-022 Cannot load module /gsa/ausgsa/projects/r/ruby/lib/libintl.a(libintl.so.8). |
14 |
> 0509-150 Dependent module /lib/libiconv.a(libiconv.so.2) could not be loaded. |
15 |
> 0509-152 Member libiconv.so.2 is not found in archive |
16 |
|
17 |
> I went back and rebuilt my libintl.a using absolute paths so the header looks like: |
18 |
|
19 |
> 3 /gsa/ausgsa/projects/r/ruby/lib libiconv.a libiconv.so.2 |
20 |
> |
21 |
> and it still fails. |
22 |
|
23 |
This is interesting - I've not recognized that LIBPATH overrides absolute path too. |
24 |
|
25 |
> Are you sure if you build with import files it is going to solve the problem? |
26 |
> Seems like it would not but I'm curious what you have in mind. |
27 |
|
28 |
What I'm doing with import files is to rename the /filename/ 'libiconv.a' |
29 |
to something that contains the version number, so the filename-search doesn't |
30 |
go for 'libiconv.a' but something like 'libiconv.so.2'. It is irrelevant if |
31 |
this is an archive with an irrelevant member name or not - the /filename/ is |
32 |
important to contain the version number when searched at runtime, while linking |
33 |
has to be done without the version number. |
34 |
|
35 |
> Note that this is only going to be an issue for libraries that collide with the same base name in /lib. |
36 |
> If I move /lib/libiconv.a out of the way, then the loader finds the correct libiconv.a. |
37 |
|
38 |
This is most often true, but it is a problem when LIBPATH is pointing to some |
39 |
directory containing a same unversioned filename (maybe another Prefix) from a |
40 |
different version. However, using LIBPATH is discuraged in general, and I have |
41 |
to prevent from breaking with LIBPATH=/lib only. |
42 |
|
43 |
> The other question I have is if this is a show stopper for you? |
44 |
|
45 |
Yes, we do have the use-case shown in the bug. |
46 |
|
47 |
> I would argue that what Java is doing is impolite (at least). |
48 |
|
49 |
Looks like, but maybe they have some reason to do so. |
50 |
|
51 |
/haubi/ |
52 |
-- |
53 |
Michael Haubenwallner |
54 |
Gentoo on a different level |