From f5af850a2966d3d0097db3632ece83796fbc054d Mon Sep 17 00:00:00 2001 From: Isaac Chen Date: Wed, 23 Aug 2017 10:58:57 +0000 Subject: [PATCH] Revert "Revert "Build support for 32-bit armv8-a"" This reverts commit 7de79cbeafd651313da75dccafb563accc288edb. Fixed CTS build issue by adding -march=armv7-a in cts/tests/tests/os/jni/Android.mk since the library built here needs/uses instruction (swp) obsolete in ARMv8. Bug: 64964151 Test: lunch aosp_arm64-userdebug; make -j cts lunch aosp_x86-userdebug; make -j cts lunch aosp_sailfish-userdebug; make -j cts lunch aosp_bullhead-userdebug; make -j cts Change-Id: Ic3a121600da8e2a9a2d5176b9680cd18ce457959 --- core/combo/TARGET_linux-arm.mk | 20 ++++++++++++++++++++ core/combo/arch/arm/armv8-a.mk | 9 +++++++++ target/board/generic_arm64/BoardConfig.mk | 12 ++++++------ 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 core/combo/arch/arm/armv8-a.mk diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index 2e179f6edd..73b1c046dc 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -29,6 +29,26 @@ # include defines, and compiler settings for the given architecture # version. # +ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)),) +TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT := generic +endif + +KNOWN_ARMv8_CORES := cortex-a53 cortex-a53.a57 cortex-a73 +KNOWN_ARMv8_CORES += kryo denver64 exynos-m1 exynos-m2 + +# Many devices (incorrectly) use armv7-a-neon as the 2nd architecture variant +# for cores that implement armv8-a ISAs. The following sets it to armv8-a. +ifneq (,$(filter $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT), $(KNOWN_ARMv8_CORES))) + ifneq ($(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT),armv8-a) + $(warning $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT) is armv8-a.) + ifneq (,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)) + $(warning TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT, $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT), ignored! Use armv8-a instead.) + endif + # Overwrite TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT + TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv8-a + endif +endif + ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)),) TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv5te endif diff --git a/core/combo/arch/arm/armv8-a.mk b/core/combo/arch/arm/armv8-a.mk new file mode 100644 index 0000000000..9ef5c4944e --- /dev/null +++ b/core/combo/arch/arm/armv8-a.mk @@ -0,0 +1,9 @@ +# Configuration for Linux on ARM. +# Generating binaries for the ARMv8-a architecture +# +# Many libraries are not aware of armv8-a, and AArch32 is (almost) a superset +# of armv7-a-neon. So just let them think we are just like v7. +ARCH_ARM_HAVE_ARMV7A := true +ARCH_ARM_HAVE_VFP := true +ARCH_ARM_HAVE_VFP_D32 := true +ARCH_ARM_HAVE_NEON := true diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index ea4b05ba14..3420ed3c8c 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -35,11 +35,11 @@ ifneq ($(TARGET_BUILD_APPS)$(filter cts,$(MAKECMDGOALS)),) # platforms. # # If you're building a 64 bit platform (and not an application) the -# ARM-v8 specification allows you to assume NEON and all the features -# available in a cortex-A15 CPU. You should be able to set : +# ARM-v8 specification allows you to assume all the features available in an +# armv7-a-neon CPU. You should set the following as 2nd arch/cpu variant: # -# TARGET_2ND_ARCH_VARIANT := armv7-a-neon -# TARGET_2ND_CPU_VARIANT := cortex-a15 +# TARGET_2ND_ARCH_VARIANT := armv8-a +# TARGET_2ND_CPU_VARIANT := generic # # DO NOT USE # DO NOT USE @@ -50,8 +50,8 @@ TARGET_2ND_CPU_VARIANT := generic # DO NOT USE # DO NOT USE else -TARGET_2ND_ARCH_VARIANT := armv7-a-neon -TARGET_2ND_CPU_VARIANT := cortex-a15 +TARGET_2ND_ARCH_VARIANT := armv8-a +TARGET_2ND_CPU_VARIANT := generic endif