From 2baf1cc107ba6041a3856b77d33140ac876ad6f0 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 21 Jun 2018 09:50:26 -0400 Subject: link mode: --disable-{shared|static}: use differently-named placeholders. --- src/logic/slbt_exec_install.c | 8 ++++---- src/logic/slbt_exec_link.c | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/logic') diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c index ea795e3..2d98881 100644 --- a/src/logic/slbt_exec_install.c +++ b/src/logic/slbt_exec_install.c @@ -424,6 +424,10 @@ static int slbt_exec_install_entry( /* source (build) symlink target */ if (slbt_readlink(slnkname,target,sizeof(target)) < 0) { + /* -all-static? */ + if (slbt_symlink_is_a_placeholder(slnkname)) + return 0; + /* -avoid-version? */ if (stat(slnkname,&st)) return SLBT_SYSTEM_ERROR(dctx); @@ -447,10 +451,6 @@ static int slbt_exec_install_entry( return 0; } - /* -all-static? */ - if (!strcmp(target,"/dev/null")) - return 0; - /* srcfile: .libs/libfoo.so.x.y.z */ slash = strrchr(srcfile,'/'); strcpy(++slash,target); diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index 542448c..5cf3355 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -200,7 +200,6 @@ static int slbt_adjust_linker_argument( char * slash; char * dot; char base[PATH_MAX]; - char slnk[PATH_MAX]; if (*arg == '-') return 0; @@ -229,8 +228,7 @@ static int slbt_adjust_linker_argument( if (fpic) { sprintf(dot,"%s",dsosuffix); - if (!slbt_readlink(arg,slnk,sizeof(slnk)) - && !(strcmp(slnk,"/dev/null"))) + if (slbt_symlink_is_a_placeholder(arg)) sprintf(dot,"%s",arsuffix); else if ((fdlib = open(arg,O_RDONLY)) >= 0) close(fdlib); -- cgit v1.2.3