1 |
Ok, I think I finally got awake/enough coffee. |
2 |
|
3 |
|
4 |
Index: bin/misc-functions.sh |
5 |
=================================================================== |
6 |
--- bin/misc-functions.sh (revision 6598) |
7 |
+++ bin/misc-functions.sh (working copy) |
8 |
@@ -294,8 +294,14 @@ |
9 |
# http://bugs.gentoo.org/4411 |
10 |
abort="no" |
11 |
for a in "${ED}"usr/lib*/*.a ; do |
12 |
- s=${a%.a}.so |
13 |
- if [[ ! -e ${s} ]] ; then |
14 |
+ [[ ${CHOST} == *-darwin* ]] \ |
15 |
+ && s=${a%.a}.dylib \ |
16 |
+ || s=${a%.a}.so |
17 |
+ # On platforms which have no (GNU) linker scripts (like Darwin, |
18 |
+ # AIX and IRIX) we use symlinks. Since they are still in the |
19 |
+ # install image they point to non-existing libs, which make |
20 |
+ # existence tests fail. Just check for a link for this reason. |
21 |
+ if [[ ! -e ${s} ]] && [[ ! -L ${s} ]] ; then |
22 |
s=${s%usr/*}${s##*/usr/} |
23 |
if [[ -e ${s} ]] ; then |
24 |
vecho -ne '\a\n' |
25 |
|
26 |
|
27 |
This is applied against the current portage source. I greatly |
28 |
simplified the check, since the original check isn't so exhaustive |
29 |
either. All in all, we don't check if a symlink points to something |
30 |
valid (neither do we check the gnu-ld script to do so), but we just |
31 |
check there is no file or link in usr/lib and then check if something is |
32 |
in lib. |
33 |
|
34 |
Two problems here: |
35 |
|
36 |
1. the check above this check looks for absolute symlinks in libs, and |
37 |
warns if a lib is symlinked that crosses the /usr boundary. |
38 |
2. the -e ${s} in the lib dir will fail if the symlink is dead, however, |
39 |
since it should be a relative symlink, it should work. |
40 |
|
41 |
So, I think gen_usr_ldscript should generate a relative symlink instead |
42 |
of an absolute symlink, right? |
43 |
I never noticed it, because these checks were never run on Darwin, but |
44 |
they soon will after this is solved. |
45 |
|
46 |
If we change gen_usr_ldscript, the symlink will become relative, and the |
47 |
whole patch above will become unnecessary. |
48 |
|
49 |
|
50 |
|
51 |
On 24-05-2007 09:45:02 +0200, Fabian Groffen wrote: |
52 |
> On 23-05-2007 23:58:48 +0200, Michael Haubenwallner wrote: |
53 |
> > > > + s=${a%.a}.so |
54 |
> > > s = lib/libfoo.so.1.so |
55 |
> > > or |
56 |
> > > s = usr/lib/libfoo.so.so |
57 |
> > > I think this is wrong. Is the replacement really necessary? I think .a |
58 |
> > > has always been replaced in this case. |
59 |
> > |
60 |
> > err, s is recreated from (still initial) $a, not (current) $s: |
61 |
> |
62 |
> My bad. |
63 |
> |
64 |
> > s = /D/prefix/usr/lib/libfoo.so |
65 |
> > |
66 |
> > > > s=${s%usr/*}${s##*/usr/} |
67 |
> > > s = lib/libfoo.so(.so) |
68 |
> > |
69 |
> > s = /D/prefix/lib/libfoo.so |
70 |
> > |
71 |
> > > > + if [[ -L ${s} ]] && rs=$(readlink "${s}"); then |
72 |
> > |
73 |
> > lib/libfoo.so could be a symlink '-> libfoo.so.1'. |
74 |
> > |
75 |
> > rs = libfoo.so.1 |
76 |
> > |
77 |
> > Hmm, could this also be a symlink to somewhere outside lib/ ? |
78 |
> > Or even '-> /prefix/lib/libfoo.so.1' ? |
79 |
> > If not, we might not need to resolve symlinks (to $D) again here at all, |
80 |
> > as [[ -e ]] succeeds if symlink is resolveable. |
81 |
> |
82 |
> I think it should exist. Nothing more. So -e should suffice. |
83 |
> |
84 |
> > > > + [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}usr/lib/${rs}" |
85 |
> > > Hmmm... if s is a link, and it is relative, should it start from |
86 |
> > > ${ED}lib in that case? |
87 |
> > |
88 |
> > oops, you're right, should read: |
89 |
> > + [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}lib/${rs}" |
90 |
> |
91 |
> Let's commit it like this then... |
92 |
> |
93 |
> -- |
94 |
> Fabian Groffen |
95 |
> Gentoo on a different level |
96 |
> |
97 |
> -- |
98 |
> gentoo-alt@g.o mailing list |
99 |
> |
100 |
|
101 |
-- |
102 |
Fabian Groffen |
103 |
Gentoo on a different level |
104 |
|
105 |
-- |
106 |
gentoo-alt@g.o mailing list |