From a1c68ae23d88564cbe6cf335d2e0dfac14e0024b Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 16 Feb 2024 04:17:42 +0000 Subject: link mode: archive creation: added support for tool-specific argument vector. --- src/logic/linkcmd/slbt_linkcmd_archive.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/logic') 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; -- cgit v1.2.3