[PATCH] D59513: [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms
Louis Dionne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 25 07:55:23 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL356903: [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms (authored by ldionne, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D59513?vs=191172&id=192107#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59513/new/
https://reviews.llvm.org/D59513
Files:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/lib/CMakeLists.txt
libcxx/trunk/utils/merge_archives.py
Index: libcxx/trunk/CMakeLists.txt
===================================================================
--- libcxx/trunk/CMakeLists.txt
+++ libcxx/trunk/CMakeLists.txt
@@ -359,13 +359,9 @@
message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not supported on this platform.")
endif()
-# Check that this option is not enabled on Apple and emit a usage warning.
+# Warn users that LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option.
if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
- if (APPLE)
- message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is not supported on OS X")
- else()
- message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option")
- endif()
+ message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option")
if (LIBCXX_ENABLE_STATIC AND NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY requires python but it was not found.")
endif()
Index: libcxx/trunk/lib/CMakeLists.txt
===================================================================
--- libcxx/trunk/lib/CMakeLists.txt
+++ libcxx/trunk/lib/CMakeLists.txt
@@ -52,14 +52,19 @@
add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
- LIBCXX_CXX_ABI_LIBNAME STREQUAL "default"))
+ LIBCXX_CXX_ABI_LIBNAME STREQUAL "default")
+ AND NOT DEFINED LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
set(LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS ON)
endif()
if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
- add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
- add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
- add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
+ if (APPLE)
+ add_library_flags("-Wl,-force_load" "${LIBCXX_CXX_ABI_LIBRARY}")
+ else()
+ add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
+ add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
+ add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
+ endif()
elseif (LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
else ()
Index: libcxx/trunk/utils/merge_archives.py
===================================================================
--- libcxx/trunk/utils/merge_archives.py
+++ libcxx/trunk/utils/merge_archives.py
@@ -127,7 +127,7 @@
out = execute_command_verbose([ar_exe, 't', arc])
files.extend(out.splitlines())
- execute_command_verbose([ar_exe, 'rcsD', args.output] + files,
+ execute_command_verbose([ar_exe, 'rcs', args.output] + files,
cwd=temp_directory_root, verbose=args.verbose)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59513.192107.patch
Type: text/x-patch
Size: 2657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190325/167eabab/attachment.bin>
More information about the llvm-commits
mailing list