summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/libosinfo-compile-warnings.m49
1 files changed, 7 insertions, 2 deletions
diff --git a/m4/libosinfo-compile-warnings.m4 b/m4/libosinfo-compile-warnings.m4
index 60152f0..508ff80 100644
--- a/m4/libosinfo-compile-warnings.m4
+++ b/m4/libosinfo-compile-warnings.m4
@@ -86,8 +86,13 @@ AC_DEFUN([LIBOSINFO_COMPILE_WARNINGS],[
gl_WARN_ADD([-Wframe-larger-than=4096])
# 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,
+ without upsetting newer glibc. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+ # define _FORTIFY_SOURCE 2
+ #endif
+ ])
# Extra special flags
dnl -fstack-protector stuff passes gl_WARN_ADD with gcc