From c026f6d0ed7c2af56d8c1bdb27a3f526c5e13f12 Mon Sep 17 00:00:00 2001 From: Vishwath Mohan Date: Thu, 20 Apr 2017 07:39:13 -0700 Subject: [PATCH] Disable CFI for ASAN targets. (Make) This CL disables CFI if both CFI and ASAN flags are enabled. This allows ASAN to take precedence where needed, preventing build errors that would otherwise arise. Bug: 30227045 Test: SANITIZE_TARGET="address" m -j40 Change-Id: I9073ace0a10eb554d14e418a9b23cc8a8277607d --- core/config_sanitizers.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index d735a024f9..04aedf401b 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -74,6 +74,12 @@ ifneq ($(filter arm,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),) my_sanitize_diag := $(filter-out cfi,$(my_sanitize_diag)) endif +# Also disable CFI if ASAN is enabled. +ifneq ($(filter address,$(my_sanitize)),) + my_sanitize := $(filter-out cfi,$(my_sanitize)) + my_sanitize_diag := $(filter-out cfi,$(my_sanitize_diag)) +endif + # CFI needs gold linker, and mips toolchain does not have one. ifneq ($(filter mips mips64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),) my_sanitize := $(filter-out cfi,$(my_sanitize))