>From 5dfcf84c8243441f30a3c852791b8d46bc4d2c53 Mon Sep 17 00:00:00 2001 From: Richard PALO Date: Thu, 24 Sep 2015 13:23:56 +0200 Subject: [PATCH] workaround for -nostdlib with -fstack-protector on solaris --- build-aux/ltmain.in | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 0c40da0..7a6356b 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5364,8 +5364,7 @@ func_mode_link () # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*|-specs=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" @@ -5374,6 +5373,25 @@ func_mode_link () continue ;; + -fstack-protector*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + + # Explicitly add solaris ssp libs to postdeps to counter + # linking with g++ -nostdlib when supplied -fstack-protector* + test CXX = "$tagname" && { + case $host_os in + solaris*) + func_append postdeps " `$compile_command -dumpspecs 2>/dev/null | $SED -n '/fstack-protector/{s/^.*://;s/}$//;p;}'`" + ;; + esac + } + continue + ;; + -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options -- 2.5.2