Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d1eecf3 authored by Dan Albert's avatar Dan Albert
Browse files

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
parent e021b040
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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())

+6 −0
Original line number Diff line number Diff line
@@ -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: