diff options
author | midipix <writeonce@midipix.org> | 2024-02-16 04:17:42 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-02-16 05:59:51 +0000 |
commit | a1c68ae23d88564cbe6cf335d2e0dfac14e0024b (patch) | |
tree | b32ef669b49494a4f6e618e5981ae1d88e782bec /src | |
parent | 5c8c001fb81b54dda6126bcc7f3b076070a75fbe (diff) | |
download | slibtool-a1c68ae23d88564cbe6cf335d2e0dfac14e0024b.tar.bz2 slibtool-a1c68ae23d88564cbe6cf335d2e0dfac14e0024b.tar.xz |
link mode: archive creation: added support for tool-specific argument vector.
Diffstat (limited to 'src')
-rw-r--r-- | src/logic/linkcmd/slbt_linkcmd_archive.c | 23 |
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; |