From 224806d00ea1fbafde1adfd6fdf26693170f2648 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 12 May 2015 21:41:52 -0700 Subject: [PATCH] Turn on _FORTIFY_SOURCE=2 for the host. Bug: http://b/20558757 Change-Id: Ic0c173d25dc6b2fa9c3122a523af5f37bc1b8c55 --- core/combo/HOST_linux-x86.mk | 3 +-- core/combo/HOST_linux-x86_64.mk | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk index 8eda6c09e4..3acf7957fa 100644 --- a/core/combo/HOST_linux-x86.mk +++ b/core/combo/HOST_linux-x86.mk @@ -40,8 +40,7 @@ $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC \ -no-canonical-prefixes \ -include $(call select-android-config-h,linux-x86) -# TODO: Set _FORTIFY_SOURCE=2. Bug 20558757. -$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fstack-protector +$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector # Workaround differences in inttypes.h between host and target. # See bug 12708004. diff --git a/core/combo/HOST_linux-x86_64.mk b/core/combo/HOST_linux-x86_64.mk index e268e41eb3..b74990b1f9 100644 --- a/core/combo/HOST_linux-x86_64.mk +++ b/core/combo/HOST_linux-x86_64.mk @@ -40,8 +40,7 @@ HOST_GLOBAL_CFLAGS += -fPIC \ -no-canonical-prefixes \ -include $(call select-android-config-h,linux-x86) -# TODO: Set _FORTIFY_SOURCE=2. Bug 20558757. -HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fstack-protector +HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector # Workaround differences in inttypes.h between host and target. # See bug 12708004.