1LOCAL_DIR := $(GET_LOCAL_DIR) 2 3ifndef ARCH_arm64_TOOLCHAIN_PREFIX 4$(error Please run envsetup.sh to set ARCH_arm64_TOOLCHAIN_PREFIX) 5endif 6 7ifeq (false,$(call TOBOOL,$(ALLOW_FP_USE))) 8ARCH_arm64_COMPILEFLAGS := -mgeneral-regs-only -DWITH_NO_FP=1 9else 10ARCH_arm64_COMPILEFLAGS := 11endif 12 13ARCH_arm64_SUPPORTS_BTI := true 14ARCH_arm64_SUPPORTS_PAC := true 15ARCH_arm64_SUPPORTS_SCS := true 16ARCH_arm64_DEFAULT_USER_SHADOW_STACK_SIZE ?= $(ARCH_DEFAULT_SHADOW_STACK_SIZE) 17ifeq (true,$(call TOBOOL,$(SCS_ENABLED))) 18# architecture-specific flag required for shadow call stack 19ARCH_arm64_COMPILEFLAGS += -ffixed-x18 20endif 21 22# PLATFORM_arm64_COMPILEFLAGS allows platform to define additional global 23# compile flags that it will be using. 24ARCH_arm64_COMPILEFLAGS += $(PLATFORM_arm64_COMPILEFLAGS) 25 26CLANG_ARM64_TARGET_SYS ?= linux 27CLANG_ARM64_TARGET_ABI ?= gnu 28 29ARCH_arm64_COMPILEFLAGS += -target aarch64-$(CLANG_ARM64_TARGET_SYS)-$(CLANG_ARM64_TARGET_ABI) 30 31# Set Rust target to match clang target 32ARCH_arm64_SUPPORTS_RUST := true 33ifeq (true,$(call TOBOOL,$(TRUSTY_USERSPACE))) 34ARCH_arm64_RUSTFLAGS := --target=aarch64-unknown-trusty 35else 36# Save the path to custom toolchain so Rust targets targets can depend on it 37ARCH_arm64_RUST_TARGET := $(LOCAL_DIR)/aarch64-unknown-trusty-kernel.json 38ARCH_arm64_RUSTFLAGS := --target=$(ARCH_arm64_RUST_TARGET) 39ARCH_arm64_SUPPORTS_RUST_CFI := true 40endif 41