From a3324bfb074c6fd452977fa80037e80e7d8ae573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 29 Nov 2017 11:05:14 +0200 Subject: [PATCH] Use dwarf exceptions on x86_64 as well SEH is the default on x86_64, but libcxxabi lacks support for it. --- wrappers/clang-target-wrapper | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wrappers/clang-target-wrapper b/wrappers/clang-target-wrapper index 15dc12a..c2e9b28 100755 --- a/wrappers/clang-target-wrapper +++ b/wrappers/clang-target-wrapper @@ -5,11 +5,20 @@ 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) +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= ;; +x86_64) + # Explicitly request dwarf on x86_64; SEH is the default there but + # libcxxabi lacks support for it. + EH_FLAG=-fdwarf-exceptions + ;; esac $DIR/$EXE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $EH_FLAG -Qunused-arguments "$@"