summaryrefslogtreecommitdiff
path: root/libcxxabi/src
diff options
context:
space:
mode:
authorZibi Sarbinowski <zibi@ca.ibm.com>2022-10-03 16:41:58 -0500
committerZibi Sarbinowski <zibi@ca.ibm.com>2022-10-03 17:24:02 -0500
commit36dde913b0ff86ccdf09e0bc21421dce6a66f81d (patch)
treea8bd6fbcc3b5217825a73ba9e460f9f6214ce3bf /libcxxabi/src
parentd46751a5721c7e3ab83bc5ecd760e8ba7c84bb30 (diff)
downloadllvm-36dde913b0ff86ccdf09e0bc21421dce6a66f81d.tar.gz
[SystemZ][z/OS] Add ASCII and 32-bit variants for libc++.
This patch enables libc++ build as shared library in all combinations of ASCII/EBCDIC and 32-bit/64-bit variants. In particular it introduces: # ASCII version of libc++ named as libc++_a.so # Script to rename DLL name inside the generated side deck # Various names for dataset members where DLL libraries and their side decks will reside # Add the following options: - LIBCXX_SHARED_OUTPUT_NAME - LIBCXX_ADDITIONAL_COMPILE_FLAGS - LIBCXX_ADDITIONAL_LIBRARIES - LIBCXXABI_ADDITIONAL_COMPILE_FLAGS - LIBCXXABI_ADDITIONAL_LIBRARIES **Background and rational of this patch** The linker on z/OS creates a list of exported symbols in a file called side deck. The list contains the symbol name as well as the name of the DLL which implements the symbol. The name of the DLL depends on what is specified in the -o command line option. If it points to a USS file, than the DLL name in the side deck will be the USS file name. If it points to a member of a dataset then the DLL name in the side deck is the member name. If CMake could deal with z/OS datasets we could use -o that points to a dataset member name, but this does not seem to work so we have to produce a USS file as the DLL and then copy the content of the produced side deck to a dataset as well as rename the USS file name in the side deck to a dataset member name that corresponds to that DLL. Reviewed By: muiez, SeanP, ldionne, #libc, #libc_abi Differential Revision: https://reviews.llvm.org/D118503
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 248acc6567ab..a8cd222dc7a3 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -191,6 +191,17 @@ if (LIBCXXABI_ENABLE_SHARED)
SOVERSION "1"
VERSION "${LIBCXXABI_LIBRARY_VERSION}"
)
+
+ if (ZOS)
+ add_custom_command(TARGET cxxabi_shared POST_BUILD
+ COMMAND
+ ${LIBCXXABI_LIBCXX_PATH}/utils/zos_rename_dll_side_deck.sh
+ $<TARGET_LINKER_FILE_NAME:cxxabi_shared> $<TARGET_FILE_NAME:cxxabi_shared> "${LIBCXXABI_DLL_NAME}"
+ COMMENT "Rename dll name inside the side deck file"
+ WORKING_DIRECTORY $<TARGET_FILE_DIR:cxxabi_shared>
+ )
+ endif ()
+
target_link_libraries(cxxabi_shared
PUBLIC cxxabi_shared_objects
PRIVATE ${LIBCXXABI_SHARED_LIBRARIES} ${LIBCXXABI_LIBRARIES})