From 0ce2f55a898be663c01c34494b8e08d89cc9b9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 4 Dec 2017 14:29:42 +0200 Subject: [PATCH] Use native TLS on all architectures except aarch64 Update mingw-w64 to the latest version, where native TLS works with LLVM/LLD. --- Dockerfile | 2 +- wrappers/clang-target-wrapper | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a5bcee..2e831f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN cd llvm && mkdir build && cd build && cmake \ RUN git clone git://git.code.sf.net/p/mingw-w64/mingw-w64 && \ cd mingw-w64 && \ - git checkout 124a62c7cc32909b7c6c57e901579de48e3a35d8 + git checkout f25c9a89ed2b2d98bc2658cfa4dc97a2c837c725 ENV TOOLCHAIN_PREFIX=/build/prefix diff --git a/wrappers/clang-target-wrapper b/wrappers/clang-target-wrapper index 9caebec..cc75157 100755 --- a/wrappers/clang-target-wrapper +++ b/wrappers/clang-target-wrapper @@ -9,16 +9,21 @@ i686) # Dwarf is the default for i686, but currently there's an issue # in libunwind with unwinding clang generated dwarf opcodes on 32 bit # x86, pending resolution at https://reviews.llvm.org/D38680. - EH_FLAG=-fsjlj-exceptions - ;; -armv7|aarch64) - # Dwarf is the default for these targets. - EH_FLAG= + ARCH_FLAGS=-fsjlj-exceptions ;; x86_64) # Explicitly request dwarf on x86_64; SEH is the default there but # libcxxabi lacks support for it. - EH_FLAG=-fdwarf-exceptions + ARCH_FLAGS=-fdwarf-exceptions + ;; +armv7) + # Dwarf is the default here. + ARCH_FLAGS= + ;; +aarch64) + # Dwarf is the default on aarch64; enable emulated TLS since native + # TLS isn't implemented yet. + ARCH_FLAGS=-femulated-tls ;; esac -$DIR/$EXE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $EH_FLAG -Qunused-arguments -femulated-tls "$@" +$DIR/$EXE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $ARCH_FLAGS -Qunused-arguments "$@"