diff options
| author | Petr Hosek <phosek@chromium.org> | 2019-06-02 01:14:31 +0000 |
|---|---|---|
| committer | Petr Hosek <phosek@chromium.org> | 2019-06-02 01:14:31 +0000 |
| commit | 737de4d363ede4b90dd5609af0494fb39af53865 (patch) | |
| tree | 6287ff3064181d33b26508765285564b90f1e4fb /libcxx/src | |
| parent | fe699c32a2081bde203e99593ed906fce651b3dd (diff) | |
| download | bcm5719-llvm-737de4d363ede4b90dd5609af0494fb39af53865.tar.gz bcm5719-llvm-737de4d363ede4b90dd5609af0494fb39af53865.zip | |
[libcxx] Use libtool when merging archives on Apple platforms
ar doesn't produce the correct results when used for linking static
archives on Apple platforms, so instead use libtool -static which is
the official way to build static archives on those platforms.
Differential Revision: https://reviews.llvm.org/D62770
llvm-svn: 362311
Diffstat (limited to 'libcxx/src')
| -rw-r--r-- | libcxx/src/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 4fe4db47d2a..2a8ff2c2d89 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -375,12 +375,16 @@ if (LIBCXX_ENABLE_STATIC) set(MERGE_ARCHIVES_ABI_TARGET "${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_STATIC_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() + if (APPLE) + set(MERGE_ARCHIVES_LIBTOOL "--use-libtool" "--libtool" "${CMAKE_LIBTOOL}") + endif() add_custom_command(TARGET cxx_static POST_BUILD COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/merge_archives.py ARGS -o $<TARGET_LINKER_FILE:cxx_static> --ar "${CMAKE_AR}" + ${MERGE_ARCHIVES_LIBTOOL} "$<TARGET_LINKER_FILE:cxx_static>" "${MERGE_ARCHIVES_ABI_TARGET}" "${MERGE_ARCHIVES_SEARCH_PATHS}" |

