summaryrefslogtreecommitdiffhomepage
path: root/src/logic/linkcmd
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-14 03:30:15 +0000
committermidipix <writeonce@midipix.org>2024-02-14 03:30:15 +0000
commita6c3935a905e27e38e63d0d77578c158c873ad08 (patch)
tree0c3183172a318f224641fc570650903799d50c5b /src/logic/linkcmd
parent771899443dce44974234093859111570560ebddc (diff)
downloadslibtool-a6c3935a905e27e38e63d0d77578c158c873ad08.tar.bz2
slibtool-a6c3935a905e27e38e63d0d77578c158c873ad08.tar.xz
link mode: dlltool support: pass dlltool explicit assembler path and flags.
Diffstat (limited to 'src/logic/linkcmd')
-rw-r--r--src/logic/linkcmd/slbt_linkcmd_implib.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/logic/linkcmd/slbt_linkcmd_implib.c b/src/logic/linkcmd/slbt_linkcmd_implib.c
index 08852b6..84bd8a1 100644
--- a/src/logic/linkcmd/slbt_linkcmd_implib.c
+++ b/src/logic/linkcmd/slbt_linkcmd_implib.c
@@ -29,8 +29,9 @@ int slbt_exec_link_create_import_library(
char * soname)
{
int fmdso;
- char * eargv[8];
+ char * eargv[12];
char program[PATH_MAX];
+ char as[PATH_MAX];
/* dlltool or mdso? */
if (dctx->cctx->drvflags & SLBT_DRIVER_IMPLIB_DSOMETA)
@@ -71,6 +72,32 @@ int slbt_exec_link_create_import_library(
eargv[5] = "-D";
eargv[6] = soname;
eargv[7] = 0;
+
+ if (dctx->cctx->host.as) {
+ if (slbt_snprintf(as,sizeof(as),
+ "%s",dctx->cctx->host.as) < 0)
+ return SLBT_BUFFER_ERROR(dctx);
+
+ eargv[7] = "-S";
+ eargv[8] = as;
+
+ const char * host = dctx->cctx->host.host;
+
+ if (host && (host[0] == 'i')
+ && (host[1] >= '3')
+ && (host[1] <= '6')
+ && (host[2] == '8')
+ && (host[3] == '6')
+ && (host[4] == '-')) {
+ eargv[9] = "-f";
+ eargv[10] = "--32";
+ eargv[11] = 0;
+ } else {
+ eargv[9] = "-f";
+ eargv[10] = "--64";
+ eargv[11] = 0;
+ }
+ }
}
/* alternate argument vector */