[master] 7fb8751 address a specific issue on solaris with gcc -m32 -fstack-protector

Nils Goroll nils.goroll at uplex.de
Wed Dec 7 21:02:05 CET 2016

commit 7fb87518495328df82819f6504b76323362cd12a
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Dec 7 20:43:04 2016 +0100

    address a specific issue on solaris with gcc -m32 -fstack-protector
    To avoid an undefined symbol __stack_chk_fail_local due to compiling
    and linking gcc not seeing the same flags, we need to trick libtool
    into passing a flag it would otherwise remove.
    Please hold your whitespace ocds and exclude the non-standard indent
    chosen to avoid excessive line length.

diff --git a/configure.ac b/configure.ac
index 9400c09..094f7e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -605,6 +605,23 @@ if test "x$enable_developer_warnings" != "xno"; then
+# gcc on solaris needs -fstack-protector when calling gcc in linker
+# mode but libtool does not pass it on, so we need to trick it
+# specifically
+case $CFLAGS in
+  *-fstack-protector*)
+    case $target in
+      *-*-solaris*)
+	case $CC in
+	  gcc*)
+	    AM_LT_LDFLAGS="${AM_LT_LDFLAGS} -Wc,-fstack-protector"
+	    ;;
+	esac
+	;;
+    esac
+    ;;
 # --enable-debugging-symbols
 	AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]),

More information about the varnish-commit mailing list