Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -453,6 +453,10 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) +if (ZOS) + set(LIBCXX_DATASET_PREFIX "" CACHE STRING "Use the dataset prefix.") +endif() + # Declare libc++ configuration variables. # They are intended for use as follows: # LIBCXX_CXX_FLAGS: General flags for both the compiler and linker. Index: libcxx/test/configs/ibm-zos-libc++-shared.cfg.in =================================================================== --- /dev/null +++ libcxx/test/configs/ibm-zos-libc++-shared.cfg.in @@ -0,0 +1,45 @@ +# This testing configuration handles running the libc++ tests on +# z/OS using a shared library. + +import os, site + +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{flags}', '')) + +compile_flags = '-nostdinc++ -I %{include} -I %{libcxx}/test/support' +if os.getenv('ZOS_LIBCXX_TEST_ASCII') == '1': + # Testing ASCII + compile_flags += ' -fzos-le-char-mode=ascii' +else: + # Testing EBCDIC + compile_flags += ' -D_LIBCPP_HAS_NO_UNICODE' + config.available_features.add('zos-ebcdic') + +config.substitutions.append(('%{compile_flags}', compile_flags)) + +config.substitutions.append(('%{link_flags}', + '-nostdlib++ -L %{install}/lib -L %{install}/libcxx/lib -lc++ -lc++_a \ + -lc++_exception -lc++abi -lc++abixl -lunwind')) + +dataset_prefix = '@LIBCXX_DATASET_PREFIX@' +if dataset_prefix is None: + raise ValueError('No dataset prefix has been provided.') + +steplib = dataset_prefix + '.SCEERUN2' +if os.getenv('STEPLIB',''): + steplib += ":" + os.environ['STEPLIB'] + +path = os.environ['PATH'] + +config.substitutions.append(('%{exec}', + '%{{executor}} --execdir %T --env _BPXK_AUTOCVT=ON STEPLIB={0} PATH={1} -- '.format(steplib,path))) + +site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) +import libcxx.test.params, libcxx.test.newconfig +libcxx.test.newconfig.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +) Index: libcxxabi/test/configs/ibm-zos-libc++abi-shared.cfg.in =================================================================== --- /dev/null +++ libcxxabi/test/configs/ibm-zos-libc++abi-shared.cfg.in @@ -0,0 +1,45 @@ +# Testing configuration for libc++abi on z/OS. + +import os, site + +lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') + +config.substitutions.append(('%{flags}','')) + +compile_flags = '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} \ + -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS \ + -I %{libcxx}/test/support -I %{libcxx}/src -I %{libcxx}/include/c++build' + +if os.getenv('ZOS_LIBCXX_TEST_ASCII') == '1': + # Testing ASCII + compile_flags += ' -fzos-le-char-mode=ascii' +else: + # Testing EBCDIC + compile_flags += ' -D_LIBCPP_HAS_NO_UNICODE' + config.available_features.add('zos-ebcdic') + +config.substitutions.append(('%{compile_flags}', compile_flags)) + +config.substitutions.append(('%{link_flags}', + '-nostdlib++ -L %{install}/lib -L %{install}/libcxx/lib -lc++ -lc++_a \ + -lc++_exception -lc++abi -lc++abixl -lunwind')) + +dataset_prefix = '@LIBCXX_DATASET_PREFIX@' +if dataset_prefix is None: + raise ValueError('No dataset prefix has been provided.') + +steplib = dataset_prefix + '.SCEERUN2' +if os.getenv('STEPLIB',''): + steplib += ":" + os.environ['STEPLIB'] + +config.substitutions.append(('%{exec}', + '%{{executor}} --execdir %T --env _BPXK_AUTOCVT=ON STEPLIB={0} -- '.format(steplib))) + +site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils')) +import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig +libcxx.test.newconfig.configure( + libcxx.test.params.DEFAULT_PARAMETERS, + libcxx.test.features.DEFAULT_FEATURES, + config, + lit_config +)