[PATCH] D24082: [CMake] Fix libc++abi arm build w/o libunwind.

Logan Chien via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 31 08:39:29 PDT 2016


logan created this revision.
logan added reviewers: mclow.lists, rengolin, EricWF.
logan added a subscriber: cfe-commits.
Herald added subscribers: samparker, rengolin, aemerson.

This commit fixes libc++abi build when LLVM unwinder (libunwind_llvm) is
not enabled.

This commit fixes the problem by removing "LLVM_NATIVE_ARCH MATCHES ARM"
from CMakeLists.txt so that LIBCXXABI_USE_LLVM_UNWINDER will only be
defined when LLVM unwinder is enabled.

We need LIBCXXABI_USE_LLVM_UNWINDER becase there is a subtle difference
between the unwinder from libgcc and the one from libunwind_llvm.  For
the unwinder from libgcc, we have to initialize register r12 with the
address of _Unwind_Control_Block; otherwise,
_Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() won't
work properly.  Consequently, there is an extra _Unwind_SetGR() when
LLVM unwinder is disabled.  Check cxa_personality.cpp for details.

https://reviews.llvm.org/D24082

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -339,7 +339,7 @@
 endif()
 
 # Define LIBCXXABI_USE_LLVM_UNWINDER for conditional compilation.
-if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
+if (LIBCXXABI_USE_LLVM_UNWINDER)
   add_definitions(-DLIBCXXABI_USE_LLVM_UNWINDER=1)
 endif()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24082.69862.patch
Type: text/x-patch
Size: 389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160831/9a38d135/attachment-0001.bin>


More information about the cfe-commits mailing list