Append ".static" to ubsan runtime for static binaries

Bug: 183611452
Test: m BUILD_HOST_static=1 tinyplay2
Change-Id: I8d8ef762781f0583c8b9337ce5876c7d3140f665
This commit is contained in:
Colin Cross 2021-03-29 13:41:37 -07:00
parent 6c968b1f0f
commit 32f1de3327
1 changed files with 3 additions and 0 deletions

View File

@ -1129,6 +1129,9 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
Bool(c.sanitize.Properties.Sanitize.Undefined) ||
Bool(c.sanitize.Properties.Sanitize.All_undefined) {
runtimeLibrary = config.UndefinedBehaviorSanitizerRuntimeLibrary(toolchain)
if c.staticBinary() {
runtimeLibrary += ".static"
}
}
if runtimeLibrary != "" && (toolchain.Bionic() || c.sanitize.Properties.UbsanRuntimeDep) {