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
diff --git a/build/core/sdllvm-lto-defs.mk b/build/core/sdllvm-lto-defs.mk
index 74fa49d..f965dd8 100644
--- a/build/core/sdllvm-lto-defs.mk
+++ b/build/core/sdllvm-lto-defs.mk
@@ -2,6 +2,11 @@
 # 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 5ad75f7..ef2e7c6 100644
--- a/build/envsetup.sh
+++ b/build/envsetup.sh
@@ -953,6 +953,7 @@
         *)
             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