Add to support armv8-2a on 2nd arch. variant

Add arch. variant option to support cores that implement armv8-2a ISAs.

Test: set TARGET_2ND_ARCH_VARIANT := armv8-2a, build successful and 32bit app launch ok

BUG: 118414869
Change-Id: I755b8858726bd887068923123bad106aed7b1ec8
This commit is contained in:
mtk15504 2018-10-31 15:26:32 +08:00 committed by Isaac Lee
parent 31bef5b329
commit 270ba75991
1 changed files with 12 additions and 2 deletions

View File

@ -66,6 +66,11 @@ var (
"-mfloat-abi=softfp",
"-mfpu=neon-fp-armv8",
},
"armv8-2a": []string{
"-march=armv8.2-a",
"-mfloat-abi=softfp",
"-mfpu=neon-fp-armv8",
},
}
armClangCpuVariantCflags = map[string][]string{
@ -161,6 +166,7 @@ func init() {
"armv7-a",
"armv7-a-neon",
"armv8-a",
"armv8-2a",
"cortex-a7",
"cortex-a8",
"cortex-a9",
@ -180,6 +186,7 @@ func init() {
android.RegisterArchVariantFeatures(android.Arm, "armv7-a-neon", "neon")
android.RegisterArchVariantFeatures(android.Arm, "armv8-a", "neon")
android.RegisterArchVariantFeatures(android.Arm, "armv8-2a", "neon")
pctx.StaticVariable("armGccVersion", armGccVersion)
@ -208,6 +215,8 @@ func init() {
strings.Join(armClangArchVariantCflags["armv7-a-neon"], " "))
pctx.StaticVariable("ArmClangArmv8ACflags",
strings.Join(armClangArchVariantCflags["armv8-a"], " "))
pctx.StaticVariable("ArmClangArmv82ACflags",
strings.Join(armClangArchVariantCflags["armv8-2a"], " "))
// Clang cpu variant cflags
pctx.StaticVariable("ArmClangGenericCflags",
@ -233,6 +242,7 @@ var (
"armv7-a": "${config.ArmClangArmv7ACflags}",
"armv7-a-neon": "${config.ArmClangArmv7ANeonCflags}",
"armv8-a": "${config.ArmClangArmv8ACflags}",
"armv8-2a": "${config.ArmClangArmv82ACflags}",
}
armClangCpuVariantCflagsVar = map[string]string{
@ -347,8 +357,8 @@ func armToolchainFactory(arch android.Arch) Toolchain {
}
case "armv7-a":
fixCortexA8 = "-Wl,--fix-cortex-a8"
case "armv8-a":
// Nothing extra for armv8-a
case "armv8-a", "armv8-2a":
// Nothing extra for armv8-a/armv8-2a
default:
panic(fmt.Sprintf("Unknown ARM architecture version: %q", arch.ArchVariant))
}