bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] build: work with new glibc when not optimizing


From: Eric Blake
Subject: [PATCH] build: work with new glibc when not optimizing
Date: Sat, 1 Sep 2012 09:10:29 -0700

Starting with glibc 2.15, the system headers refuse to compile
unconditional use of FORTIFY_SOURCE if optimization is disabled
but -Werror is in effect.

* configure.ac (FORTIFY_SOURCE): Make conditional.
---

Pushing, as this is similar to the recent coreutils patch.

 configure.ac | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index dc1e582..a6168c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,8 +152,13 @@ if test "$gl_gcc_warnings" = yes; then
   AC_SUBST([WARN_CFLAGS])

   AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
-  AC_DEFINE([_FORTIFY_SOURCE], [2],
-    [enable compile-time and run-time bounds-checking, and some warnings])
+  AH_VERBATIM([FORTIFY_SOURCE],
+  [/* Enable compile-time and run-time bounds-checking, and some warnings,
+      without upsetting glibc 2.15+. */
+   #if defined __OPTIMIZE__ && __OPTIMIZE__
+   # define _FORTIFY_SOURCE 2
+   #endif
+  ])
   AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])

   # We use a slightly smaller set of warning options for lib/.
-- 
1.7.11.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]