From 1c29b0e6ec3faf3b560335444c39f026cd212622 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 23 Jan 2019 17:17:05 +0900 Subject: [PATCH] Fix: sanitizerRuntimeMutator is not run for host Bug: 123254047 Test: m ASAN_OPTIONS=detect_leaks=0 SANITIZE_HOST=address FORCE_BUILD_LLVM_COMPONENTS=true out/host/linux-x86/bin/adb nm -an out/host/linux-x86/bin/adb | grep -c asan shows non-zero value Change-Id: I030e08bd0db38585b1fdaecd00220406f1e8b371 --- cc/sanitize.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cc/sanitize.go b/cc/sanitize.go index d19e54a34..162e22e0b 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -667,10 +667,10 @@ func sanitizerRuntimeDepsMutator(mctx android.TopDownMutatorContext) { // Add the dependency to the runtime library for each of the sanitizer variants func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) { - if mctx.Os() != android.Android { - return - } if c, ok := mctx.Module().(*Module); ok && c.sanitize != nil { + if !c.Enabled() { + return + } var sanitizers []string var diagSanitizers []string