[SystemZ][z/OS] Add ASCII and 32-bit variants for libc++.
authorZibi Sarbinowski <zibi@ca.ibm.com>
Mon, 3 Oct 2022 21:41:58 +0000 (16:41 -0500)
committerZibi Sarbinowski <zibi@ca.ibm.com>
Mon, 3 Oct 2022 22:24:02 +0000 (17:24 -0500)
commit36dde913b0ff86ccdf09e0bc21421dce6a66f81d
treea8bd6fbcc3b5217825a73ba9e460f9f6214ce3bf
parentd46751a5721c7e3ab83bc5ecd760e8ba7c84bb30
[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
libcxx/CMakeLists.txt
libcxx/cmake/caches/s390x-ibm-zos-ascii.cmake [new file with mode: 0644]
libcxx/cmake/caches/s390x-ibm-zos.cmake [new file with mode: 0644]
libcxx/cmake/caches/s390x32-ibm-zos-ascii.cmake [new file with mode: 0644]
libcxx/cmake/caches/s390x32-ibm-zos.cmake [new file with mode: 0644]
libcxx/docs/BuildingLibcxx.rst
libcxx/src/CMakeLists.txt
libcxx/utils/zos_rename_dll_side_deck.sh [new file with mode: 0755]
libcxxabi/CMakeLists.txt
libcxxabi/src/CMakeLists.txt