summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-11-06 13:25:05 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-11-06 13:25:05 +0000
commita6f123741bc4fb9793fe46ed3d7cc89f612c69fd (patch)
treebec8581e1e0794b8383b1dce67d9a112d3853933
parent6c51d6e82092ab1541a732a75c5017d2d8b93af0 (diff)
downloadcompiler-rt-a6f123741bc4fb9793fe46ed3d7cc89f612c69fd.tar.gz
tsan: add missing function for windows
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@167454 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/tsan/go/tsan_go.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/tsan/go/tsan_go.cc b/lib/tsan/go/tsan_go.cc
index eca6cae4e..ccedc64cd 100644
--- a/lib/tsan/go/tsan_go.cc
+++ b/lib/tsan/go/tsan_go.cc
@@ -191,5 +191,39 @@ void __tsan_finalizer_goroutine(int goid) {
ThreadFinalizerGoroutine(thr);
}
+#ifdef _WIN32
+// MinGW gcc emits calls to the function.
+void ___chkstk_ms(void) {
+// The implementation must be along the lines of:
+// .code64
+// PUBLIC ___chkstk_ms
+// //cfi_startproc()
+// ___chkstk_ms:
+// push rcx
+// //cfi_push(%rcx)
+// push rax
+// //cfi_push(%rax)
+// cmp rax, PAGE_SIZE
+// lea rcx, [rsp + 24]
+// jb l_LessThanAPage
+// .l_MoreThanAPage:
+// sub rcx, PAGE_SIZE
+// or rcx, 0
+// sub rax, PAGE_SIZE
+// cmp rax, PAGE_SIZE
+// ja l_MoreThanAPage
+// .l_LessThanAPage:
+// sub rcx, rax
+// or [rcx], 0
+// pop rax
+// //cfi_pop(%rax)
+// pop rcx
+// //cfi_pop(%rcx)
+// ret
+// //cfi_endproc()
+// END
+}
+#endif
+
} // extern "C"
} // namespace __tsan