Don't enable -fstack-protector-strong on Windows for now
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 2 Mar 2018 20:08:21 +0000 (15:08 -0500)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 2 Mar 2018 20:08:21 +0000 (15:08 -0500)
It adds a libssp-0.dll dependency and prevents static linking

configure.ac

index dbc4ed1..3bd683b 100644 (file)
@@ -829,13 +829,20 @@ i[[3456]]86 | x86_64)
   ;;
 esac
 
+on_windows=no
+case $host in
+*cygwin*|*mingw*)
+  on_windows=yes
+  ;;
+esac
+
 dnl Enable stack-protector-all only on x86 where it's well supported.
 dnl on some platforms it causes crashes. Hopefully the OS's default's
 dnl include this on platforms that work but have been missed here.
 AC_ARG_ENABLE([stack-protector],
     [AS_HELP_STRING([--disable-stack-protector],[Disable compiler stack hardening])],,
     [
-      AS_IF([test "$ac_cv_c_compiler_gnu" = "yes" && test "$on_x86" = "yes"],
+      AS_IF([test "$ac_cv_c_compiler_gnu" = "yes" && test "$on_x86" = "yes" && test "$on_windows" = "no"],
             [enable_stack_protector=yes],[enable_stack_protector=no])
     ])