From 44742869d7f234fbd63c48643532bed89e6dc3eb Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Wed, 23 Jan 2013 09:38:06 -0800 Subject: [PATCH] * acinclude.m4: only turn on FORTIFY_SOURCE if it won't anger gcc Following libvirt commits cf9bced0 and 1c2edf0f --- acinclude.m4 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 7168cf302..f6321823a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -19,7 +19,7 @@ AC_DEFUN([AUGEAS_COMPILE_WARNINGS],[ warnCFLAGS= - common_flags="-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables" + common_flags="-fexceptions -fasynchronous-unwind-tables" case "$enable_compile_warnings" in no) @@ -45,6 +45,14 @@ AC_DEFUN([AUGEAS_COMPILE_WARNINGS],[ ;; esac + AH_VERBATIM([FORTIFY_SOURCE], + [/* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting newer glibc. */ + #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ + # define _FORTIFY_SOURCE 2 + #endif + ]) + compiler_flags= for option in $try_compiler_flags; do SAVE_CFLAGS="$CFLAGS"