Move lld.exe (windows) and add dependent library libwinpthread-1.dll
Move lld.exe to lld-bin directory; add lld-bin/libwinpthread-1.dll; add
trampoline.
Best practice is to ship necessary libraries of expected versions along
with build tools, rather than requiring them to be found elsewhere.
lld.exe depends on libwinpthread-1.dll and windows looks for it in the
same directory as lld.exe. Unfortunately, there's already a 32-bit
libwinpthread-1.dll at the tool root (used by 32-bit executables at
the tool root), and lld.exe is a 64-bit executable, so it needs its own
directory and its own library.
In the old location of lld.exe, we add a trampoline executable (a build
artifact) in lld-bin; this means Gradle, which invokes lld.exe in the old
location, does not have to change.
Bug: 148267171
Bug: 142590626
Bug: 144040336
Test: (gLinux) m TARGET_PRODUCT=sdk_phone_armv7 TARGET_BUILD_VARIANT=userdebug sdk dist sdk_repo
(gLinux) m TARGET_PRODUCT=sdk_phone_armv7 TARGET_BUILD_VARIANT=userdebug win_sdk dist sdk_repo
Merged-In: Ice6710ed204a25d09ac596207c02b8b99ca95b8b
Change-Id: Ice6710ed204a25d09ac596207c02b8b99ca95b8b
(cherry picked from commit 24e52959d723c2b47acc170b0d2784379a6e99c2)
diff --git a/build/sdk-windows-x86.atree b/build/sdk-windows-x86.atree
index 4726aee..f83122a 100644
--- a/build/sdk-windows-x86.atree
+++ b/build/sdk-windows-x86.atree
@@ -142,7 +142,13 @@
rm build-tools/${PLATFORM_NAME}/lld
rm build-tools/${PLATFORM_NAME}/lld-bin/lld
-prebuilts/sdk/tools/windows/bin/lld.exe strip build-tools/${PLATFORM_NAME}/lld.exe
+
+# lld linker trampoline (invokes actual lld linker at lld-bin/lld.exe)
+bin/lld.exe strip build-tools/${PLATFORM_NAME}/lld.exe
+
+# actual lld linker, and dependent library
+prebuilts/sdk/tools/windows/bin/lld.exe strip build-tools/${PLATFORM_NAME}/lld-bin/lld.exe
+prebuilts/sdk/tools/windows/bin/lib64/libwinpthread-1.dll strip build-tools/${PLATFORM_NAME}/lld-bin/libwinpthread-1.dll
dalvik/dx/etc/mainDexClasses.bat build-tools/${PLATFORM_NAME}/mainDexClasses.bat
diff --git a/build/tools/windows_sdk.mk b/build/tools/windows_sdk.mk
index afe21c9..d510851 100644
--- a/build/tools/windows_sdk.mk
+++ b/build/tools/windows_sdk.mk
@@ -35,6 +35,7 @@
fastboot \
hprof-conv \
libaapt2_jni \
+ lld \
llvm-rs-cc \
sqlite3 \
zipalign \