From e5d974d67a2560e7c8e9812ad235a58bc3054a6b Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Mon, 17 Sep 2018 15:57:11 -0700 Subject: [PATCH] Link msvcr110.a after mingwex.a Bug: http://b/115909626 Some executables linked with msvcr110.a before mingwex.a loop on start up with the following message: err:ntdll:RtlpWaitForCriticalSection section 0x7fdcb000 "?" wait timed out in thread 0009, blocked by 0000, retrying (60 sec) https://android-review.googlesource.com/c/758688/ has a reproducer. Test: The reproducer above works, and verify that few Windows binaries behave correctly (print help message and such). Change-Id: I837f421532d86f73713d70b3d93609b50d238af9 --- cc/stl.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cc/stl.go b/cc/stl.go index 5c699482b..f44902e0b 100644 --- a/cc/stl.go +++ b/cc/stl.go @@ -213,10 +213,9 @@ func init() { hostDynamicGccLibs = map[android.OsType][]string{ android.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"}, android.Darwin: []string{"-lc", "-lSystem"}, - android.Windows: []string{"-lmsvcr110", "-lmingw32", "-lgcc", "-lmoldname", - "-lmingwex", "-lmsvcrt", "-ladvapi32", "-lshell32", "-luser32", - "-lkernel32", "-lmingw32", "-lgcc", "-lmoldname", "-lmingwex", - "-lmsvcrt"}, + android.Windows: []string{"-lmingw32", "-lgcc", "-lmoldname", "-lmingwex", "-lmsvcr110", + "-lmsvcrt", "-ladvapi32", "-lshell32", "-luser32", "-lkernel32", "-lmingw32", + "-lgcc", "-lmoldname", "-lmingwex", "-lmsvcrt"}, } hostStaticGccLibs = map[android.OsType][]string{ android.Linux: []string{"-Wl,--start-group", "-lgcc", "-lgcc_eh", "-lc", "-Wl,--end-group"},