Use -mcpu=cortex-a53 for devices with Kryo

Bug: http://b/69481735

While Clang supports -mcpu=kryo, the GNU assembler doesn't.  Use
Cortex-a53 instead, which is close to Kryo.  The current alternative of
using Krait causes problems when also using armv8, which is not
available in Krait.

Test: Build marlin with internal CL 3248394 cherry-picked.
Change-Id: I571739e6ab4f1b37fafb304ecad2865c9394e04f
This commit is contained in:
Pirama Arumuga Nainar 2017-11-20 22:29:58 -08:00
parent cf31fcfc71
commit c17b275ed3
1 changed files with 5 additions and 4 deletions

View File

@ -115,7 +115,9 @@ var (
"-D__ARM_FEATURE_LPAE=1",
},
"kryo": []string{
"-mcpu=cortex-a15",
// Use cortex-a53 because the GNU assembler doesn't recognize -mcpu=kryo
// even though clang does.
"-mcpu=cortex-a53",
"-mfpu=neon-fp-armv8",
// Fake an ARM compiler flag as these processors support LPAE which GCC/clang
// don't advertise.
@ -158,10 +160,9 @@ func init() {
android.RegisterArchVariantFeatures(android.Arm, "armv7-a-neon", "neon")
android.RegisterArchVariantFeatures(android.Arm, "armv8-a", "neon")
// Krait and Kryo targets are not supported by GCC, but are supported by Clang,
// so override the definitions when building modules with Clang.
// Krait is not supported by GCC, but is supported by Clang, so
// override the definitions when building modules with Clang.
replaceFirst(armClangCpuVariantCflags["krait"], "-mcpu=cortex-a15", "-mcpu=krait")
replaceFirst(armClangCpuVariantCflags["kryo"], "-mcpu=cortex-a15", "-mcpu=krait")
// The reason we use "-march=armv8-a+crc", instead of "-march=armv8-a", for
// gcc is the latter would conflict with any specified/supported -mcpu!