From 5c8f1b6a4f2610ac7728fbca4a2149ee358406a9 Mon Sep 17 00:00:00 2001 From: angelsl Date: Sat, 31 Oct 2015 01:50:58 +0800 Subject: [PATCH 1/2] Rust: disable emutls on Windows --- make/platform/triple.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/make/platform/triple.mk b/make/platform/triple.mk index 7e3450e395..0d68b2eafd 100644 --- a/make/platform/triple.mk +++ b/make/platform/triple.mk @@ -60,6 +60,12 @@ ifneq (,$(findstring mips,$(TargetTriple))) CommonDisabledFunctions := emutls endif +# Disable emutls on Windows +# emutls works on POSIX only as it uses pthreads +ifneq (,$(findstring windows,$(TargetTriple))) + CommonDisabledFunctions := emutls +endif + # Clear cache is builtin on aarch64-apple-ios # arm64 and aarch64 are synonims, but iOS targets usually use arm64 (history reasons) ifeq (aarch64-apple-ios,$(subst arm64,aarch64,$(TargetTriple))) From 93d0384373750b52996fd7f8249adaae39f562d8 Mon Sep 17 00:00:00 2001 From: angelsl Date: Sat, 31 Oct 2015 02:33:55 +0800 Subject: [PATCH 2/2] Rust: fix MSVC-built lib pulling in other lib files --- lib/builtins/CMakeLists.txt | 9 ++++++++- lib/builtins/int_math.h | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt index 25bd921fcb..571137a0b2 100644 --- a/lib/builtins/CMakeLists.txt +++ b/lib/builtins/CMakeLists.txt @@ -361,11 +361,18 @@ else () endif () endforeach () + # Rust: don't insert a reference to MSVCRT.lib/etc + if (MSVC) + set(_cflags -Zl) + else () + set(_cflags -std=c99) + endif () + add_compiler_rt_runtime(clang_rt.builtins STATIC ARCHS ${arch} SOURCES ${${arch}_SOURCES} - CFLAGS "-std=c99" + CFLAGS ${_cflags} PARENT_TARGET builtins) endif () endforeach () diff --git a/lib/builtins/int_math.h b/lib/builtins/int_math.h index fc81fb7f02..9a8b751e44 100644 --- a/lib/builtins/int_math.h +++ b/lib/builtins/int_math.h @@ -28,7 +28,9 @@ #if defined(_MSC_VER) && !defined(__clang__) #include #include -#include +// Rust: need to upstream this +// don't include ymath.h, it's not needed + pulls in the C++ stdlib for some reason +// #include #endif #if defined(_MSC_VER) && !defined(__clang__)