/[gentoo-alt]/trunk/toolchain-prefix-wrapper/ld/hpuxplugin.c
Gentoo

Diff of /trunk/toolchain-prefix-wrapper/ld/hpuxplugin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1654 Revision 1655
36 bool isIA64; 36 bool isIA64;
37 bool is64bit; 37 bool is64bit;
38 38
39 /* ELF settings */ 39 /* ELF settings */
40 bool needLibpathAsRunpath = true; 40 bool needLibpathAsRunpath = true;
41 bool needAutoRunpath = false;
41 UseRpathFlag useRpathFlag = UseRpath_Last; 42 UseRpathFlag useRpathFlag = UseRpath_Last;
42 bool needCDPflag = false; /* need +cdp linker flag to drop DESTDIR */ 43 bool needCDPflag = false; /* need +cdp linker flag to drop DESTDIR */
43 44
44 EnvRpathFlag envRpathFlag = EnvRpath_No; /* +s */ 45 EnvRpathFlag envRpathFlag = EnvRpath_No; /* +s */
45 StringList *tmpArgList = NULL; 46 StringList *tmpArgList = NULL;
80 81
81 autoRunpathList = StringListCreate(NULL, 0, 0); 82 autoRunpathList = StringListCreate(NULL, 0, 0);
82 if (autoRunpathList == NULL) 83 if (autoRunpathList == NULL)
83 break; 84 break;
84 85
86#define STRnLEN(x) (x), strlen((x))
87 argBuffer = StringGetBuffer(data->in->host.triplet);
85 if (strncmp(StringGetBuffer(data->in->host.triplet), "ia64", strlen("ia64")) == 0) { 88 if (strncmp(argBuffer, "ia64", strlen("ia64")) == 0) {
86 isIA64 = true; 89 isIA64 = true;
87 is64bit = false; 90 if (argBuffer[strlen("ia64")] == 'w') {
88 if (StringGetBuffer(data->in->host.triplet)[strlen("ia64")] == 'w') {
89 /* ia64w: ELF, 64bit */ 91 /* ia64w: ELF, 64bit */
90 is64bit = true; 92 is64bit = true;
93 if (0
94 /* added by gcc always */
95 || StringListAppendConcat(sysRunpathList, STRnLEN("/usr/ccs/lib/hpux64"), NULL) < 0
96 || StringListAppendConcat(sysRunpathList, STRnLEN("/lib/hpux64" ), NULL) < 0
97 || StringListAppendConcat(sysRunpathList, STRnLEN("/usr/lib/hpux64" ), NULL) < 0
98 || StringListAppendConcat(sysRunpathList, STRnLEN("/usr/ccs/lib" ), NULL) < 0
99 /* added by ld upon "+b :" */
100 || StringListAppendConcat(autoRunpathList, STRnLEN("/usr/lib/hpux64" ), NULL) < 0
101 )
102 break;
103 } else {
104 is64bit = false;
105 if (0
106 /* added by gcc always */
107 || StringListAppendConcat(sysRunpathList, STRnLEN("/usr/ccs/lib" ), NULL) < 0
108 /* added by ld upon "+b :" */
109 || StringListAppendConcat(autoRunpathList, STRnLEN("/usr/lib/hpux32"), NULL) < 0
110 )
111 break;
91 } 112 }
92 } else 113 } else
93 if (strncmp(StringGetBuffer(data->in->host.triplet), "hppa64", strlen("hppa64")) == 0) { 114 if (strncmp(argBuffer, "hppa64", strlen("hppa64")) == 0) {
94 /* hppa64: ELF, 64bit */ 115 /* hppa64: ELF, 64bit */
95 isIA64 = false; 116 isIA64 = false;
96 is64bit = true; 117 is64bit = true;
118 if (0
119 /* added by gcc always */
120 || StringListAppendConcat(sysRunpathList, STRnLEN("/usr/ccs/lib/pa20_64" ), NULL) < 0
121 || StringListAppendConcat(sysRunpathList, STRnLEN("/opt/langtools/lib/pa20_64"), NULL) < 0
122 || StringListAppendConcat(sysRunpathList, STRnLEN("/lib/pa20_64" ), NULL) < 0
123 || StringListAppendConcat(sysRunpathList, STRnLEN("/usr/lib/pa20_64" ), NULL) < 0
124 /* added by ld among "+b :" */
125 || StringListAppendConcat(autoRunpathList, STRnLEN("/usr/lib/pa20_64" ), NULL) < 0
126 || StringListAppendConcat(autoRunpathList, STRnLEN("/usr/ccs/lib/pa20_64" ), NULL) < 0
127 )
128 break;
97 } else { 129 } else {
98 /* hppa: SOM, 32bit */ 130 /* hppa: SOM, 32bit */
99 isIA64 = false; 131 isIA64 = false;
100 is64bit = false; 132 is64bit = false;
101 if (StringListAppendConcat(sysRunpathList, 133 if (0
102 "/usr/ccs/lib", strlen("/usr/ccs/lib"), NULL) < 0 134 /* added by gcc always */
103 || StringListAppendConcat(sysRunpathList, 135 || StringListAppendConcat(sysRunpathList, STRnLEN("/usr/ccs/lib" ), NULL) < 0
104 "/opt/langtools/lib", strlen("/opt/langtools/lib"), NULL) < 0 136 || StringListAppendConcat(sysRunpathList, STRnLEN("/opt/langtools/lib"), NULL) < 0
137 /* added by ld among "+b :" */
105 ) 138 )
106 break; 139 break;
107 } 140 }
108 141
109 if (!isIA64 && is64bit) { 142 if (!isIA64 && is64bit) {
180 } 213 }
181 214
182 if (argBufferLength == 1 && argBuffer[0] == ':') { 215 if (argBufferLength == 1 && argBuffer[0] == ':') {
183 /* "+b:" collects all "-L" paths and LPATH envvar */ 216 /* "+b:" collects all "-L" paths and LPATH envvar */
184 needLibpathAsRunpath = true; 217 needLibpathAsRunpath = true;
185 /* TODO: getenv("LPATH") */ 218 needAutoRunpath = true;
186 if (isIA64 && is64bit) {
187 /* ia64w */
188 if (StringListAppendConcat(autoRunpathList,
189 "/usr/lib/hpux64", strlen("/usr/lib/hpux64"),
190 NULL) < 0)
191 break;
192 } else
193 if (isIA64 && !is64bit) {
194 /* ia64 */
195 if (StringListAppendConcat(autoRunpathList,
196 "/usr/lib/hpux32", strlen("/usr/lib/hpux32"),
197 NULL) < 0)
198 break;
199 } else
200 if (is64bit) {
201 /* hppa64 */
202 if (StringListAppendConcat(autoRunpathList,
203 "/usr/lib/pa20_64", strlen("/usr/lib/pa20_64"),
204 "/usr/ccs/lib/pa20_64", strlen("/usr/ccs/lib/pa20_64"),
205 NULL) < 0)
206 break;
207 } else {
208 /* hppa */
209 }
210 continue; 219 continue;
211 } 220 }
212 } 221 }
213 222
214 for(curr = next = argBuffer; *next != '\0'; curr = next+1) { 223 for(curr = next = argBuffer; *next != '\0'; curr = next+1) {
378 /* append local sys libpath list to runpath list */ 387 /* append local sys libpath list to runpath list */
379 if (StringListAppendList(runpathList, sysRunpathList, 0, -1) < 0) 388 if (StringListAppendList(runpathList, sysRunpathList, 0, -1) < 0)
380 break; 389 break;
381 390
382 /* append automatic sys libpath list to runpath list */ 391 /* append automatic sys libpath list to runpath list */
392 if (needAutoRunpath
383 if (StringListAppendList(runpathList, autoRunpathList, 0, -1) < 0) 393 && StringListAppendList(runpathList, autoRunpathList, 0, -1) < 0
394 )
384 break; 395 break;
385 396
386 /* create runpath string: runpath1:runpathN */ 397 /* create runpath string: runpath1:runpathN */
387 newString = StringListJoin(runpathList, NULL, 0, ":", 1, NULL, 0); 398 newString = StringListJoin(runpathList, NULL, 0, ":", 1, NULL, 0);
388 if (newString == NULL) 399 if (newString == NULL)
397 && StringListAppendConcat(data->out->argList, "+s", 2, NULL) < 0 408 && StringListAppendConcat(data->out->argList, "+s", 2, NULL) < 0
398 ) break; 409 ) break;
399 410
400 /* do we need the "+cdp ${D}:" flag? */ 411 /* do we need the "+cdp ${D}:" flag? */
401 if (needCDPflag 412 if (needCDPflag
402 && (StringListAppendConcat(data->out->argList, "+cdp", strlen("+cdp"), NULL) < 0 413 && (StringListAppendConcat(data->out->argList, STRnLEN("+cdp"), NULL) < 0
403 || StringListAppendConcat(data->out->argList, portageD, portageDlength, ":", 1, NULL) < 0 414 || StringListAppendConcat(data->out->argList, portageD, portageDlength, ":", 1, NULL) < 0
404 )) 415 ))
405 break; 416 break;
406 417
407 /* 418 /*

Legend:
Removed from v.1654  
changed lines
  Added in v.1655

  ViewVC Help
Powered by ViewVC 1.1.20