Add -Wc,-fstack-protector to LT_LDFLAGS instead of adding

-fstack-protector to LDFLAGS so it doesn't get stripped out.  Libtool
will strip -fstack-protector from the linker flags and we always
link with libtool.
This commit is contained in:
Todd C. Miller
2012-07-01 13:47:25 -04:00
parent 2e36b1ef2b
commit effd6cd911
2 changed files with 2 additions and 2 deletions

2
configure vendored
View File

@@ -20413,7 +20413,7 @@ $as_echo "$ax_cv_check_ldflags___fstack_protector" >&6; }
if test x"$ax_cv_check_ldflags___fstack_protector" = xyes; then :
CFLAGS="${CFLAGS} -fstack-protector"
LDFLAGS="${LDFLAGS} -fstack-protector"
LT_LDFLAGS="${LT_LDFLAGS} -Wc,-fstack-protector"
else
:

View File

@@ -3280,7 +3280,7 @@ if test "$enable_hardening" != "no"; then
AX_CHECK_COMPILE_FLAG([-fstack-protector], [
AX_CHECK_LINK_FLAG([-fstack-protector], [
CFLAGS="${CFLAGS} -fstack-protector"
LDFLAGS="${LDFLAGS} -fstack-protector"
LT_LDFLAGS="${LT_LDFLAGS} -Wc,-fstack-protector"
])
])
AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="${LDFLAGS} -Wl,-z,relro"])