summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-08-10 10:43:47 -0400
committermidipix <writeonce@midipix.org>2017-08-10 10:57:45 -0400
commitfb50c9c53f08e4b6ef1bdec3ee56d6b7f138b04c (patch)
tree37e6b6b0965aa5de85c0149e720bb1393c62dcc0 /src/logic
parent347e756f91e3f46a0e0713846326dbbf4056cbff (diff)
downloadslibtool-fb50c9c53f08e4b6ef1bdec3ee56d6b7f138b04c.tar.bz2
slibtool-fb50c9c53f08e4b6ef1bdec3ee56d6b7f138b04c.tar.xz
slibtool-shared: properly handle .la arguments when creating an archive.
tool ==== slibtool-shared (or slibtool with -disable-static). scenario ======== - create libfoo.so (via libfoo.la). - create libbar.a (via libbar.la), with libfoo.la as an input argument. Before this fix, slibtool failed since it could not find libfoo.a.slibtool.deps. After this fix, slibtool properly handles this scenario, first by detecting that there is no archive for which secondary dependencies need to be processed, and then by detecting that libfoo.a is a symlink to /dev/null.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_link.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 6ce059b..7cbad2e 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -633,6 +633,7 @@ static int slbt_exec_link_create_dep_file(
struct stat st;
int ldepth;
int fdyndep;
+ int fnodeps;
if (ectx->fdeps) {
fclose(ectx->fdeps);
@@ -701,6 +702,7 @@ static int slbt_exec_link_create_dep_file(
fdeps = 0;
fdyndep = !stat(depfile,&st);
+ fnodeps = farchive && fdyndep;
/* [-L... as needed] */
if (fdyndep && (base > *parg) && (ectx->ldirdepth >= 0)) {
@@ -756,7 +758,7 @@ static int slbt_exec_link_create_dep_file(
}
}
- if (farchive || !fdeps) {
+ if (!fnodeps && (farchive || !fdeps)) {
if ((size_t)snprintf(mark,size,".a.slibtool.deps")
>= size)
return SLBT_BUFFER_ERROR(dctx);