Use dwarf exceptions on armv7 and aarch64
Dwarf is also the default in clang on i686, but libunwind currently has an issue relating to unwinding dwarf exceptions on i686 on windows (and less easily reproducible on other platforms), see https://reviews.llvm.org/D38680. This enables exceptions on aarch64, where they previously were avoided/disabled. When linking to a statically linked libunwind with support for dwarf, one (currently) has to link in -lpsapi.
This commit is contained in:
1 parent
a30166a84f
commit
03f1fd6c65
3 files changed
+9
-24
No files matched your search
+6
-18
@@ -159,12 +159,6 @@ RUN git clone -b master https://github.com/llvm-mirror/libcxx.git && \
|
||||
|
||||
RUN cd libcxxabi && \
|
||||
for arch in armv7 aarch64 i686 x86_64; do \
|
||||
EXCEPTIONS=ON && \
|
||||
case $arch in \
|
||||
aarch64) \
|
||||
EXCEPTIONS=OFF \
|
||||
;; \
|
||||
esac && \
|
||||
mkdir build-$arch && cd build-$arch && cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=$TOOLCHAIN_PREFIX/$arch-w64-mingw32 \
|
||||
@@ -177,7 +171,7 @@ RUN cd libcxxabi && \
|
||||
-DCMAKE_AR=$TOOLCHAIN_PREFIX/bin/llvm-ar \
|
||||
-DCMAKE_RANLIB=$TOOLCHAIN_PREFIX/bin/llvm-ranlib \
|
||||
-DLIBCXXABI_USE_COMPILER_RT=ON \
|
||||
-DLIBCXXABI_ENABLE_EXCEPTIONS=$EXCEPTIONS \
|
||||
-DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
|
||||
-DLIBCXXABI_ENABLE_THREADS=ON \
|
||||
-DLIBCXXABI_TARGET_TRIPLE=$arch-w64-mingw32 \
|
||||
-DLIBCXXABI_ENABLE_SHARED=OFF \
|
||||
@@ -192,12 +186,6 @@ RUN cd libcxxabi && \
|
||||
|
||||
RUN cd libcxx && \
|
||||
for arch in armv7 aarch64 i686 x86_64; do \
|
||||
EXCEPTIONS=ON && \
|
||||
case $arch in \
|
||||
aarch64) \
|
||||
EXCEPTIONS=OFF \
|
||||
;; \
|
||||
esac && \
|
||||
mkdir build-$arch && cd build-$arch && cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=$TOOLCHAIN_PREFIX/$arch-w64-mingw32 \
|
||||
@@ -211,7 +199,7 @@ RUN cd libcxx && \
|
||||
-DCMAKE_RANLIB=$TOOLCHAIN_PREFIX/bin/llvm-ranlib \
|
||||
-DLIBCXX_USE_COMPILER_RT=ON \
|
||||
-DLIBCXX_INSTALL_HEADERS=ON \
|
||||
-DLIBCXX_ENABLE_EXCEPTIONS=$EXCEPTIONS \
|
||||
-DLIBCXX_ENABLE_EXCEPTIONS=ON \
|
||||
-DLIBCXX_ENABLE_THREADS=ON \
|
||||
-DLIBCXX_ENABLE_MONOTONIC_CLOCK=ON \
|
||||
-DLIBCXX_ENABLE_SHARED=OFF \
|
||||
@@ -232,7 +220,7 @@ RUN cd libcxx && \
|
||||
RUN cd $TOOLCHAIN_PREFIX/include && ln -s ../armv7-w64-mingw32/include/c++ .
|
||||
|
||||
RUN cd libunwind && \
|
||||
for arch in armv7 i686 x86_64; do \
|
||||
for arch in armv7 aarch64 i686 x86_64; do \
|
||||
mkdir build-$arch && cd build-$arch && cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=$TOOLCHAIN_PREFIX/$arch-w64-mingw32 \
|
||||
@@ -268,12 +256,12 @@ RUN cd hello && \
|
||||
|
||||
RUN cd hello && \
|
||||
for arch in armv7 aarch64 x86_64 i686; do \
|
||||
$arch-w64-mingw32-clang++ hello.cpp -o hello-cpp-$arch.exe -fno-exceptions || exit 1; \
|
||||
$arch-w64-mingw32-clang++ hello.cpp -o hello-cpp-$arch.exe -fno-exceptions -lpsapi || exit 1; \
|
||||
done
|
||||
|
||||
RUN cd hello && \
|
||||
for arch in armv7 x86_64 i686; do \
|
||||
$arch-w64-mingw32-clang++ hello-exception.cpp -o hello-exception-$arch.exe || exit 1; \
|
||||
for arch in armv7 aarch64 x86_64 i686; do \
|
||||
$arch-w64-mingw32-clang++ hello-exception.cpp -o hello-exception-$arch.exe -lpsapi || exit 1; \
|
||||
done
|
||||
|
||||
ENV AR=llvm-ar
|
||||
|
||||
@@ -68,9 +68,6 @@ normal GCC/binutils based MinGW.
|
||||
the dllimport attributes.
|
||||
- The C++ libraries ([libcxxabi](http://libcxxabi.llvm.org/), [libcxx](http://libcxx.llvm.org/)) can only be linked statically
|
||||
at the moment.
|
||||
- The C++ libraries and unwinder aren't built with exceptions support for
|
||||
ARM64 target at the moment. (The toolchain and libraries themselves do
|
||||
support it though.)
|
||||
- The ARM64 target doesn't support thread local variables.
|
||||
|
||||
Additionally, one may run into other minor differences between GCC and clang.
|
||||
|
||||
@@ -5,11 +5,11 @@ EXE=$(basename $0 | sed 's/.*-\(clang.*\)/\1/')
|
||||
# We could set these defaults in the clang frontend driver, but that's not yet merged upstream
|
||||
ARCH=$(echo $TARGET | sed 's/-.*//')
|
||||
case $ARCH in
|
||||
i686|x86_64|armv7)
|
||||
i686|x86_64)
|
||||
EH_FLAG=-fsjlj-exceptions
|
||||
;;
|
||||
aarch64)
|
||||
EH_FLAG=-fno-exceptions
|
||||
armv7|aarch64)
|
||||
EH_FLAG=
|
||||
;;
|
||||
esac
|
||||
$DIR/$EXE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $EH_FLAG -Qunused-arguments "$@"
|
||||
Reference in new issue
Block a user