[PATCH spice-server] Fix _FORTIFY_SOURCE redefine error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the _FORTIFY_SOURCE has been already defined, we shouldn't redefine
it, or it will raise a build error as below:

In file included from agent-msg-filter.c:21:0:
../config.h:17:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
agent-msg-filter.c:1:0: note: this is the location of the previous definition

Suggested-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
Signed-off-by: Dunrong Huang <riegamaths@xxxxxxxxx>
---
 m4/spice-compile-warnings.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/spice-compile-warnings.m4 b/m4/spice-compile-warnings.m4
index 959971a..31f2a9c 100644
--- a/m4/spice-compile-warnings.m4
+++ b/m4/spice-compile-warnings.m4
@@ -113,7 +113,7 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[
     # Use improved glibc headers
     AH_VERBATIM([FORTIFY_SOURCE],
     [/* Enable compile-time and run-time bounds-checking, and some warnings. */
-#if __OPTIMIZE__
+#if !defined _FORTIFY_SOURCE &&  defined __OPTIMIZE__ && __OPTIMIZE__
 # define _FORTIFY_SOURCE 2
 #endif
 ])
-- 
1.8.3.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]