Add libwinpthread, link it into win32 binaries.
Bug: http://b/31665213
Test: wine adb.exe
Test: wine fastboot.exe
Change-Id: I6d6ff69f0c016e2654119a09161685841cbccc7e
diff --git a/Android.bp b/Android.bp
index 74da7c1..c6b6ee4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -246,6 +246,17 @@
}
toolchain_library {
+ name: "libwinpthread",
+ host_supported: true,
+ enabled: false,
+ target: {
+ windows: {
+ enabled: true
+ },
+ },
+}
+
+toolchain_library {
name: "libgcov",
defaults: ["linux_bionic_supported"],
arch: {
diff --git a/cc/linker.go b/cc/linker.go
index 4619926..07d9aa8 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -156,6 +156,10 @@
}
}
+ if ctx.Os() == android.Windows {
+ deps.LateStaticLibs = append(deps.LateStaticLibs, "libwinpthread")
+ }
+
return deps
}