Alexandre Julliard : configure: Disable Fortify if it's enabled by default, it's too broken.
Alexandre Julliard
julliard at winehq.org
Thu Dec 2 16:30:52 CST 2010
Module: wine
Branch: stable
Commit: ce6a613147264988fc065cc1b9d578d7d1cc9b52
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ce6a613147264988fc065cc1b9d578d7d1cc9b52
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Oct 22 17:13:57 2010 +0200
configure: Disable Fortify if it's enabled by default, it's too broken.
(cherry picked from commit 105793bff75f6a869bd9ccfb390b2f88fa861235)
---
configure | 33 +++++++++++++++++++++++++++++++++
configure.ac | 13 +++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index ab8f4dd..1832286 100755
--- a/configure
+++ b/configure
@@ -11941,6 +11941,39 @@ $as_echo "#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__))" >>con
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the need to disable Fortify" >&5
+$as_echo_n "checking for the need to disable Fortify... " >&6; }
+if test "${ac_cv_c_fortify_enabled+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+int
+main ()
+{
+#if defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0
+#error Fortify enabled
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_fortify_enabled=no
+else
+ ac_cv_c_fortify_enabled=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_fortify_enabled" >&5
+$as_echo "$ac_cv_c_fortify_enabled" >&6; }
+if test "$ac_cv_c_fortify_enabled" = yes
+then
+ EXTRACFLAGS="$EXTRACFLAGS -D_FORTIFY_SOURCE=0"
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether external symbols need an underscore prefix" >&5
$as_echo_n "checking whether external symbols need an underscore prefix... " >&6; }
if test "${ac_cv_c_extern_prefix+set}" = set; then :
diff --git a/configure.ac b/configure.ac
index 76999c3..8d1d298 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1626,6 +1626,19 @@ then
fi
fi
+dnl **** Disable Fortify, it has too many false positives
+
+AC_CACHE_CHECK([for the need to disable Fortify], ac_cv_c_fortify_enabled,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]],
+[[#if defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0
+#error Fortify enabled
+#endif]])],
+ [ac_cv_c_fortify_enabled=no],[ac_cv_c_fortify_enabled=yes]))
+if test "$ac_cv_c_fortify_enabled" = yes
+then
+ EXTRACFLAGS="$EXTRACFLAGS -D_FORTIFY_SOURCE=0"
+fi
+
dnl **** Check for underscore on external symbols ****
AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
More information about the wine-cvs
mailing list