Ignore native bridge archs for apex selection
This leads to an arm64 apex being used on a device that is mixed
x86_64 with nativebridge=arm64. A device like that doesn't appear
to work with arm64 binaries. For example, the boringssl-self-check
binary crashes on boot.
Bug: 260115309
Test: unit test
Test: boot emulator with this combination
Change-Id: Ic4a91974290a05b1799f755fcf52ef226d68f4c2
diff --git a/apex/prebuilt.go b/apex/prebuilt.go
index 39446a1..6fdd50a 100644
--- a/apex/prebuilt.go
+++ b/apex/prebuilt.go
@@ -24,6 +24,7 @@
"android/soong/android"
"android/soong/java"
"android/soong/provenance"
+
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -831,6 +832,8 @@
}
apexSet := android.SingleSourcePathFromSupplier(ctx, srcsSupplier, "set")
p.extractedApex = android.PathForModuleOut(ctx, "extracted", apexSet.Base())
+ // Filter out NativeBridge archs (b/260115309)
+ abis := java.SupportedAbis(ctx, true)
ctx.Build(pctx,
android.BuildParams{
Rule: extractMatchingApex,
@@ -838,7 +841,7 @@
Inputs: android.Paths{apexSet},
Output: p.extractedApex,
Args: map[string]string{
- "abis": strings.Join(java.SupportedAbis(ctx), ","),
+ "abis": strings.Join(abis, ","),
"allow-prereleased": strconv.FormatBool(proptools.Bool(p.properties.Prerelease)),
"sdk-version": ctx.Config().PlatformSdkVersion().String(),
},