1 |
Author: haubi |
2 |
Date: 2008-05-09 09:17:44 +0000 (Fri, 09 May 2008) |
3 |
New Revision: 1631 |
4 |
|
5 |
Modified: |
6 |
trunk/toolchain-prefix-wrapper/ld/hpuxplugin.c |
7 |
Log: |
8 |
no need to parse -L args in plugin any more. |
9 |
don't forget to add '+s' on proper place if initially given. |
10 |
|
11 |
Modified: trunk/toolchain-prefix-wrapper/ld/hpuxplugin.c |
12 |
=================================================================== |
13 |
--- trunk/toolchain-prefix-wrapper/ld/hpuxplugin.c 2008-05-09 06:25:24 UTC (rev 1630) |
14 |
+++ trunk/toolchain-prefix-wrapper/ld/hpuxplugin.c 2008-05-09 09:17:44 UTC (rev 1631) |
15 |
@@ -33,7 +33,6 @@ |
16 |
|
17 |
StringList *tmpArgList = NULL; |
18 |
StringList *runpathList = NULL; |
19 |
- StringList *libpathList = NULL; |
20 |
StringList *defaultRunpathList = NULL; |
21 |
String *newString = NULL; |
22 |
String const *argString; |
23 |
@@ -51,10 +50,6 @@ |
24 |
if (runpathList == NULL) |
25 |
break; |
26 |
|
27 |
- libpathList = StringListCreate(NULL, 0, 0); |
28 |
- if (libpathList == NULL) |
29 |
- break; |
30 |
- |
31 |
defaultRunpathList = StringListCreate(NULL, 0, 0); |
32 |
if (defaultRunpathList == NULL) |
33 |
break; |
34 |
@@ -122,23 +117,10 @@ |
35 |
continue; |
36 |
} else |
37 |
if (strncmp(argBuffer, "-L", 2) == 0) { |
38 |
- /* collect libpath from "-L libpath" */ |
39 |
- |
40 |
- argBuffer += 2; |
41 |
- argBufferLength -= 2; |
42 |
- |
43 |
- if (*argBuffer == 0 && argc < StringListGetSize(data->in->argList)) { |
44 |
- argc++; |
45 |
- argString = StringListGetString(data->in->argList, argc); |
46 |
- argBuffer = StringGetBuffer(argString); |
47 |
- argBufferLength = StringGetLength(argString); |
48 |
- } |
49 |
- if (StringListContains(data->in->sysLibpath, argBuffer, argBufferLength)) |
50 |
- continue; |
51 |
- |
52 |
- if (StringListAppendConcat(libpathList, argBuffer, argBufferLength, NULL) < 0) |
53 |
- break; |
54 |
- |
55 |
+ /* drop -L arguments from commandline, |
56 |
+ * we need to pass them before any libs. |
57 |
+ * The path list already is collected in userLibpath. |
58 |
+ */ |
59 |
continue; |
60 |
} else |
61 |
if (strncmp(argBuffer, "-R", 2) == 0) { |
62 |
@@ -173,32 +155,37 @@ |
63 |
break; |
64 |
} |
65 |
|
66 |
- /* if there is no runpath (+b), use libpath as runpath |
67 |
- * if not disabled with "+nodefaultrpath" |
68 |
- */ |
69 |
- if (StringListGetSize(runpathList) == 0 |
70 |
- && withDefaultRunpath == true |
71 |
- && StringListAppendList(runpathList, libpathList, 0, -1) < 0 |
72 |
- ) break; |
73 |
- |
74 |
/* |
75 |
* first, put libpath list (-L) on the commandline |
76 |
*/ |
77 |
- if (StringListAppendListModify(data->out->argList, libpathList, 0, -1, "-L", 2, NULL, 0) < 0) |
78 |
+ if (StringListAppendListModify(data->out->argList, data->in->userLibpath, 0, -1, "-L", 2, NULL, 0) < 0) |
79 |
break; |
80 |
|
81 |
/* also put sys libpath list as libpath (-L) on commandline */ |
82 |
if (StringListAppendListModify(data->out->argList, data->in->sysLibpath, 0, -1, "-L", 2, NULL, 0) < 0) |
83 |
break; |
84 |
|
85 |
+ /* do we need to use env-runpath first? */ |
86 |
+ if (withEnvRunpath == envrunpath_first |
87 |
+ && StringListAppendConcat(data->out->argList, "+s", 2, NULL) < 0 |
88 |
+ ) break; |
89 |
+ |
90 |
/* |
91 |
- * second, put runpath list (-R, +b) on the commandline |
92 |
+ * now put runpath list (from -R, +b) on the commandline |
93 |
*/ |
94 |
|
95 |
/* append "+b" to commandline */ |
96 |
if (StringListAppendConcat(data->out->argList, "+b", 2, NULL) < 0) |
97 |
break; |
98 |
|
99 |
+ /* if there is no runpath (+b), use libpath as runpath |
100 |
+ * if not disabled with "+nodefaultrpath" |
101 |
+ */ |
102 |
+ if (StringListGetSize(runpathList) == 0 |
103 |
+ && withDefaultRunpath == true |
104 |
+ && StringListAppendList(runpathList, data->in->userLibpath, 0, -1) < 0 |
105 |
+ ) break; |
106 |
+ |
107 |
/* append default runpath list (-R) to runpath list */ |
108 |
if (StringListAppendList(runpathList, defaultRunpathList, 0, -1) < 0) |
109 |
break; |
110 |
@@ -216,6 +203,11 @@ |
111 |
if (StringListAppendString(data->out->argList, newString) < 0) |
112 |
break; |
113 |
|
114 |
+ /* do we need to use env-runpath second? */ |
115 |
+ if (withEnvRunpath == envrunpath_second |
116 |
+ && StringListAppendConcat(data->out->argList, "+s", 2, NULL) < 0 |
117 |
+ ) break; |
118 |
+ |
119 |
/* |
120 |
* third, put other arguments on commandline |
121 |
*/ |
122 |
@@ -227,7 +219,6 @@ |
123 |
|
124 |
newString = StringDestroy(newString); |
125 |
defaultRunpathList = StringListDestroy(defaultRunpathList); |
126 |
- libpathList = StringListDestroy(libpathList); |
127 |
runpathList = StringListDestroy(runpathList); |
128 |
tmpArgList = StringListDestroy(tmpArgList); |
129 |
|
130 |
|
131 |
-- |
132 |
gentoo-commits@l.g.o mailing list |