Generic 32-bit armv8 built as generic armv7 fix
When the following lines are specified in the BoardConfig.mk
TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_VARIANT := generic
The resulted binaries won't be built using 32-bit armv8-a integer
division instructions. Instead, division routines are used because
the build system will set a compiler option "-march=armv7-a", and
hence overwiting the previous "-march=armv8-a", when
TARGET_2ND_CPU_VARIANT is set to generic (or unset).
Bug: 67446726
Test: lunch aosp_arm64; make -j; emulator # boot to home screen
Also verify -march=armv7-a is not specified in the compiler
command line and the resulted binary actually uses integer
division instructions.
Change-Id: I430687aa5a658d2ec9f325a66d849b4c8898c7d5
diff --git a/cc/config/arm_device.go b/cc/config/arm_device.go
index 2c439f0..6703969 100644
--- a/cc/config/arm_device.go
+++ b/cc/config/arm_device.go
@@ -77,6 +77,7 @@
"-mfpu=vfpv3-d16",
},
"armv7-a-neon": []string{
+ "-march=armv7-a",
"-mfloat-abi=softfp",
"-mfpu=neon",
},
@@ -88,9 +89,6 @@
}
armCpuVariantCflags = map[string][]string{
- "": []string{
- "-march=armv7-a",
- },
"cortex-a7": []string{
"-mcpu=cortex-a7",
"-mfpu=neon-vfpv4",