From 8f47fc379e79becfc395c4f51b691aa7af75baee Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 27 Jan 2014 17:34:21 -0800 Subject: [PATCH] Add support for TARGET_GLOBAL_UNSUPPORTED_CFLAGS To ease the transition between toolchains, allow a target to specify a list of cflags that the toolchain does not support. These will be filtered out of the cflags provided by the module. Add TARGET_GLOBAL_UNSUPPORTED_CFLAGS := -fstack-protector for the aarch64 toolchain, it does not yet suport -fstack-protector. Change-Id: I168d0c6f131326fad305ec86fad46e6a3e03295a --- core/binary.mk | 1 + core/combo/TARGET_linux-arm64.mk | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/binary.mk b/core/binary.mk index 3556b99c42..adc2f44661 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -97,6 +97,7 @@ my_cxx := $(LOCAL_CXX) my_c_includes := $(LOCAL_C_INCLUDES) $(LOCAL_C_INCLUDES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) my_generated_sources := $(LOCAL_GENERATED_SOURCES) +my_cflags := $(filter-out $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_UNSUPPORTED_CFLAGS),$(my_cflags)) # The real dependency will be added after all Android.mks are loaded and the install paths # of the shared libraries are determined. diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk index a175eab09f..76ee567a85 100644 --- a/core/combo/TARGET_linux-arm64.mk +++ b/core/combo/TARGET_linux-arm64.mk @@ -91,6 +91,9 @@ TARGET_GLOBAL_CFLAGS += \ -include $(android_config_h) \ -I $(dir $(android_config_h)) +# HACK: globally disable -fstack-protector until the toolchain supports it +TARGET_GLOBAL_UNSUPPORTED_CFLAGS := -fstack-protector + # TODO - remove __ANDROID__ after the next aarch64 toolchain refresh TARGET_GLOBAL_CFLAGS += -D__ANDROID__=1