edk2: Update CLANG prefix and Android make file
Move target architecture specific configuration to Android make file and
update CLANG prefix for ARM to use GCC bin utilities.
Change-Id: I83c77c3db179bfd703432cc1f0a2370f78b6cef3
diff --git a/AndroidBoot.mk b/AndroidBoot.mk
index 225cf18..87b783d 100644
--- a/AndroidBoot.mk
+++ b/AndroidBoot.mk
@@ -31,6 +31,15 @@
endif
TARGET_ARCHITECTURE := $(BOOTLOADER_ARCH)
+ifeq ($(TARGET_ARCHITECTURE),arm)
+ CLANG35_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION)/bin/arm-linux-androideabi-
+ CLANG35_GCC_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION)
+else
+ CLANG35_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)/bin/aarch64-linux-android-
+ CLANG35_GCC_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)
+endif
+
+
# ABL ELF output
TARGET_ABL := $(PRODUCT_OUT)/abl.elf
TARGET_EMMC_BOOTLOADER := $(TARGET_ABL)
@@ -44,7 +53,16 @@
# Top level target
$(TARGET_ABL): abl_clean | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARGET)
- $(MAKE) -C bootable/bootloader/edk2 BOOTLOADER_OUT=../../../$(ABL_OUT) all $(VERIFIED_BOOT) $(VERIFIED_BOOT_2) $(USER_BUILD_VARIANT) CLANG_BIN=$(CLANG_BIN) TARGET_ARCHITECTURE=$(TARGET_ARCHITECTURE)
+ $(MAKE) -C bootable/bootloader/edk2 \
+ BOOTLOADER_OUT=../../../$(ABL_OUT) \
+ all \
+ $(VERIFIED_BOOT) \
+ $(VERIFIED_BOOT_2) \
+ $(USER_BUILD_VARIANT) \
+ CLANG_BIN=$(CLANG_BIN) \
+ CLANG_PREFIX=$(CLANG35_PREFIX)\
+ CLANG_GCC_TOOLCHAIN=$(CLANG35_GCC_TOOLCHAIN)\
+ TARGET_ARCHITECTURE=$(TARGET_ARCHITECTURE)
.PHONY: abl
diff --git a/Conf/tools_def.txt b/Conf/tools_def.txt
index d8c9f4d..63ca922 100644
--- a/Conf/tools_def.txt
+++ b/Conf/tools_def.txt
@@ -4692,9 +4692,9 @@
##################
*_CLANG35_ARM_SLINK_PATH = ENV(CLANG35_ARM_PREFIX)ar
-*_CLANG35_ARM_DLINK_PATH = ENV(CLANG35_ARM_LINK_PREFIX)ld
-*_CLANG35_ARM_ASLDLINK_PATH = ENV(CLANG35_ARM_PREFIX)link
-*_CLANG35_ARM_RC_PATH = ENV(CLANG35_ARM_PREFIX)elfcopy
+*_CLANG35_ARM_DLINK_PATH = ENV(CLANG35_ARM_PREFIX)ld.bfd
+*_CLANG35_ARM_ASLDLINK_PATH = ENV(CLANG35_ARM_PREFIX)ld.bfd
+*_CLANG35_ARM_RC_PATH = ENV(CLANG35_ARM_PREFIX)objcopy
*_CLANG35_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
*_CLANG35_ARM_ASLDLINK_FLAGS = DEF(QC_GCC_ARM_ASLDLINK_FLAGS)
diff --git a/makefile b/makefile
index 787f377..d75720a 100644
--- a/makefile
+++ b/makefile
@@ -8,26 +8,20 @@
BUILDDIR=$(shell pwd)
export WRAPPER := $(BUILDDIR)/clang-wrapper.py
-ifeq ($(ANDROID_BUILD_TOP),)
-export CLANG35_AARCH64_PREFIX := $(CLANG_PREFIX)
-else
-export CLANG35_AARCH64_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)/bin/aarch64-linux-android-
-export CLANG35_AARCH64_GCC_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)
-endif
export CLANG35_BIN := $(CLANG_BIN)
-export CLANG35_ARM_PREFIX := $(CLANG_BIN)../tools/bin/arm-
-export CLANG35_ARM_LINK_PREFIX := $(CLANG_LINK_PATH)/arm-linux-gnueabihf-
-
-export BUILD_REPORT_DIR := $(BOOTLOADER_OUT)/build_report
-ANDROID_PRODUCT_OUT := $(BOOTLOADER_OUT)/Build
+export CLANG35_GCC_TOOLCHAIN := $(CLANG35_GCC_TOOLCHAIN)
ifeq ($(TARGET_ARCHITECTURE),arm)
export ARCHITECTURE := ARM
+export CLANG35_ARM_PREFIX := $(CLANG_PREFIX)
else
export ARCHITECTURE := AARCH64
-export CLANG35_GCC_TOOLCHAIN := $(CLANG35_AARCH64_GCC_TOOLCHAIN)
+export CLANG35_AARCH64_PREFIX := $(CLANG_PREFIX)
endif
+export BUILD_REPORT_DIR := $(BOOTLOADER_OUT)/build_report
+ANDROID_PRODUCT_OUT := $(BOOTLOADER_OUT)/Build
+
WORKSPACE=$(BUILDDIR)
TARGET_TOOLS := CLANG35
TARGET := DEBUG