From 7bd4c5c339506c0ba5a64f525705542a0141f54e Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Thu, 23 Feb 2017 17:52:24 -0800 Subject: [PATCH] Add libwinpthread, link it into win32 binaries. Bug: http://b/31665213 Test: wine adb.exe Test: wine fastboot.exe Change-Id: I6d6ff69f0c016e2654119a09161685841cbccc7e --- Android.bp | 11 +++++++++++ cc/linker.go | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/Android.bp b/Android.bp index 74da7c182..c6b6ee4d7 100644 --- a/Android.bp +++ b/Android.bp @@ -245,6 +245,17 @@ toolchain_library { }, } +toolchain_library { + name: "libwinpthread", + host_supported: true, + enabled: false, + target: { + windows: { + enabled: true + }, + }, +} + toolchain_library { name: "libgcov", defaults: ["linux_bionic_supported"], diff --git a/cc/linker.go b/cc/linker.go index 461992690..07d9aa802 100644 --- a/cc/linker.go +++ b/cc/linker.go @@ -156,6 +156,10 @@ func (linker *baseLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { } } + if ctx.Os() == android.Windows { + deps.LateStaticLibs = append(deps.LateStaticLibs, "libwinpthread") + } + return deps }