From 9ebc278f91a4c72746f724c4f62fb1e4ca65c945 Mon Sep 17 00:00:00 2001 From: Vishwath Mohan Date: Tue, 9 May 2017 09:54:49 -0700 Subject: [PATCH] Selectively add _asan flavor suffix. This CL ensures that the _asan suffix is added to the build flavor only when it doesn't already contain _asan (or _asan_coverage). This correctly prevents it from appending an extra _asan to ASAN lunch configs that already include it in the flavor, while allowing sanitized targets for generic configs to behave as they used to. Bug: 38145756 Test: _asan is correctly appended only for lunch configs that don't already specify it in the build flavor. Change-Id: Ia7d9356f717b97d1c64e3237ca31cc507f27734f --- core/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 7a8ba1fdc0..e20a5a20c8 100644 --- a/core/Makefile +++ b/core/Makefile @@ -191,11 +191,16 @@ endef BUILDINFO_SH := build/tools/buildinfo.sh -# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test harness to distinguish builds. +# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test +# harness to distinguish builds. Only add _asan for a sanitized build +# if it isn't already a part of the flavor (via a dedicated lunch +# config for example). TARGET_BUILD_FLAVOR := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) ifdef SANITIZE_TARGET +ifeq (,$(findstring _asan,$(TARGET_BUILD_FLAVOR))) TARGET_BUILD_FLAVOR := $(TARGET_BUILD_FLAVOR)_asan endif +endif ifdef TARGET_SYSTEM_PROP system_prop_file := $(TARGET_SYSTEM_PROP)