Raise minsdk for CRT dependencies
Prevent depending on CRT variations that don't exist by raising
the CRT dependency api level to the minimum supported for the
architecture.
Test: lunch aosp_riscv64-userdebug && m -k
Change-Id: I575355569b3772f5d1fe2530161a1d45aa00a349
diff --git a/cc/cc.go b/cc/cc.go
index cb425c3..27ea1a2 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2212,6 +2212,13 @@
if err != nil {
ctx.PropertyErrorf("min_sdk_version", err.Error())
}
+
+ // Raise the minSdkVersion to the minimum supported for the architecture.
+ minApiForArch := minApiForArch(ctx, m.Target().Arch.ArchType)
+ if apiLevel.LessThan(minApiForArch) {
+ apiLevel = minApiForArch
+ }
+
return []blueprint.Variation{
{Mutator: "sdk", Variation: "sdk"},
{Mutator: "version", Variation: apiLevel.String()},