Add ubsan_standalone library name to the toolchain.

and export the library name to make. Refactor the code a bit to avoid repeating the library name
multiple times.

Bug: 22033465
Test: Ran external/clang/build.py for aosp-llvm

Change-Id: I25eb3858eb92e1dd493b09524d559802551b2547
This commit is contained in:
Evgenii Stepanov
2016-08-15 14:18:24 -07:00
parent 9883461664
commit af36db1178
9 changed files with 36 additions and 14 deletions

View File

@@ -21,6 +21,7 @@ import (
"github.com/google/blueprint"
"android/soong/android"
"android/soong/cc/config"
)
type sanitizerType int
@@ -239,7 +240,7 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
flags.LdFlags = append(flags.LdFlags, "-Wl,-u,__asan_preinit")
// ASan runtime library must be the first in the link order.
runtimeLibrary := ctx.toolchain().AddressSanitizerRuntimeLibrary()
runtimeLibrary := config.AddressSanitizerRuntimeLibrary(ctx.toolchain())
if runtimeLibrary != "" {
flags.libFlags = append([]string{"${config.ClangAsanLibDir}/" + runtimeLibrary}, flags.libFlags...)
}