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

Commit 1a5812a2 authored by Vic Yang's avatar Vic Yang
Browse files

Disable no-vendor-variant VNDK for CFI modules

If CFI is enabled for a module, no-vendor-variant VNDK will fail
because CFI is not used for the vendor variant.

Bug: 148638729
Test: Remove libstagefright_bufferpool@2.0 from the whitelist. Build on
      crosshatch is successful. Build on a ARM32 device with
      TARGET_VNDK_USE_CORE_VARIANT set and check no-vendor-variant VNDK
      is still enabled for libstagefright_bufferpool@2.0.

Change-Id: Ib0a411d7ea769097186afa802751b0796527ec76
parent 56bcaa6d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1104,7 +1104,21 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) {
			if ctx.isVndkSp() {
				library.baseInstaller.subDir = "vndk-sp"
			} else if ctx.isVndk() {
				if !ctx.mustUseVendorVariant() && !ctx.isVndkExt() {
				mayUseCoreVariant := true

				if ctx.mustUseVendorVariant() {
					mayUseCoreVariant = false
				}

				if ctx.isVndkExt() {
					mayUseCoreVariant = false
				}

				if ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) && ctx.Arch().ArchType == android.Arm64 {
					mayUseCoreVariant = false
				}

				if mayUseCoreVariant {
					library.checkSameCoreVariant = true
					if ctx.DeviceConfig().VndkUseCoreVariant() {
						library.useCoreVariant = true