[libcxx-commits] [libcxxabi] r355241 - [libc++abi] Specify unwind lib before other system libraries when linking
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 1 14:55:16 PST 2019
Author: ldionne
Date: Fri Mar 1 14:55:15 2019
New Revision: 355241
URL: http://llvm.org/viewvc/llvm-project?rev=355241&view=rev
Log:
[libc++abi] Specify unwind lib before other system libraries when linking
This matters on OSX because static linking orders is also the order dyld
uses to search for libs (the default - Two-level namespace). If system
libs (including unwind lib) are specified before local unwind lib, local
unwind lib would never be picked up by dyld.
Before:
$ otool -L lib/libc++abi.dylib
@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
@rpath/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)
After:
$ otool -L lib/libc++abi.dylib
@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
@rpath/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
Thanks to Yuanfang Chen for the patch.
Differential Revision: https://reviews.llvm.org/D57496
Modified:
libcxxabi/trunk/src/CMakeLists.txt
Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=355241&r1=355240&r2=355241&view=diff
==============================================================================
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Fri Mar 1 14:55:15 2019
@@ -189,7 +189,7 @@ if (LIBCXXABI_ENABLE_SHARED)
if(COMMAND llvm_setup_rpath)
llvm_setup_rpath(cxxabi_shared)
endif()
- target_link_libraries(cxxabi_shared PRIVATE ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_SHARED_LIBRARIES})
+ target_link_libraries(cxxabi_shared PRIVATE ${LIBCXXABI_SHARED_LIBRARIES} ${LIBCXXABI_LIBRARIES})
set_target_properties(cxxabi_shared
PROPERTIES
CXX_EXTENSIONS
@@ -226,7 +226,7 @@ if (LIBCXXABI_ENABLE_STATIC)
endif()
endif()
add_library(cxxabi_static STATIC ${cxxabi_static_sources})
- target_link_libraries(cxxabi_static PRIVATE ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_STATIC_LIBRARIES})
+ target_link_libraries(cxxabi_static PRIVATE ${LIBCXXABI_STATIC_LIBRARIES} ${LIBCXXABI_LIBRARIES})
set_target_properties(cxxabi_static
PROPERTIES
CXX_EXTENSIONS
More information about the libcxx-commits
mailing list