summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/slbt_driver_ctx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index f44abfa..f65c633 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -295,6 +295,8 @@ static int slbt_init_host_params(
bool fhost = false;
bool fcompiler = false;
bool fnative = false;
+ bool fdumpmachine = false;
+ char buf[256];
/* base */
if ((base = strrchr(cctx->cargv[0],'/')))
@@ -302,6 +304,9 @@ static int slbt_init_host_params(
else
base = cctx->cargv[0];
+ if ((cctx->mode == SLBT_MODE_COMPILE) || (cctx->mode == SLBT_MODE_LINK))
+ fdumpmachine = true;
+
/* host */
if (host->host) {
cfgmeta->host = cfgexplicit;
@@ -319,6 +324,16 @@ static int slbt_init_host_params(
host->host = drvhost->host;
cfgmeta->host = cfgcompiler;
fcompiler = true;
+ } else if (fdumpmachine && !(slbt_dump_machine(
+ cctx->cargv[0],
+ buf,sizeof(buf)))) {
+ if (!(drvhost->host = strdup(buf)))
+ return -1;
+
+ host->host = drvhost->host;
+ cfgmeta->host = cfgmachine;
+ fcompiler = true;
+ fnative = (!(strcmp(host->host,SLBT_MACHINE)));
} else {
host->host = SLBT_MACHINE;
cfgmeta->host = cfgmachine;