From 7f5d4e1050da45a714c718d980c2d4bf542ea4dd Mon Sep 17 00:00:00 2001 From: Pengxuan Zheng Date: Mon, 8 May 2017 16:49:49 -0700 Subject: [PATCH] Add support for using the secondary SDLLVM toolchain If LOCAL_SDCLANG_2 is set to true, the secondary SDLLVM toolchain (SDCLANG_PATH_2) will be used instead. Change-Id: Icb7492562aeaa3c584edcbced8fe1e98776774bd --- build/core/sdllvm-lto-defs.mk | 5 +++++ build/envsetup.sh | 1 + 2 files changed, 6 insertions(+) diff --git a/build/core/sdllvm-lto-defs.mk b/build/core/sdllvm-lto-defs.mk index 74fa49dc..f965dd83 100644 --- a/build/core/sdllvm-lto-defs.mk +++ b/build/core/sdllvm-lto-defs.mk @@ -2,6 +2,11 @@ ifeq ($(LOCAL_MODULE_CLASS), STATIC_LIBRARIES) # For STATIC_LIBRARIES we need to use SD LLVM's archiver and archiver flags. AR := $(SDCLANG_PATH)/llvm-ar + +ifeq ($(LOCAL_SDCLANG_2),true) +AR := $(SDCLANG_PATH_2)/llvm-ar +endif + ARFLAGS := crsD # For 32 bit diff --git a/build/envsetup.sh b/build/envsetup.sh index 5ad75f77..ef2e7c67 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -953,6 +953,7 @@ if [ -d $(gettop)/prebuilts/snapdragon-llvm/toolchains ]; then *) export SDCLANG=true export SDCLANG_PATH=$(gettop)/prebuilts/snapdragon-llvm/toolchains/llvm-Snapdragon_LLVM_for_Android_3.8/prebuilt/linux-x86_64/bin + export SDCLANG_PATH_2=$(gettop)/prebuilts/snapdragon-llvm/toolchains/llvm-Snapdragon_LLVM_for_Android_3.8/prebuilt/linux-x86_64/bin export SDCLANG_LTO_DEFS=$(gettop)/vendor/lineage/build/core/sdllvm-lto-defs.mk ;; esac