summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-16 09:32:49 +0000
committermidipix <writeonce@midipix.org>2021-04-16 10:24:26 +0000
commit9c5ba5eba6c7c5274d7e9e6203ee5aad2fb438fb (patch)
tree21201c8095604556aa4464ed626697147cd0805b
parentbd56f89f1a29adcefa7c9836a5ff4f5e78f45be6 (diff)
downloadslibtool-9c5ba5eba6c7c5274d7e9e6203ee5aad2fb438fb.tar.bz2
slibtool-9c5ba5eba6c7c5274d7e9e6203ee5aad2fb438fb.tar.xz
link mode: legacy libtool compatibility: support linking against -module libs.
-rw-r--r--src/logic/slbt_exec_link.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 3836f14..ea5dccf 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -583,15 +583,23 @@ static int slbt_exec_link_adjust_argument_vector(
return ret;
}
- *aarg++ = *carg++;
- *aarg++ = ++mark;
+ dlen = strlen(dctx->cctx->settings.dsoprefix);
+
+ /* -module? (todo: non-portable usage, display warning) */
+ if (strncmp(++slash,dctx->cctx->settings.dsoprefix,dlen)) {
+ *--slash = '/';
+ strcpy(*carg,arg);
+ *aarg++ = *carg++;
+ } else {
+ *aarg++ = *carg++;
+ *aarg++ = ++mark;
- ++slash;
- slash += strlen(dctx->cctx->settings.dsoprefix);
+ slash += dlen;
- sprintf(mark,"-l%s",slash);
- dot = strrchr(mark,'.');
- *dot = 0;
+ sprintf(mark,"-l%s",slash);
+ dot = strrchr(mark,'.');
+ *dot = 0;
+ }
} else {
*aarg++ = *carg++;
}