summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-20 11:44:43 -0400
committermidipix <writeonce@midipix.org>2016-03-20 13:01:27 -0400
commit6d0e8adf800c3f3bd5767ebb0cd6d2842d56a337 (patch)
tree4f51ca7c0ac4932e8f4127ed8433c2856ce75c51
parent583c0a2be1ec2dea2e3362bbc09b42eeb2817d6e (diff)
downloadslibtool-6d0e8adf800c3f3bd5767ebb0cd6d2842d56a337.tar.bz2
slibtool-6d0e8adf800c3f3bd5767ebb0cd6d2842d56a337.tar.xz
struct slbt_exec_ctx: added alternate argument vector for ar invocation.
-rw-r--r--include/slibtool/slibtool.h1
-rw-r--r--src/logic/slbt_exec_ctx.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index 5f0a76a..c1aea06 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -85,6 +85,7 @@ struct slbt_exec_ctx {
char * program;
char ** argv;
char ** envp;
+ char ** altv;
char ** dpic;
char ** fpic;
char ** cass;
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index 5dd9d70..0af29ca 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -102,7 +102,7 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
if (!(args = malloc(size)))
return 0;
- size = sizeof(*ictx) + (argc+SLBT_ARGV_SPARE_PTRS)*sizeof(char *);
+ size = sizeof(*ictx) + (2*(argc+1)+SLBT_ARGV_SPARE_PTRS)*sizeof(char *);
if (!(ictx = calloc(1,size))) {
free(args);
@@ -136,6 +136,7 @@ int slbt_get_exec_ctx(
/* init with guard for later .lo check */
ch = ictx->args + strlen(".lo");
ictx->ctx.argv = ictx->buffer;
+ ictx->ctx.altv = &ictx->buffer[ictx->argc + 1];
/* <compiler> */
ictx->ctx.program = dctx->cctx->cargv[0];