summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-16 04:17:42 +0000
committermidipix <writeonce@midipix.org>2024-02-16 05:59:51 +0000
commita1c68ae23d88564cbe6cf335d2e0dfac14e0024b (patch)
treeb32ef669b49494a4f6e618e5981ae1d88e782bec /src/logic
parent5c8c001fb81b54dda6126bcc7f3b076070a75fbe (diff)
downloadslibtool-a1c68ae23d88564cbe6cf335d2e0dfac14e0024b.tar.bz2
slibtool-a1c68ae23d88564cbe6cf335d2e0dfac14e0024b.tar.xz
link mode: archive creation: added support for tool-specific argument vector.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/linkcmd/slbt_linkcmd_archive.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/logic/linkcmd/slbt_linkcmd_archive.c b/src/logic/linkcmd/slbt_linkcmd_archive.c
index f88a7ca..5826fd7 100644
--- a/src/logic/linkcmd/slbt_linkcmd_archive.c
+++ b/src/logic/linkcmd/slbt_linkcmd_archive.c
@@ -76,6 +76,7 @@ int slbt_exec_link_create_archive(
bool fpic)
{
int fdcwd;
+ char ** argv;
char ** aarg;
char ** parg;
char program[PATH_MAX];
@@ -101,18 +102,30 @@ int slbt_exec_link_create_archive(
"%s",arfilename) < 0)
return SLBT_BUFFER_ERROR(dctx);
- /* ar alternate argument vector */
- if (slbt_snprintf(program,sizeof(program),
- "%s",dctx->cctx->host.ar) < 0)
- return SLBT_BUFFER_ERROR(dctx);
+ /* tool-specific argument vector */
+ argv = (slbt_get_driver_ictx(dctx))->host.ar_argv;
+ /* ar alternate argument vector */
+ if (!argv)
+ if (slbt_snprintf(program,sizeof(program),
+ "%s",dctx->cctx->host.ar) < 0)
+ return SLBT_BUFFER_ERROR(dctx);
/* fdcwd */
fdcwd = slbt_driver_fdcwd(dctx);
/* input argument adjustment */
aarg = ectx->altv;
- *aarg++ = program;
+
+ if ((parg = argv)) {
+ ectx->program = argv[0];
+
+ for (; *parg; )
+ *aarg++ = *parg++;
+ } else {
+ *aarg++ = program;
+ }
+
*aarg++ = "-crs";
*aarg++ = output;