[Spice-commits] m4/spice-compile-warnings.m4
Christophe Fergau
teuf at kemper.freedesktop.org
Thu Jun 7 08:49:24 PDT 2012
m4/spice-compile-warnings.m4 | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 331cba23cc8a7bfa0a5ec0d489cb0627121633c7
Author: Christophe Fergeau <cfergeau at redhat.com>
Date: Thu Jun 7 17:23:05 2012 +0200
build: allow building with newer glibc-headers and -O0
Fix copied from libvirt, commit by Eric Blake.
glibc 2.15 (on Fedora 17) coupled with explicit disabling of
optimization during development dies a painful death:
/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
Work around this by only conditionally defining _FORTIFY_SOURCE,
in the case where glibc can actually use it. The trick is using
AH_VERBATIM instead of AC_DEFINE.
diff --git a/m4/spice-compile-warnings.m4 b/m4/spice-compile-warnings.m4
index 1ecae2a..3c7e0d3 100644
--- a/m4/spice-compile-warnings.m4
+++ b/m4/spice-compile-warnings.m4
@@ -104,8 +104,12 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[
gl_WARN_ADD([-Wframe-larger-than=9216])
# Use improved glibc headers
- 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. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+ # define _FORTIFY_SOURCE 2
+ #endif
+ ])
# Extra special flags
dnl -fstack-protector stuff passes gl_WARN_ADD with gcc
More information about the Spice-commits
mailing list