summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-04-01 18:10:59 +0100
committermidipix <writeonce@midipix.org>2021-04-01 17:27:43 +0000
commit2a100f3622881e3b85b312e2d5360c5f779acba1 (patch)
treeebba396b1f3674cac641d449e55fbf60022e560c
parent15903b7303c7df9da80045098eed98be06d44b1a (diff)
downloadslibtool-2a100f3622881e3b85b312e2d5360c5f779acba1.tar.bz2
slibtool-2a100f3622881e3b85b312e2d5360c5f779acba1.tar.xz
link mode: always include deplib dirs in ldpathenv.
-rw-r--r--src/logic/slbt_exec_link.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index ff1d7df..11f1416 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -478,9 +478,9 @@ static int slbt_exec_link_adjust_argument_vector(
*slash = 0;
if (slbt_dprintf(fdwrap,
- "DL_PATH=\"$DL_PATH$COLON%s/%s\"\n"
+ "DL_PATH=\"$DL_PATH$COLON%s%s%s\"\n"
"COLON=':'\n\n",
- cwd,arg) < 0)
+ ((arg[0] == '/') ? "" : cwd),((arg[0] == '/') ? "" : "/"),arg) < 0)
return slbt_exec_link_exit(
depsmeta,
SLBT_SYSTEM_ERROR(dctx,0));
@@ -556,6 +556,26 @@ static int slbt_exec_link_adjust_argument_vector(
darg += strlen(darg);
darg++;
+
+ if ((fdwrap = slbt_exec_get_fdwrapper(ectx)) >= 0) {
+ if (slbt_dprintf(fdwrap,
+ "DL_PATH=\"$DL_PATH$COLON%s/%s\"\n"
+ "COLON=':'\n\n",
+ lib,depdir) < 0)
+ return slbt_exec_link_exit(
+ depsmeta,
+ SLBT_SYSTEM_ERROR(dctx,0));
+ }
+ } else if ((mark[0] == '-') && (mark[1] == 'L')) {
+ if ((fdwrap = slbt_exec_get_fdwrapper(ectx)) >= 0) {
+ if (slbt_dprintf(fdwrap,
+ "DL_PATH=\"$DL_PATH$COLON%s\"\n"
+ "COLON=':'\n\n",
+ &mark[2]) < 0)
+ return slbt_exec_link_exit(
+ depsmeta,
+ SLBT_SYSTEM_ERROR(dctx,0));
+ }
}
}
}