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 }