1LOCAL_DIR := $(GET_LOCAL_DIR) 2 3# x86-32 toolchain 4ifeq ($(SUBARCH),x86-32) 5ifndef ARCH_x86_TOOLCHAIN_INCLUDED 6ARCH_x86_TOOLCHAIN_INCLUDED := 1 7 8ifndef ARCH_x86_TOOLCHAIN_PREFIX 9$(error Please run envsetup.sh to set ARCH_x86_TOOLCHAIN_PREFIX) 10endif 11 12endif 13endif 14 15# x86-64 toolchain 16ifeq ($(SUBARCH),x86-64) 17ifndef ARCH_x86_64_TOOLCHAIN_INCLUDED 18ARCH_x86_64_TOOLCHAIN_INCLUDED := 1 19 20ifndef ARCH_x86_64_TOOLCHAIN_PREFIX 21$(error Please run envsetup.sh to set ARCH_x86_64_TOOLCHAIN_PREFIX) 22endif 23 24CLANG_X86_64_TARGET_SYS ?= linux 25CLANG_X86_64_TARGET_ABI ?= gnu 26 27ARCH_x86_COMPILEFLAGS += -target x86_64-$(CLANG_X86_64_TARGET_SYS)-$(CLANG_X86_64_TARGET_ABI) 28 29# Set Rust target to match clang target 30ARCH_x86_SUPPORTS_RUST := true 31ifeq (true,$(call TOBOOL,$(TRUSTY_USERSPACE))) 32ARCH_x86_RUSTFLAGS := --target=x86_64-unknown-trusty 33else 34# Save the path to custom toolchain so Rust targets targets can depend on it 35ARCH_x86_RUST_TARGET := $(LOCAL_DIR)/x86_64-unknown-trusty-kernel.json 36# Use custom toolchain file that disables hardware floating point 37ARCH_x86_RUSTFLAGS := --target=$(ARCH_x86_RUST_TARGET) 38ARCH_x86_SUPPORTS_RUST_CFI := true 39endif 40 41endif 42endif 43 44