[PATCH] D97321: We need to remove both options --whole-archive and --color-diagnostics from the link step otherwise, we get link errors when building libc++ on z/OS.
Zibi Sarbino via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 23 11:58:02 PST 2021
zibi created this revision.
Herald added a subscriber: mgorny.
zibi requested review of this revision.
Herald added projects: libc++, LLVM.
Herald added subscribers: llvm-commits, libcxx-commits.
Herald added a reviewer: libc++.
[SystemZ][ZOS] Remove --whole-archive & --color-diagnostics
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D97321
Files:
libcxx/src/CMakeLists.txt
llvm/cmake/modules/HandleLLVMOptions.cmake
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -869,7 +869,7 @@
endif()
# lld doesn't print colored diagnostics when invoked from Ninja
-if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
+if (NOT ZOS AND UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
include(CheckLinkerFlag)
check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS)
append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics"
Index: libcxx/src/CMakeLists.txt
===================================================================
--- libcxx/src/CMakeLists.txt
+++ libcxx/src/CMakeLists.txt
@@ -210,7 +210,9 @@
# Link against libc++abi
if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
- if (APPLE)
+ if (ZOS)
+ target_link_libraries(cxx_shared PRIVATE "${LIBCXX_CXX_STATIC_ABI_LIBRARY}")
+ elseif (APPLE)
target_link_libraries(cxx_shared PRIVATE "-Wl,-force_load" "${LIBCXX_CXX_STATIC_ABI_LIBRARY}")
else()
target_link_libraries(cxx_shared PRIVATE "-Wl,--whole-archive,-Bstatic" "${LIBCXX_CXX_STATIC_ABI_LIBRARY}" "-Wl,-Bdynamic,--no-whole-archive")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97321.325865.patch
Type: text/x-patch
Size: 1261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210223/403bfc12/attachment.bin>
More information about the llvm-commits
mailing list