Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c651ef85 authored by Anton Hansson's avatar Anton Hansson Committed by Gerrit Code Review
Browse files

Merge "Make it an error to specify the wrong ARCH_VARIANT"

parents 67d3081d be1f9cb2
Loading
Loading
Loading
Loading
+13 −20
Original line number Diff line number Diff line
@@ -29,35 +29,28 @@
# 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-a55 cortex-a73 cortex-a75 cortex-a76
KNOWN_ARMv8_CORES += kryo kryo385 exynos-m1 exynos-m2

KNOWN_ARMv82a_CORES := cortex-a55 cortex-a75 kryo385

# Check for cores that implement armv8-2a ISAs.
ifneq (,$(filter $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT), $(KNOWN_ARMv82a_CORES)))
  ifneq ($(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT),armv8-2a)
    $(warning $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT) is armv8-2a.)
    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-2a instead.)
ifeq (,$(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)))
  TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT := generic
endif
    # Overwrite TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT

# This sanity checks TARGET_2ND_ARCH_VARIANT against the lists above.
ifneq (,$(filter $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT), $(KNOWN_ARMv82a_CORES)))
  ifeq (,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT))
    TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv8-2a
  else ifneq (armv8-2a,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT))
    $(error Incorrect TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT, $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT). Use armv8-2a instead.)
  endif
# 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.
else 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
  ifeq (,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT))
    TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv8-a
  else ifneq ($(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT),armv8-a)
    $(error Incorrect TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT, $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT). Use armv8-a instead.)
  endif
endif