Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2006 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
The Android Open Source Project | b6c1cf6 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 17 | # Configuration for Linux on ARM. |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 18 | # Included by combo/select.mk |
The Android Open Source Project | b6c1cf6 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 19 | |
David 'Digit' Turner | d53c81d | 2009-05-29 15:34:02 +0200 | [diff] [blame] | 20 | # You can set TARGET_ARCH_VARIANT to use an arch version other |
| 21 | # than ARMv5TE. Each value should correspond to a file named |
| 22 | # $(BUILD_COMBOS)/arch/<name>.mk which must contain |
Elliott Hughes | 4314611 | 2015-08-28 10:31:28 -0700 | [diff] [blame] | 23 | # makefile variable definitions. Their |
David 'Digit' Turner | d53c81d | 2009-05-29 15:34:02 +0200 | [diff] [blame] | 24 | # purpose is to allow module Android.mk files to selectively compile |
| 25 | # different versions of code based upon the funtionality and |
Ben Leslie | e03f023 | 2008-10-30 10:41:09 -0500 | [diff] [blame] | 26 | # instructions available in a given architecture version. |
| 27 | # |
David 'Digit' Turner | d53c81d | 2009-05-29 15:34:02 +0200 | [diff] [blame] | 28 | # The blocks also define specific arch_variant_cflags, which |
Ben Leslie | e03f023 | 2008-10-30 10:41:09 -0500 | [diff] [blame] | 29 | # include defines, and compiler settings for the given architecture |
| 30 | # version. |
| 31 | # |
Isaac Chen | f5af850 | 2017-08-23 10:58:57 +0000 | [diff] [blame] | 32 | ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)),) |
| 33 | TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT := generic |
| 34 | endif |
| 35 | |
Haibo Huang | e211f7c | 2018-10-10 14:33:13 -0700 | [diff] [blame] | 36 | KNOWN_ARMv8_CORES := cortex-a53 cortex-a53.a57 cortex-a55 cortex-a73 cortex-a75 cortex-a76 |
Isaac Chen | f5af850 | 2017-08-23 10:58:57 +0000 | [diff] [blame] | 37 | KNOWN_ARMv8_CORES += kryo denver64 exynos-m1 exynos-m2 |
| 38 | |
Isaac Lee | ead02eb | 2018-11-13 17:31:28 +0800 | [diff] [blame^] | 39 | KNOWN_ARMv82a_CORES := cortex-a55 cortex-a75 |
| 40 | |
| 41 | # Check for cores that implement armv8-2a ISAs. |
| 42 | ifneq (,$(filter $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT), $(KNOWN_ARMv82a_CORES))) |
| 43 | ifneq ($(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT),armv8-2a) |
| 44 | $(warning $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT) is armv8-2a.) |
| 45 | ifneq (,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)) |
| 46 | $(warning TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT, $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT), ignored! Use armv8-2a instead.) |
| 47 | endif |
| 48 | # Overwrite TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT |
| 49 | TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv8-2a |
| 50 | endif |
Isaac Chen | f5af850 | 2017-08-23 10:58:57 +0000 | [diff] [blame] | 51 | # Many devices (incorrectly) use armv7-a-neon as the 2nd architecture variant |
| 52 | # for cores that implement armv8-a ISAs. The following sets it to armv8-a. |
Isaac Lee | ead02eb | 2018-11-13 17:31:28 +0800 | [diff] [blame^] | 53 | else ifneq (,$(filter $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT), $(KNOWN_ARMv8_CORES))) |
Isaac Chen | f5af850 | 2017-08-23 10:58:57 +0000 | [diff] [blame] | 54 | ifneq ($(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT),armv8-a) |
| 55 | $(warning $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT) is armv8-a.) |
| 56 | ifneq (,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)) |
| 57 | $(warning TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT, $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT), ignored! Use armv8-a instead.) |
| 58 | endif |
| 59 | # Overwrite TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT |
| 60 | TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv8-a |
| 61 | endif |
| 62 | endif |
| 63 | |
Ying Wang | e1d44c3 | 2013-12-27 11:09:36 -0800 | [diff] [blame] | 64 | ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)),) |
Dan Willemsen | dd3a273 | 2018-01-08 15:26:16 -0800 | [diff] [blame] | 65 | $(error TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT must be set) |
Ben Leslie | e03f023 | 2008-10-30 10:41:09 -0500 | [diff] [blame] | 66 | endif |
David 'Digit' Turner | d53c81d | 2009-05-29 15:34:02 +0200 | [diff] [blame] | 67 | |
Ying Wang | e1d44c3 | 2013-12-27 11:09:36 -0800 | [diff] [blame] | 68 | TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_$(combo_2nd_arch_prefix)ARCH)/$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT).mk |
David 'Digit' Turner | d53c81d | 2009-05-29 15:34:02 +0200 | [diff] [blame] | 69 | ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) |
Ying Wang | e1d44c3 | 2013-12-27 11:09:36 -0800 | [diff] [blame] | 70 | $(error Unknown ARM architecture version: $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)) |
Andy McFadden | 8f51a2a | 2009-05-28 12:47:23 -0700 | [diff] [blame] | 71 | endif |
Ben Leslie | e03f023 | 2008-10-30 10:41:09 -0500 | [diff] [blame] | 72 | |
David 'Digit' Turner | d53c81d | 2009-05-29 15:34:02 +0200 | [diff] [blame] | 73 | include $(TARGET_ARCH_SPECIFIC_MAKEFILE) |
Dehao Chen | 25671e1 | 2014-07-23 14:28:58 -0700 | [diff] [blame] | 74 | include $(BUILD_SYSTEM)/combo/fdo.mk |
David 'Digit' Turner | d53c81d | 2009-05-29 15:34:02 +0200 | [diff] [blame] | 75 | |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 76 | define $(combo_var_prefix)transform-shared-lib-to-toc |
| 77 | $(call _gen_toc_command_for_elf,$(1),$(2)) |
| 78 | endef |
The Android Open Source Project | b6c1cf6 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 79 | |
Dmitriy Ivanov | 4c2d1a6 | 2015-04-20 16:59:05 -0700 | [diff] [blame] | 80 | $(combo_2nd_arch_prefix)TARGET_PACK_MODULE_RELOCATIONS := true |
Dimitry Ivanov | 1eca10f | 2015-04-23 04:22:33 +0000 | [diff] [blame] | 81 | |
Dan Albert | e088c0d | 2014-11-13 10:15:46 -0800 | [diff] [blame] | 82 | $(combo_2nd_arch_prefix)TARGET_LINKER := /system/bin/linker |