From a2aca28750c6022f8acf030f84e45025ba46e218 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Sat, 2 Feb 2019 13:13:38 +0900 Subject: [PATCH] Use bootstrap linker for asan build This change the asan version of https://android-review.googlesource.com/c/platform/build/soong/+/879237 Bug: 123725034 Test: forrest run on asan_cf_x86_pasan Test: SANITIZE_TARGET=address m init_second_stage inspect /system/bin/init with readelf DT_INTERP is set to /system/bin/bootstrap/linker_asan Change-Id: I0fabe08cc63126aadec18ca8e9f2973c33411a4f --- cc/sanitize.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc/sanitize.go b/cc/sanitize.go index ebb638ea0..c13b855e0 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -444,7 +444,11 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags { flags.LdFlags = append(flags.LdFlags, "-Wl,--no-as-needed") } else { flags.CFlags = append(flags.CFlags, "-mllvm", "-asan-globals=0") - flags.DynamicLinker = "/system/bin/linker_asan" + if ctx.bootstrap() { + flags.DynamicLinker = "/system/bin/bootstrap/linker_asan" + } else { + flags.DynamicLinker = "/system/bin/linker_asan" + } if flags.Toolchain.Is64Bit() { flags.DynamicLinker += "64" }