Statically link libwinpthread into windows binaries.

Statically link libwinpthread.a, so that we don't have to ship a
libwinpthread dll with all of our windows exectuables.

Bug: http://b/31665213
Test: wine adb.exe
Test: wine fastboot.exe
Change-Id: I96414e980d8894f8f6a58c1c7bbd9dc5e0f5169c
diff --git a/core/binary.mk b/core/binary.mk
index 44f0e95..f5d9bfc 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -473,6 +473,11 @@
 endif
 endif
 
+# Statically link libwinpthread when cross compiling win32.
+ifeq ($($(my_prefix)OS),windows)
+  my_static_libraries += libwinpthread
+endif
+
 ifneq ($(filter ../%,$(my_src_files)),)
 my_soong_problems += dotdot_srcs
 endif