1 |
Author: haubi |
2 |
Date: 2008-05-09 06:25:24 +0000 (Fri, 09 May 2008) |
3 |
New Revision: 1630 |
4 |
|
5 |
Modified: |
6 |
trunk/toolchain-prefix-wrapper/ld/aixplugin.c |
7 |
Log: |
8 |
keep putting library path into runpath if no runpath specified on aix |
9 |
|
10 |
Modified: trunk/toolchain-prefix-wrapper/ld/aixplugin.c |
11 |
=================================================================== |
12 |
--- trunk/toolchain-prefix-wrapper/ld/aixplugin.c 2008-05-06 17:07:58 UTC (rev 1629) |
13 |
+++ trunk/toolchain-prefix-wrapper/ld/aixplugin.c 2008-05-09 06:25:24 UTC (rev 1630) |
14 |
@@ -15,9 +15,12 @@ |
15 |
extern "C" { |
16 |
#endif |
17 |
|
18 |
-/* HPUX-ld: |
19 |
- * When there is no explicit runpath on the linker commandline (+b runpath), |
20 |
- * then all library paths (-L) are recorded as runpath |
21 |
+/* AIX-ld: |
22 |
+ * When there is no explicit runpath on the linker commandline (-blibpath:runpath), |
23 |
+ * then all library paths (-L) are recorded as runpath if not in svr4 mode. |
24 |
+ * |
25 |
+ * Extension to default-mode (non-svr4): |
26 |
+ * Accept additional runpaths specified with -R |
27 |
*/ |
28 |
int aixplugin(LdPluginData* data) |
29 |
{ |
30 |
@@ -63,6 +66,7 @@ |
31 |
argBuffer = StringGetBuffer(argString); |
32 |
if (strcmp(argBuffer, "-bsvr4") == 0) { |
33 |
svr4mode = 1; |
34 |
+ libpath2runpath = 0; |
35 |
} |
36 |
} |
37 |
|
38 |
@@ -72,16 +76,13 @@ |
39 |
argBufferLength = StringGetLength(argString); |
40 |
|
41 |
if (strcmp(argBuffer, "-bnolibpath") == 0) { |
42 |
- /* explicitly specified: |
43 |
- * do not record -L path as runpath, specified explicitly. |
44 |
- */ |
45 |
+ /* explicitly specified: do not record -L args as runpath. */ |
46 |
libpath2runpath = 0; |
47 |
/* This also removes each runpath specified before. */ |
48 |
StringListClear(runpathList); |
49 |
if (svr4mode) { |
50 |
- /* if not in svr4-mode, we accept -R as extension */ |
51 |
StringListClear(defaultRunpathList); |
52 |
- } |
53 |
+ } /* else we accept -R as extension */ |
54 |
continue; |
55 |
} else |
56 |
if (strncmp(argBuffer, "-blibpath:", strlen("-blibpath:")) == 0) { |
57 |
@@ -89,7 +90,7 @@ |
58 |
|
59 |
argBuffer += strlen("-blibpath:"); |
60 |
|
61 |
- /* do not record -L path as runpath, we have explicit -blibpath: */ |
62 |
+ /* do not record -L args as runpath, we have explicit -blibpath: */ |
63 |
libpath2runpath = 0; |
64 |
|
65 |
/* '-blibpath:' kills previous '-blibpath:' */ |
66 |
@@ -98,7 +99,7 @@ |
67 |
if (svr4mode) { |
68 |
/* it also kills previous '-Rrunpathlist' in svr4mode */ |
69 |
StringListClear(defaultRunpathList); |
70 |
- } |
71 |
+ } /* else we accept -R as extension */ |
72 |
|
73 |
for(curr = next = argBuffer; *next != '\0'; curr = next+1) { |
74 |
for(next = curr; *next != '\0' && *next != ':'; next++); |
75 |
@@ -124,13 +125,9 @@ |
76 |
continue; |
77 |
} else |
78 |
if (strncmp(argBuffer, "-R", strlen("-R")) == 0) { |
79 |
- /* extension: |
80 |
- * collect additional default runpath from "-R runpath" |
81 |
- */ |
82 |
- |
83 |
if (svr4mode) { |
84 |
/* in svr4 mode, '-R' kills previous '-blibpath:' arguments. |
85 |
- * in normal mode, we implement -R as an extension. |
86 |
+ * in normal mode, we implement '-R runpath' as an extension. |
87 |
*/ |
88 |
StringListClear(runpathList); |
89 |
} |
90 |
@@ -163,6 +160,10 @@ |
91 |
break; |
92 |
} |
93 |
|
94 |
+ if (libpath2runpath /* need to record '-L' args as runpath too */ |
95 |
+ && StringListAppendList(runpathList, data->in->userLibpath, 0, -1) < 0 |
96 |
+ ) break; |
97 |
+ |
98 |
/* always have default runpath list in runpath */ |
99 |
if (StringListAppendList(runpathList, defaultRunpathList, 0, -1) < 0) |
100 |
break; |
101 |
@@ -171,9 +172,9 @@ |
102 |
if (StringListAppendList(runpathList, data->in->sysRunpath, 0, -1) < 0) |
103 |
break; |
104 |
|
105 |
- /* need to add /usr/lib:/lib myself */ |
106 |
- if (StringListAppendList(runpathList, aixRunpathList, 0, -1) < 0) |
107 |
- break; |
108 |
+ /* need to add /usr/lib:/lib myself even in svr4 mode, as we drop -R args */ |
109 |
+ if (StringListAppendList(runpathList, aixRunpathList, 0, -1) < 0 |
110 |
+ ) break; |
111 |
|
112 |
/* create runpath string: "-blibpath:libpath1:libpathN" */ |
113 |
newString = StringListJoin(runpathList |
114 |
|
115 |
-- |
116 |
gentoo-commits@l.g.o mailing list |