[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] build: deal with newer glibc vs. FORTIFY_SOURCE
From: |
Eric Blake |
Subject: |
[PATCH 1/3] build: deal with newer glibc vs. FORTIFY_SOURCE |
Date: |
Mon, 25 Jun 2012 22:34:07 -0600 |
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 <address@hidden>
---
ChangeLog | 7 ++++++-
configure.ac | 11 ++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4908b5e..c8e1a72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-25 Eric Blake <address@hidden>
+
+ build: deal with newer glibc vs. FORTIFY_SOURCE
+ * configure.ac (FORTIFY_SOURCE): Make conditional on optimization.
+
2011-05-02 Eric Blake <address@hidden>
build: pick up latest gnulib fixes
@@ -5316,7 +5321,7 @@ Mon Jan 22 21:08:52 1990 Rene' Seindal (seindal at
diku.dk)
coding: utf-8
End:
- Copyright (C) 1990-1994, 2000-2001, 2003, 2005-2011 Free Software
+ Copyright (C) 1990-1994, 2000-2001, 2003, 2005-2012 Free Software
Foundation, Inc.
Copying and distribution of this file, with or without
diff --git a/configure.ac b/configure.ac
index 17f23e7..8eecef3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# Configure template for GNU M4. -*-Autoconf-*-
-# Copyright (C) 1991, 1993-1994, 2004-2011 Free Software Foundation,
+# Copyright (C) 1991, 1993-1994, 2004-2012 Free Software Foundation,
# Inc.
#
# This file is part of GNU M4.
@@ -85,8 +85,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
# Tandem/NSK is broken - it has 'long long int' but not
--
1.7.10.2