summaryrefslogtreecommitdiffhomepage
path: root/src/logic/slbt_exec_compile.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-02-19 08:30:41 -0500
committermidipix <writeonce@midipix.org>2019-02-19 08:30:41 -0500
commit34988f835484e8a4fdc3e9a93930786755a63d05 (patch)
tree2a3e0b8a853927d15e13d0a297089c0c21d088a0 /src/logic/slbt_exec_compile.c
parent513f55dd376fbfc0625b00e56340fa17052a75ea (diff)
downloadslibtool-34988f835484e8a4fdc3e9a93930786755a63d05.tar.bz2
slibtool-34988f835484e8a4fdc3e9a93930786755a63d05.tar.xz
driver, compile & link mode: support arbitrary & known compiler wrappers.
Diffstat (limited to 'src/logic/slbt_exec_compile.c')
-rw-r--r--src/logic/slbt_exec_compile.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/logic/slbt_exec_compile.c b/src/logic/slbt_exec_compile.c
index cad5bd8..8efa777 100644
--- a/src/logic/slbt_exec_compile.c
+++ b/src/logic/slbt_exec_compile.c
@@ -43,6 +43,7 @@ static int slbt_exec_compile_finalize_argument_vector(
char ** cap;
char ** src;
char ** dst;
+ char * ccwrap;
/* vector size */
base = ectx->argv;
@@ -89,12 +90,17 @@ static int slbt_exec_compile_finalize_argument_vector(
}
}
- /* (program name) */
- dst = &base[1];
+ /* program name, ccwrap */
+ if ((ccwrap = (char *)dctx->cctx->ccwrap)) {
+ base[1] = base[0];
+ base[0] = ccwrap;
+ base++;
+ }
/* join all other args */
src = aargv;
cap = aarg;
+ dst = &base[1];
for (; src<cap; )
*dst++ = *src++;
@@ -126,6 +132,7 @@ int slbt_exec_compile(
{
int ret;
char * fpic;
+ char * ccwrap;
struct slbt_exec_ctx * actx = 0;
const struct slbt_common_ctx * cctx = dctx->cctx;
@@ -153,7 +160,8 @@ int slbt_exec_compile(
}
/* compile mode */
- ectx->program = ectx->compiler;
+ ccwrap = (char *)cctx->ccwrap;
+ ectx->program = ccwrap ? ccwrap : ectx->compiler;
ectx->argv = ectx->cargv;
/* -fpic */