[Libguestfs] [PATCH 1/2] Don't redefine _FORTIFY_SOURCE

Martin Kletzander mkletzan at redhat.com
Wed Sep 4 11:42:39 UTC 2013


The macro _FORTIFY_SOURCE might be already defined by environment in
which case it shouldn't be overriden (might be if it has lower value).

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 4940df3..47dc2b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,7 +196,8 @@ if test "$gl_gcc_warnings" = yes; then
     AC_DEFINE([GNULIB_PORTCHECK], [1], [Enable some gnulib portability checks.])
     AH_VERBATIM([FORTIFY_SOURCE],[
 /* Enable compile-time and run-time bounds-checking, and some warnings. */
-#if __OPTIMIZE__
+#if __OPTIMIZE__ && (! defined (_FORTIFY_SOURCE) || _FORTIFY_SOURCE < 2)
+# undef _FORTIFY_SOURCE
 # define _FORTIFY_SOURCE 2
 #endif])
 fi
-- 
1.8.3.2




More information about the Libguestfs mailing list