Fix static_ndk_lib for sanitized libraries.

Test: build-ndk-prebuilts.sh with libc/libm included in the NDK
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: Ic398f541036f6c16f7dc58b9af984c60ed948495
This commit is contained in:
Dan Albert 2018-01-19 12:30:45 -08:00
parent e021b0405d
commit 7d1eecf3cc
2 changed files with 8 additions and 1 deletions

View file

@ -729,7 +729,8 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) {
}
if Bool(library.Properties.Static_ndk_lib) && library.static() &&
!ctx.useVndk() && ctx.Device() {
!ctx.useVndk() && ctx.Device() &&
library.sanitize.isUnsanitizedVariant() {
installPath := getNdkSysrootBase(ctx).Join(
ctx, "usr/lib", ctx.toolchain().ClangTriple(), file.Base())

View file

@ -514,6 +514,12 @@ func (sanitize *sanitize) getSanitizerBoolPtr(t sanitizerType) *bool {
}
}
func (sanitize *sanitize) isUnsanitizedVariant() bool {
return !sanitize.isSanitizerEnabled(asan) &&
!sanitize.isSanitizerEnabled(tsan) &&
!sanitize.isSanitizerEnabled(cfi)
}
func (sanitize *sanitize) SetSanitizer(t sanitizerType, b bool) {
switch t {
case asan: