blob: cbca1fbfab8651595acd914dc3b9b6fb0c6352df [file] [log] [blame]
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -08001#
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 Projectb6c1cf62008-10-21 07:00:00 -070017# Configuration for Linux on ARM.
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080018# Included by combo/select.mk
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -070019
David 'Digit' Turnerd53c81d2009-05-29 15:34:02 +020020# 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 Hughes43146112015-08-28 10:31:28 -070023# makefile variable definitions. Their
David 'Digit' Turnerd53c81d2009-05-29 15:34:02 +020024# purpose is to allow module Android.mk files to selectively compile
25# different versions of code based upon the funtionality and
Ben Lesliee03f0232008-10-30 10:41:09 -050026# instructions available in a given architecture version.
27#
David 'Digit' Turnerd53c81d2009-05-29 15:34:02 +020028# The blocks also define specific arch_variant_cflags, which
Ben Lesliee03f0232008-10-30 10:41:09 -050029# include defines, and compiler settings for the given architecture
30# version.
31#
Isaac Chenf5af8502017-08-23 10:58:57 +000032
Haibo Huange211f7c2018-10-10 14:33:13 -070033KNOWN_ARMv8_CORES := cortex-a53 cortex-a53.a57 cortex-a55 cortex-a73 cortex-a75 cortex-a76
Artem Serovf7dccc62018-11-22 19:55:32 +000034KNOWN_ARMv8_CORES += kryo kryo385 exynos-m1 exynos-m2
Isaac Chenf5af8502017-08-23 10:58:57 +000035
Artem Serovf7dccc62018-11-22 19:55:32 +000036KNOWN_ARMv82a_CORES := cortex-a55 cortex-a75 kryo385
Isaac Leeead02eb2018-11-13 17:31:28 +080037
Anton Hanssonbe1f9cb2019-02-27 17:23:40 +000038ifeq (,$(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)))
39 TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT := generic
40endif
41
42# This sanity checks TARGET_2ND_ARCH_VARIANT against the lists above.
Isaac Leeead02eb2018-11-13 17:31:28 +080043ifneq (,$(filter $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT), $(KNOWN_ARMv82a_CORES)))
Anton Hanssonbe1f9cb2019-02-27 17:23:40 +000044 ifeq (,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT))
Isaac Leeead02eb2018-11-13 17:31:28 +080045 TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv8-2a
Anton Hanssonbe1f9cb2019-02-27 17:23:40 +000046 else ifneq (armv8-2a,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT))
47 $(error Incorrect TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT, $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT). Use armv8-2a instead.)
Isaac Leeead02eb2018-11-13 17:31:28 +080048 endif
Isaac Leeead02eb2018-11-13 17:31:28 +080049else ifneq (,$(filter $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT), $(KNOWN_ARMv8_CORES)))
Anton Hanssonbe1f9cb2019-02-27 17:23:40 +000050 ifeq (,$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT))
Isaac Chenf5af8502017-08-23 10:58:57 +000051 TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv8-a
Anton Hanssonbe1f9cb2019-02-27 17:23:40 +000052 else ifneq ($(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT),armv8-a)
53 $(error Incorrect TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT, $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT). Use armv8-a instead.)
Isaac Chenf5af8502017-08-23 10:58:57 +000054 endif
55endif
56
Ying Wange1d44c32013-12-27 11:09:36 -080057ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)),)
Anton Hanssonbe1f9cb2019-02-27 17:23:40 +000058 $(error TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT must be set)
Ben Lesliee03f0232008-10-30 10:41:09 -050059endif
David 'Digit' Turnerd53c81d2009-05-29 15:34:02 +020060
Ying Wange1d44c32013-12-27 11:09:36 -080061TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_$(combo_2nd_arch_prefix)ARCH)/$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT).mk
David 'Digit' Turnerd53c81d2009-05-29 15:34:02 +020062ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),)
Anton Hanssonbe1f9cb2019-02-27 17:23:40 +000063 $(error Unknown ARM architecture version: $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT))
Andy McFadden8f51a2a2009-05-28 12:47:23 -070064endif
Ben Lesliee03f0232008-10-30 10:41:09 -050065
David 'Digit' Turnerd53c81d2009-05-29 15:34:02 +020066include $(TARGET_ARCH_SPECIFIC_MAKEFILE)
Dehao Chen25671e12014-07-23 14:28:58 -070067include $(BUILD_SYSTEM)/combo/fdo.mk
David 'Digit' Turnerd53c81d2009-05-29 15:34:02 +020068
Shinichiro Hamaji0e7587a2015-10-09 14:36:04 +090069define $(combo_var_prefix)transform-shared-lib-to-toc
70$(call _gen_toc_command_for_elf,$(1),$(2))
71endef
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -070072
Dmitriy Ivanov4c2d1a62015-04-20 16:59:05 -070073$(combo_2nd_arch_prefix)TARGET_PACK_MODULE_RELOCATIONS := true
Dimitry Ivanov1eca10f2015-04-23 04:22:33 +000074
Dan Alberte088c0d2014-11-13 10:15:46 -080075$(combo_2nd_arch_prefix)TARGET_LINKER := /system/bin/linker