OSDN Git Service

HOST_linux-x86: Avoid doubly define macro _FORTIFY_SOURCE
authorJim Huang <jserv@0xlab.org>
Tue, 6 Sep 2011 17:25:28 +0000 (01:25 +0800)
committerJean-Baptiste Queru <jbq@google.com>
Thu, 27 Oct 2011 17:38:10 +0000 (10:38 -0700)
While building Android with latest host gcc, it causes the following
build error:

Install: out/host/linux-x86/bin/mkbootimg
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors

In order to make build system happy, this patch does unset macro
_FORTIFY_SOURCE and then define it in host cflags.

Change-Id: Ic37a90f05081a2c3650b3335bc87e9e895900fb2

core/combo/HOST_linux-x86.mk

index c871613..1a5e17f 100644 (file)
@@ -58,6 +58,6 @@ HOST_GLOBAL_CFLAGS += \
        -include $(call select-android-config-h,linux-x86)
 
 # Disable new longjmp in glibc 2.11 and later. See bug 2967937.
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
 
 HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined