From 94868fcfce9afea841d74c2f3a81ea9493aaac1b Mon Sep 17 00:00:00 2001
From: midipix <writeonce@midipix.org>
Date: Fri, 16 Feb 2024 08:06:11 +0000
Subject: driver: host.[mdso,dlltool]: added support for tool-specific argument
 vector.

---
 src/driver/slbt_driver_ctx.c       |  6 ++++++
 src/internal/slibtool_lconf_impl.c | 12 +++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

(limited to 'src')

diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 50c1a9b..c728570 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -951,6 +951,12 @@ int slbt_get_driver_ctx(
 	if (slbt_driver_parse_tool_argv(ctx->cctx.host.as,&ctx->host.as_argv) < 0)
 		return slbt_get_driver_ctx_fail(&ctx->ctx,0);
 
+	if (slbt_driver_parse_tool_argv(ctx->cctx.host.dlltool,&ctx->host.dlltool_argv) < 0)
+		return slbt_get_driver_ctx_fail(&ctx->ctx,0);
+
+	if (slbt_driver_parse_tool_argv(ctx->cctx.host.mdso,&ctx->host.mdso_argv) < 0)
+		return slbt_get_driver_ctx_fail(&ctx->ctx,0);
+
 	/* flavor settings */
 	slbt_init_flavor_settings(
 		&ctx->cctx,0,
diff --git a/src/internal/slibtool_lconf_impl.c b/src/internal/slibtool_lconf_impl.c
index 93dc2d3..102a2b6 100644
--- a/src/internal/slibtool_lconf_impl.c
+++ b/src/internal/slibtool_lconf_impl.c
@@ -839,12 +839,14 @@ int slbt_get_lconf_flags(
 
 	/* dlltool tool (optional) */
 	if (!ctx->cctx.host.dlltool) {
-		if (!slbt_get_lconf_var(addr,cap,"DLLTOOL=",0,&val)) {
-			if (val[0] && !(ctx->host.dlltool = strdup(val)))
-				return SLBT_SYSTEM_ERROR(dctx,0);
+		if (slbt_get_lconf_var(addr,cap,"DLLTOOL=",0x20,&val) < 0)
+			return SLBT_CUSTOM_ERROR(
+				dctx,SLBT_ERR_LCONF_PARSE);
 
-			ctx->cctx.host.dlltool = ctx->host.dlltool;
-		}
+		if (val[0] && !(ctx->host.dlltool = strdup(val)))
+			return SLBT_SYSTEM_ERROR(dctx,0);
+
+		ctx->cctx.host.dlltool = ctx->host.dlltool;
 	}
 
 
-- 
cgit v1.2.3