summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-08-31 12:07:54 -0700
committerEric Blake <eblake@redhat.com>2012-08-31 13:50:53 -0700
commit314457b2aed274984425d3156a8e2fb76662ea24 (patch)
tree549304ea1444891b86d0121a33c4593ceb270ad8 /configure.ac
parent1e4300e9263f81bee969db8a7ab135436fdf9ede (diff)
downloadcoreutils-314457b2aed274984425d3156a8e2fb76662ea24.tar.xz
build: work with new glibc when not optimizing
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.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 7 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 083fd3491..f93e65e9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,8 +162,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/.