]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
build: improve FORTIFY_SOURCE usage
authorEric Blake <eblake@redhat.com>
Tue, 23 Oct 2012 20:00:32 +0000 (14:00 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 23 Oct 2012 20:00:32 +0000 (14:00 -0600)
Based on this coreutils bug report, since coreutils copied what
libvirt had done:
https://lists.gnu.org/archive/html/bug-coreutils/2012-10/msg00121.html

* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Allow
for user to pre-define _FORTIFY_SOURCE.

m4/virt-compile-warnings.m4

index f1b8f393c4b740f13df21b8431ce3ac3941f6f22..4a0f28929804d22d48067a98b1d13ef7d101b495 100644 (file)
@@ -150,7 +150,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
     AH_VERBATIM([FORTIFY_SOURCE],
     [/* Enable compile-time and run-time bounds-checking, and some warnings,
         without upsetting newer glibc. */
-     #if defined __OPTIMIZE__ && __OPTIMIZE__
+     #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
      # define _FORTIFY_SOURCE 2
      #endif
     ])