summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-06-25 22:03:04 -0600
committerGary V. Vaughan <gary@gnu.org>2013-09-18 20:53:26 +0700
commit390d259efe8e1c7e4b6babb4738fef7427416857 (patch)
treea1e7140046f0a8b90b7bb62f2d465e8d82602f09
parentdeda5d4549291f15579b9c8ae4f9b1f862bc73bb (diff)
downloadm4-390d259efe8e1c7e4b6babb4738fef7427416857.tar.gz
build: deal with newer glibc vs. FORTIFY_SOURCE
Recent glibc (for whatever stupid reason) decided to issue a #warning when FORTIFY_SOURCE is requested but not possible, due to compilation without optimization. But when debugging sources, we don't want our use of -Werror to kill compilation just because glibc wants to be chatty; when debugging, we don't care about source fortification. * configure.ac (FORTIFY_SOURCE): Make conditional on optimization. Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r--configure.ac11
1 files changed, 8 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 62e5459b..3c93cdf3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# Configure template for GNU m4. -*-Autoconf-*-
-# Copyright (C) 1991-1994, 2000-2002, 2004-2010, 2013 Free Software
+# Copyright (C) 1991-1994, 2000-2002, 2004-2013 Free Software
# Foundation, Inc.
#
# This file is part of GNU M4.
@@ -142,8 +142,13 @@ if test "$gl_gcc_warnings" = yes; then
AC_SUBST([WARN_CFLAGS])
- 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 newer glibc. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+ # define _FORTIFY_SOURCE 2
+ #endif
+ ])
fi
# Use gcc's -pipe option if available: for faster compilation.