From a6c3935a905e27e38e63d0d77578c158c873ad08 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 14 Feb 2024 03:30:15 +0000 Subject: link mode: dlltool support: pass dlltool explicit assembler path and flags. --- src/logic/linkcmd/slbt_linkcmd_implib.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/logic') 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 */ -- cgit v1.2.3