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

Commit 312ccb97 authored by Justin Yun's avatar Justin Yun
Browse files

Skip installing the VNDK prebuilt if arch does not match

For the VNDK prebuilt modules that does not match the target arch,
skip installing the module instead of marking the module to prevent
installing.

Bug: 72310137
Bug: 71787263
Test: Install VNDK snapshot v27
      lunch aosp_arm64_ab-userdebug; m vndk_v27_arm64
      - vndk libs must be installed
      m vndk_v27_arm
      - no vndk libs must be installed because target does not match
      OUT_DIR=out_clean m --skip-make

Change-Id: I9df25d90c276ce5e0d94ec7f9bee32f9ce7231df
parent f231b190
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -1510,17 +1510,12 @@ func vendorMutator(mctx android.BottomUpMutatorContext) {
		mod := mctx.CreateVariations(vendorMode)
		vendor := mod[0].(*Module)
		vendor.Properties.UseVndk = true
	} else if prebuilt, ok := m.linker.(*vndkPrebuiltLibraryDecorator); ok {
	} else if _, ok := m.linker.(*vndkPrebuiltLibraryDecorator); ok {
		// Make vendor variants only for the versions in BOARD_VNDK_VERSION and
		// PRODUCT_EXTRA_VNDK_VERSIONS.
		mod := mctx.CreateVariations(vendorMode)
		vendor := mod[0].(*Module)
		vendor.Properties.UseVndk = true
		arches := mctx.DeviceConfig().Arches()
		if len(arches) == 0 || arches[0].ArchType.String() != prebuilt.arch() {
			vendor.Properties.PreventInstall = true
			vendor.Properties.HideFromMake = true
		}
	} else if m.hasVendorVariant() && !vendorSpecific {
		// This will be available in both /system and /vendor
		// or a /system directory that is available to vendor.
+4 −0
Original line number Diff line number Diff line
@@ -110,6 +110,10 @@ func (p *vndkPrebuiltLibraryDecorator) link(ctx ModuleContext,
}

func (p *vndkPrebuiltLibraryDecorator) install(ctx ModuleContext, file android.Path) {
	arches := ctx.DeviceConfig().Arches()
	if len(arches) == 0 || arches[0].ArchType.String() != p.arch() {
		return
	}
	if p.shared() {
		if ctx.isVndkSp() {
			p.baseInstaller.subDir = "vndk-sp-" + p.version()