aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-01-22 12:00:00 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-01-22 12:00:16 +0100
commit21d50c219da5430e68a358394daf691b6e3bb576 (patch)
tree7f5a8eeb8fffc922219a69dccc629cc27c05d378
parent2f06b5965ae564dea4d13b5c0ec79cfb58d2c74a (diff)
parent6ac0b3be2d5c5277805c16b56ee5b2e59ba9e84c (diff)
Merge pull request #1674
6ac0b3b build: Add -static for mingw builds (Wladimir J. van der Laan) 4e57e23 enable full GCC Stack-smashing protection for all OSes (Philip Kaufmann)
-rw-r--r--configure.ac6
1 files changed, 2 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 973f4398df..e2eded84e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,6 +175,7 @@ case $host in
AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing))
AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing))
+ AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"])
AX_CHECK_LINK_FLAG([[-static-libgcc]],[LDFLAGS="$LDFLAGS -static-libgcc"])
AX_CHECK_LINK_FLAG([[-static-libstdc++]],[LDFLAGS="$LDFLAGS -static-libstdc++"])
@@ -284,6 +285,7 @@ AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large
if test x$use_hardening != xno; then
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
+ AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"])
AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
@@ -299,10 +301,6 @@ if test x$use_hardening != xno; then
AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [LDFLAGS="-Wl,-z,now"])
if test x$TARGET_OS != xwindows; then
- # -fstack-protector-all can produce broken binaries with mingw
- AX_CHECK_COMPILE_FLAG([-fno-stack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fno-stack-protector"])
- AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
-
# -pie will link successfully with MinGW, but it's unsupported and leads to undeterministic binaries
AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"])
fi