summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_link.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-04 03:37:08 +0000
committermidipix <writeonce@midipix.org>2024-02-04 03:37:08 +0000
commit5c429555a5cb83026f39fbfd8aeb666b58b283b5 (patch)
treed3cfbc1dc302ab0018806aea6092317217e9b9ef /src/logic/slbt_exec_link.c
parent80b4319d2e8453a90c2cecba3bfd43cf4dddbc0a (diff)
downloadslibtool-5c429555a5cb83026f39fbfd8aeb666b58b283b5.tar.bz2
slibtool-5c429555a5cb83026f39fbfd8aeb666b58b283b5.tar.xz
slbt_exec_link(): enhance logging of linker- and linking-tool errors.
Diffstat (limited to 'src/logic/slbt_exec_link.c')
-rw-r--r--src/logic/slbt_exec_link.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index b2cad03..122e6ee 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -1244,9 +1244,15 @@ static int slbt_exec_link_create_import_library(
return SLBT_NESTED_ERROR(dctx);
/* dlltool/mdso spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return SLBT_SPAWN_ERROR(dctx);
+ } else if (ectx->exitcode) {
+ return SLBT_CUSTOM_ERROR(
+ dctx,
+ fmdso ? SLBT_ERR_MDSO_ERROR : SLBT_ERR_DLLTOOL_ERROR);
+ }
+
return 0;
}
@@ -1349,9 +1355,15 @@ static int slbt_exec_link_create_archive(
return SLBT_NESTED_ERROR(dctx);
/* ar spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return SLBT_SPAWN_ERROR(dctx);
+ } else if (ectx->exitcode) {
+ return SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_AR_ERROR);
+ }
+
/* input objects associated with .la archives */
for (parg=ectx->cargv; *parg; parg++)
if (slbt_adjust_wrapper_argument(*parg,true))
@@ -1566,11 +1578,19 @@ static int slbt_exec_link_create_library(
SLBT_NESTED_ERROR(dctx));
/* spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return slbt_exec_link_exit(
&depsmeta,
SLBT_SPAWN_ERROR(dctx));
+ } else if (ectx->exitcode) {
+ return slbt_exec_link_exit(
+ &depsmeta,
+ SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_LINK_ERROR));
+ }
+
return slbt_exec_link_exit(&depsmeta,0);
}
@@ -1739,11 +1759,19 @@ static int slbt_exec_link_create_executable(
SLBT_NESTED_ERROR(dctx));
/* spawn */
- if ((slbt_spawn(ectx,true) < 0) || ectx->exitcode)
+ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) {
return slbt_exec_link_exit(
&depsmeta,
SLBT_SPAWN_ERROR(dctx));
+ } else if (ectx->exitcode) {
+ return slbt_exec_link_exit(
+ &depsmeta,
+ SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_LINK_ERROR));
+ }
+
/* executable wrapper: finalize */
slbt_exec_close_fdwrapper(ectx);