diff options
author | midipix <writeonce@midipix.org> | 2016-04-23 14:22:42 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-04-23 14:28:03 -0400 |
commit | 50b6ef79fd58c456de08662dac698b6e0408a4e6 (patch) | |
tree | 55c38739fe8874899494017f728fea311ebb4923 /src/logic | |
parent | d1e25730ccd03192bee59f8e20d3274ad3acdeb4 (diff) | |
download | slibtool-50b6ef79fd58c456de08662dac698b6e0408a4e6.tar.bz2 slibtool-50b6ef79fd58c456de08662dac698b6e0408a4e6.tar.xz |
link mode: slbt_adjust_linker_argument(): account for symlinks to /dev/null.
Diffstat (limited to 'src/logic')
-rw-r--r-- | src/logic/slbt_exec_link.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index 793afc2..18d5ffd 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -14,6 +14,7 @@ #include <slibtool/slibtool.h> #include "slibtool_spawn_impl.h" +#include "slibtool_readlink_impl.h" #include "slibtool_symlink_impl.h" struct slbt_deps_meta { @@ -167,6 +168,7 @@ static int slbt_adjust_linker_argument( char * slash; char * dot; char base[PATH_MAX]; + char slnk[PATH_MAX]; if (*arg == '-') return 0; @@ -195,7 +197,10 @@ static int slbt_adjust_linker_argument( if (fpic) { sprintf(dot,"%s",dsosuffix); - if ((fdlib = open(arg,O_RDONLY)) >= 0) + if (!slbt_readlink(arg,slnk,sizeof(slnk)) + && !(strcmp(slnk,"/dev/null"))) + sprintf(dot,"%s",arsuffix); + else if ((fdlib = open(arg,O_RDONLY)) >= 0) close(fdlib); else sprintf(dot,"%s",arsuffix); |