summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-07-19 02:51:53 +0000
committermidipix <writeonce@midipix.org>2024-07-19 03:09:42 +0000
commit99eb57ae04ee435a5d498c01badff4e7a58e5bf1 (patch)
treeda4dc03f41314518aa80132140d61e336cb7ce64 /src
parent99a62b114b0f32b3c4a46f18dbfe22fe33405dab (diff)
downloadslibtool-99eb57ae04ee435a5d498c01badff4e7a58e5bf1.tar.bz2
slibtool-99eb57ae04ee435a5d498c01badff4e7a58e5bf1.tar.xz
driver: heuristics: ignore errors if invoked with any of the -print commands.
Diffstat (limited to 'src')
-rw-r--r--src/driver/slbt_driver_ctx.c4
-rw-r--r--src/internal/slibtool_driver_impl.h5
-rw-r--r--src/internal/slibtool_lconf_impl.c18
3 files changed, 21 insertions, 6 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index c4f50b5..09adb68 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -440,6 +440,7 @@ int slbt_lib_get_driver_ctx(
sargv.cargv = 0;
objlistv = 0;
ndlopen = 0;
+ lflags = 0;
switch (slbt_split_argv(argv,flags,&sargv,&objlistv,fdctx->fderr,fdctx->fdcwd)) {
case SLBT_OK:
@@ -1012,7 +1013,8 @@ int slbt_lib_get_driver_ctx(
if (cctx.drvflags & SLBT_DRIVER_HEURISTICS) {
if (slbt_get_lconf_flags(&ctx->ctx,lconf,&lflags,false) < 0)
- return slbt_lib_get_driver_ctx_fail(&ctx->ctx,0);
+ if (!(cctx.drvflags & SLBT_DRIVER_OUTPUT_MASK))
+ return slbt_lib_get_driver_ctx_fail(&ctx->ctx,0);
} else {
switch (cctx.mode) {
case SLBT_MODE_UNKNOWN:
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index 3a1ca05..7b6114d 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -20,6 +20,11 @@
#define SLBT_OPTV_ELEMENTS 128
+#define SLBT_DRIVER_OUTPUT_MASK (SLBT_DRIVER_OUTPUT_M4_DIR \
+ | SLBT_DRIVER_OUTPUT_AUX_DIR \
+ | SLBT_DRIVER_OUTPUT_SHARED_EXT \
+ | SLBT_DRIVER_OUTPUT_STATIC_EXT)
+
extern const struct argv_option slbt_default_options[];
enum app_tags {
diff --git a/src/internal/slibtool_lconf_impl.c b/src/internal/slibtool_lconf_impl.c
index ffe92b0..7f43034 100644
--- a/src/internal/slibtool_lconf_impl.c
+++ b/src/internal/slibtool_lconf_impl.c
@@ -545,6 +545,7 @@ static int slbt_lconf_open(
fdcwd = slbt_driver_fdcwd(dctx);
fdlconfdir = fdcwd;
fsilent |= (dctx->cctx->drvflags & SLBT_DRIVER_SILENT);
+ fsilent |= (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_MASK);
if (lconf) {
mconf = 0;
@@ -629,15 +630,21 @@ static int slbt_lconf_open(
if (stparent.st_dev != stcwd.st_dev) {
trace_result(dctx,fdparent,fdparent,".",EXDEV,lconfpath);
close(fdparent);
- return SLBT_CUSTOM_ERROR(
- dctx,SLBT_ERR_LCONF_OPEN);
+
+ return (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_MASK)
+ ? (-1)
+ : SLBT_CUSTOM_ERROR(
+ dctx,SLBT_ERR_LCONF_OPEN);
}
if (stparent.st_ino == stinode) {
trace_result(dctx,fdparent,fdparent,".",ELOOP,lconfpath);
close(fdparent);
- return SLBT_CUSTOM_ERROR(
- dctx,SLBT_ERR_LCONF_OPEN);
+
+ return (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_MASK)
+ ? (-1)
+ : SLBT_CUSTOM_ERROR(
+ dctx,SLBT_ERR_LCONF_OPEN);
}
fdlconfdir = fdparent;
@@ -766,7 +773,8 @@ slbt_hidden int slbt_get_lconf_flags(
/* open relative libtool script */
if ((fdlconf = slbt_lconf_open(dctx,lconf,fsilent,&val)) < 0)
- return SLBT_NESTED_ERROR(dctx);
+ return (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_MASK)
+ ? (-1) : SLBT_NESTED_ERROR(dctx);
/* cache the configuration in library friendly form) */
if (slbt_lib_get_txtfile_ctx(dctx,val,&ctx->lconfctx) < 0)