Fix the apex compatible issue on the platform Q
Adjust the statement to always check the min_sdk_version
for cc build module.
Test: forrest, TH
Change-Id: I9aceb7ba33baa23d193a6d554e7892a5d5f0effa
diff --git a/cc/linker.go b/cc/linker.go
index 196806d..5bd21ed 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -393,7 +393,7 @@
if ctx.minSdkVersion() == "current" {
return true
}
- parsedSdkVersion, err := android.ApiLevelFromUser(ctx, ctx.minSdkVersion())
+ parsedSdkVersion, err := nativeApiLevelFromUser(ctx, ctx.minSdkVersion())
if err != nil {
ctx.PropertyErrorf("min_sdk_version",
"Invalid min_sdk_version value (must be int or current): %q",
@@ -424,7 +424,7 @@
// ANDROID_RELR relocations were supported at API level >= 28.
// Relocation packer was supported at API level >= 23.
// Do the best we can...
- if !ctx.useSdk() || CheckSdkVersionAtLeast(ctx, android.FirstShtRelrVersion) {
+ if (!ctx.useSdk() && ctx.minSdkVersion() == "") || CheckSdkVersionAtLeast(ctx, android.FirstShtRelrVersion) {
flags.Global.LdFlags = append(flags.Global.LdFlags, "-Wl,--pack-dyn-relocs=android+relr")
} else if CheckSdkVersionAtLeast(ctx, android.FirstAndroidRelrVersion) {
flags.Global.LdFlags = append(flags.Global.LdFlags,