[PATCH] D24083: [CMake] Fix libc++abi __aeabi_idiv() link error.
Logan Chien via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 31 08:40:09 PDT 2016
logan created this revision.
logan added reviewers: mclow.lists, rengolin, EricWF.
logan added a subscriber: cfe-commits.
Herald added a subscriber: aemerson.
This commit fixes __aeabi_idiv() link error when we are building
libc++abi with compiler-rt.
When compiler-rt is enabled, the option `--rtlib=compiler-rt` will be
added to link flags. However, if `-nodefaultlibs` is specified
simultaneously, `--rtlib` will be ignored and compiler-rt libraries will
not be linked. Consequently, several ARM built-in functions, e.g.
__aeabi_idiv(), will not be available.
https://reviews.llvm.org/D24083
Files:
src/CMakeLists.txt
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -70,7 +70,9 @@
# Setup flags.
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_FPIC_FLAG -fPIC)
-append_if(LIBCXXABI_LINK_FLAGS LIBCXXABI_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
+if (NOT LIBCXXABI_USE_COMPILER_RT)
+ append_if(LIBCXXABI_LINK_FLAGS LIBCXXABI_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
+endif()
set(LIBCXXABI_SHARED_LINK_FLAGS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24083.69864.patch
Type: text/x-patch
Size: 489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160831/16ae6a4e/attachment.bin>
More information about the cfe-commits
mailing list