[experimental-ims] e60db5b Pass -Wc, -fstack-protector to the libtool ld stage, to make the stack protector work on omnios
Tollef Fog Heen
tfheen at varnish-software.com
Thu Dec 18 10:27:54 CET 2014
commit e60db5be39c24347edb54de6df4130c4ee1f4c38
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date: Thu Aug 23 11:40:33 2012 +0200
Pass -Wc,-fstack-protector to the libtool ld stage, to make the stack protector work on omnios
diff --git a/configure.ac b/configure.ac
index 13c38d1..e831b31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -480,12 +480,16 @@ AC_ARG_ENABLE(stack-protector,
if test "x$enable_stack_protector" != "xno"; then
save_CFLAGS="$CFLAGS"
CFLAGS="${CFLAGS} -fstack-protector-all"
+ save_AM_LT_LDFLAGS="$AM_LT_LDFLAGS"
+ AM_LT_LDFLAGS="${AM_LT_LDFLAGS} -Wc,-fstack-protector"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([],[],[])],
[],
[AC_MSG_WARN([-fstack-protector not supported, disabling])
- CFLAGS="$save_CFLAGS"])
+ CFLAGS="$save_CFLAGS"]
+ AM_LT_LDFLAGS="$save_AM_LT_LDFLAGS")
fi
+AC_SUBST(AM_LT_LDFLAGS)
# --enable-tests
AC_ARG_ENABLE(tests,
diff --git a/lib/libvarnish/Makefile.am b/lib/libvarnish/Makefile.am
index ab2cc94..740ae16 100644
--- a/lib/libvarnish/Makefile.am
+++ b/lib/libvarnish/Makefile.am
@@ -1,8 +1,10 @@
INCLUDES = -I$(top_srcdir)/include @PCRE_CFLAGS@
+AM_LDFLAGS = $(AM_LT_LDFLAGS)
+
pkglib_LTLIBRARIES = libvarnish.la
-libvarnish_la_LDFLAGS = -avoid-version
+libvarnish_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
libvarnish_la_SOURCES = \
vav.c \
diff --git a/lib/libvarnishapi/Makefile.am b/lib/libvarnishapi/Makefile.am
index 492b10d..ee86abc 100644
--- a/lib/libvarnishapi/Makefile.am
+++ b/lib/libvarnishapi/Makefile.am
@@ -1,10 +1,12 @@
#
+AM_LDFLAGS = $(AM_LT_LDFLAGS)
+
INCLUDES = -I$(top_srcdir)/include @PCRE_CFLAGS@
lib_LTLIBRARIES = libvarnishapi.la
-libvarnishapi_la_LDFLAGS = -version-info 1:0:0
+libvarnishapi_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
libvarnishapi_la_SOURCES = \
vsm_api.h \
diff --git a/lib/libvarnishcompat/Makefile.am b/lib/libvarnishcompat/Makefile.am
index 22c652e..33aac4a 100644
--- a/lib/libvarnishcompat/Makefile.am
+++ b/lib/libvarnishcompat/Makefile.am
@@ -1,10 +1,11 @@
#
INCLUDES = -I$(top_srcdir)/include
+AM_LDFLAGS = $(AM_LT_LDFLAGS)
pkglib_LTLIBRARIES = libvarnishcompat.la
-libvarnishcompat_la_LDFLAGS = -avoid-version
+libvarnishcompat_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
libvarnishcompat_la_SOURCES = \
daemon.c \
diff --git a/lib/libvcl/Makefile.am b/lib/libvcl/Makefile.am
index 02a685f..f07facd 100644
--- a/lib/libvcl/Makefile.am
+++ b/lib/libvcl/Makefile.am
@@ -1,10 +1,12 @@
#
+AM_LDFLAGS = $(AM_LT_LDFLAGS)
+
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include
pkglib_LTLIBRARIES = libvcl.la
-libvcl_la_LDFLAGS = -avoid-version
+libvcl_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
libvcl_la_SOURCES = \
vcc_compile.h \
diff --git a/lib/libvgz/Makefile.am b/lib/libvgz/Makefile.am
index c04242c..7497aab 100644
--- a/lib/libvgz/Makefile.am
+++ b/lib/libvgz/Makefile.am
@@ -1,8 +1,9 @@
#
+AM_LDFLAGS = $(AM_LT_LDFLAGS)
pkglib_LTLIBRARIES = libvgz.la
-libvgz_la_LDFLAGS = -avoid-version
+libvgz_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
libvgz_la_CFLAGS = -D_LARGEFILE64_SOURCE=1 $(libvgz_extra_cflags)
libvgz_la_SOURCES = \
diff --git a/lib/libvmod_debug/Makefile.am b/lib/libvmod_debug/Makefile.am
index 23a6d53..1705cf9 100644
--- a/lib/libvmod_debug/Makefile.am
+++ b/lib/libvmod_debug/Makefile.am
@@ -1,4 +1,5 @@
#
+AM_LDFLAGS = $(AM_LT_LDFLAGS)
INCLUDES = \
-I$(top_srcdir)/include \
@@ -10,7 +11,7 @@ vmod_srcdir = $(top_srcdir)/lib/libvmod_debug
vmodtool = $(top_srcdir)/lib/libvcl/vmodtool.py
noinst_LTLIBRARIES = libvmod_debug.la
-libvmod_debug_la_LDFLAGS = -module -export-dynamic -avoid-version -rpath /nowhere
+libvmod_debug_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version -rpath /nowhere
libvmod_debug_la_SOURCES = \
vcc_if.c \
diff --git a/lib/libvmod_std/Makefile.am b/lib/libvmod_std/Makefile.am
index a872837..0a4736a 100644
--- a/lib/libvmod_std/Makefile.am
+++ b/lib/libvmod_std/Makefile.am
@@ -1,5 +1,7 @@
#
+AM_LDFLAGS = $(AM_LT_LDFLAGS)
+
INCLUDES = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
@@ -12,7 +14,7 @@ vmod_srcdir = $(top_srcdir)/lib/libvmod_std
vmodtool = $(top_srcdir)/lib/libvcl/vmodtool.py
vmod_LTLIBRARIES = libvmod_std.la
-libvmod_std_la_LDFLAGS = -module -export-dynamic -avoid-version
+libvmod_std_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version
libvmod_std_la_SOURCES = \
vcc_if.c \
More information about the varnish-commit
mailing list