summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-07-10 11:18:55 +0000
committermidipix <writeonce@midipix.org>2018-07-11 02:30:32 -0400
commitba8a741ee5b66da5a2d44c1c9b9f6eb6d54e0b18 (patch)
tree9d298ef72bdcfd6dd5205b36b6ba98f4df0d9b8f /src
parent2a0acb3d2d178cce84d511b727e1410ebb8dbce5 (diff)
downloadslibtool-ba8a741ee5b66da5a2d44c1c9b9f6eb6d54e0b18.tar.bz2
slibtool-ba8a741ee5b66da5a2d44c1c9b9f6eb6d54e0b18.tar.xz
slbt_adjust_linker_argument(): properly handle external archives and libraries.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_link.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 20a8ac7..b5747ad 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -87,8 +87,9 @@ static int slbt_exec_link_exit(
static int slbt_get_deps_meta(
const struct slbt_driver_ctx * dctx,
- char * libfilename,
- struct slbt_deps_meta * depsmeta)
+ char * libfilename,
+ int fexternal,
+ struct slbt_deps_meta * depsmeta)
{
int fdcwd;
char * ch;
@@ -124,7 +125,8 @@ static int slbt_get_deps_meta(
/* mapinfo */
if (!(mapinfo = slbt_map_file(fdcwd,depfile,SLBT_MAP_INPUT)))
- return SLBT_SYSTEM_ERROR(dctx);
+ return (fexternal && (errno == ENOENT))
+ ? 0 : SLBT_SYSTEM_ERROR(dctx);
/* copied length */
depsmeta->infolen += mapinfo->size;
@@ -208,10 +210,10 @@ static int slbt_adjust_linker_argument(
return 0;
if (!(strcmp(dot,arsuffix)))
- return slbt_get_deps_meta(dctx,arg,depsmeta);
+ return slbt_get_deps_meta(dctx,arg,1,depsmeta);
if (!(strcmp(dot,dsosuffix)))
- return slbt_get_deps_meta(dctx,arg,depsmeta);
+ return slbt_get_deps_meta(dctx,arg,1,depsmeta);
if (strcmp(dot,".la"))
return 0;
@@ -241,12 +243,12 @@ static int slbt_adjust_linker_argument(
else
sprintf(dot,"%s",arsuffix);
- return slbt_get_deps_meta(dctx,arg,depsmeta);
+ return slbt_get_deps_meta(dctx,arg,0,depsmeta);
}
/* input archive */
sprintf(dot,"%s",arsuffix);
- return slbt_get_deps_meta(dctx,arg,depsmeta);
+ return slbt_get_deps_meta(dctx,arg,0,depsmeta);
}
static int slbt_exec_link_adjust_argument_vector(