* [gentoo-commits] gentoo-alt r1630 - trunk/toolchain-prefix-wrapper/ld
@ 2008-05-09 6:25 Michael Haubenwallner (haubi)
0 siblings, 0 replies; only message in thread
From: Michael Haubenwallner (haubi) @ 2008-05-09 6:25 UTC (permalink / raw
To: gentoo-commits
Author: haubi
Date: 2008-05-09 06:25:24 +0000 (Fri, 09 May 2008)
New Revision: 1630
Modified:
trunk/toolchain-prefix-wrapper/ld/aixplugin.c
Log:
keep putting library path into runpath if no runpath specified on aix
Modified: trunk/toolchain-prefix-wrapper/ld/aixplugin.c
===================================================================
--- trunk/toolchain-prefix-wrapper/ld/aixplugin.c 2008-05-06 17:07:58 UTC (rev 1629)
+++ trunk/toolchain-prefix-wrapper/ld/aixplugin.c 2008-05-09 06:25:24 UTC (rev 1630)
@@ -15,9 +15,12 @@
extern "C" {
#endif
-/* HPUX-ld:
- * When there is no explicit runpath on the linker commandline (+b runpath),
- * then all library paths (-L) are recorded as runpath
+/* AIX-ld:
+ * When there is no explicit runpath on the linker commandline (-blibpath:runpath),
+ * then all library paths (-L) are recorded as runpath if not in svr4 mode.
+ *
+ * Extension to default-mode (non-svr4):
+ * Accept additional runpaths specified with -R
*/
int aixplugin(LdPluginData* data)
{
@@ -63,6 +66,7 @@
argBuffer = StringGetBuffer(argString);
if (strcmp(argBuffer, "-bsvr4") == 0) {
svr4mode = 1;
+ libpath2runpath = 0;
}
}
@@ -72,16 +76,13 @@
argBufferLength = StringGetLength(argString);
if (strcmp(argBuffer, "-bnolibpath") == 0) {
- /* explicitly specified:
- * do not record -L path as runpath, specified explicitly.
- */
+ /* explicitly specified: do not record -L args as runpath. */
libpath2runpath = 0;
/* This also removes each runpath specified before. */
StringListClear(runpathList);
if (svr4mode) {
- /* if not in svr4-mode, we accept -R as extension */
StringListClear(defaultRunpathList);
- }
+ } /* else we accept -R as extension */
continue;
} else
if (strncmp(argBuffer, "-blibpath:", strlen("-blibpath:")) == 0) {
@@ -89,7 +90,7 @@
argBuffer += strlen("-blibpath:");
- /* do not record -L path as runpath, we have explicit -blibpath: */
+ /* do not record -L args as runpath, we have explicit -blibpath: */
libpath2runpath = 0;
/* '-blibpath:' kills previous '-blibpath:' */
@@ -98,7 +99,7 @@
if (svr4mode) {
/* it also kills previous '-Rrunpathlist' in svr4mode */
StringListClear(defaultRunpathList);
- }
+ } /* else we accept -R as extension */
for(curr = next = argBuffer; *next != '\0'; curr = next+1) {
for(next = curr; *next != '\0' && *next != ':'; next++);
@@ -124,13 +125,9 @@
continue;
} else
if (strncmp(argBuffer, "-R", strlen("-R")) == 0) {
- /* extension:
- * collect additional default runpath from "-R runpath"
- */
-
if (svr4mode) {
/* in svr4 mode, '-R' kills previous '-blibpath:' arguments.
- * in normal mode, we implement -R as an extension.
+ * in normal mode, we implement '-R runpath' as an extension.
*/
StringListClear(runpathList);
}
@@ -163,6 +160,10 @@
break;
}
+ if (libpath2runpath /* need to record '-L' args as runpath too */
+ && StringListAppendList(runpathList, data->in->userLibpath, 0, -1) < 0
+ ) break;
+
/* always have default runpath list in runpath */
if (StringListAppendList(runpathList, defaultRunpathList, 0, -1) < 0)
break;
@@ -171,9 +172,9 @@
if (StringListAppendList(runpathList, data->in->sysRunpath, 0, -1) < 0)
break;
- /* need to add /usr/lib:/lib myself */
- if (StringListAppendList(runpathList, aixRunpathList, 0, -1) < 0)
- break;
+ /* need to add /usr/lib:/lib myself even in svr4 mode, as we drop -R args */
+ if (StringListAppendList(runpathList, aixRunpathList, 0, -1) < 0
+ ) break;
/* create runpath string: "-blibpath:libpath1:libpathN" */
newString = StringListJoin(runpathList
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-05-09 6:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-09 6:25 [gentoo-commits] gentoo-alt r1630 - trunk/toolchain-prefix-wrapper/ld Michael Haubenwallner (haubi)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox