diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -113,6 +113,10 @@ serialize_lit_param(use_sanitizer "\"${LLVM_USE_SANITIZER}\"") endif() +if (LIBCXX_BUILD_32_BITS) + serialize_lit_param(enable_32bit True) +endif() + if (NOT DEFINED LIBCXX_TEST_DEPS) message(FATAL_ERROR "Expected LIBCXX_TEST_DEPS to be defined") endif() diff --git a/libcxx/test/configs/legacy.cfg.in b/libcxx/test/configs/legacy.cfg.in --- a/libcxx/test/configs/legacy.cfg.in +++ b/libcxx/test/configs/legacy.cfg.in @@ -13,7 +13,6 @@ config.cxx_library_root = "@LIBCXX_LIBRARY_DIR@" config.abi_library_root = "@LIBCXX_CXX_ABI_LIBRARY_PATH@" config.enable_shared = @LIBCXX_LINK_TESTS_WITH_SHARED_LIBCXX@ -config.enable_32bit = @LIBCXX_BUILD_32_BITS@ config.cxx_abi = "@LIBCXX_CXX_ABI_LIBNAME@" config.configuration_variant = "@LIBCXX_LIT_VARIANT@" config.host_triple = "@LLVM_HOST_TRIPLE@" diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -267,10 +267,6 @@ self.configure_compile_flags_header_includes() self.target_info.add_cxx_compile_flags(self.cxx.compile_flags) self.target_info.add_cxx_flags(self.cxx.flags) - # Configure feature flags. - enable_32bit = self.get_lit_bool('enable_32bit', False) - if enable_32bit: - self.cxx.flags += ['-m32'] # Use verbose output for better errors self.cxx.flags += ['-v'] sysroot = self.get_lit_conf('sysroot') diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -158,6 +158,13 @@ AddFeature('libcxx-no-debug-mode') ]), + Parameter(name='enable_32bit', choices=[True, False], type=bool, default=False, + help="Whether to build the test suite in 32 bit mode even on a 64 bit target. This basically controls " + "whether -m32 is used when building the test suite.", + actions=lambda enabled: [] if not enabled else [ + AddFlag('-m32') + ]), + Parameter(name='additional_features', type=list, default=[], help="A comma-delimited list of additional features that will be enabled when running the tests. " "This should be used sparingly since specifying ad-hoc features manually is error-prone and " diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -90,6 +90,10 @@ serialize_lit_param(target_triple "\"${TARGET_TRIPLE}\"") endif() +if (LIBCXXABI_BUILD_32_BITS) + serialize_lit_param(enable_32bit True) +endif() + configure_lit_site_cfg( "${LIBCXXABI_TEST_CONFIG}" ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg diff --git a/libcxxabi/test/lit.site.cfg.in b/libcxxabi/test/lit.site.cfg.in --- a/libcxxabi/test/lit.site.cfg.in +++ b/libcxxabi/test/lit.site.cfg.in @@ -18,7 +18,6 @@ config.llvm_unwinder = @LIBCXXABI_USE_LLVM_UNWINDER@ config.builtins_library = "@LIBCXXABI_BUILTINS_LIBRARY@" config.enable_threads = @LIBCXXABI_ENABLE_THREADS@ -config.enable_32bit = @LIBCXXABI_BUILD_32_BITS@ config.target_info = "@LIBCXXABI_TARGET_INFO@" config.executor = "@LIBCXXABI_EXECUTOR@" config.libcxxabi_shared = @LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI@ diff --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt --- a/libunwind/test/CMakeLists.txt +++ b/libunwind/test/CMakeLists.txt @@ -40,6 +40,10 @@ serialize_lit_param(target_triple "\"${TARGET_TRIPLE}\"") endif() +if (LIBUNWIND_BUILD_32_BITS) + serialize_lit_param(enable_32bit True) +endif() + configure_lit_site_cfg( "${LIBUNWIND_TEST_CONFIG}" ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg diff --git a/libunwind/test/lit.site.cfg.in b/libunwind/test/lit.site.cfg.in --- a/libunwind/test/lit.site.cfg.in +++ b/libunwind/test/lit.site.cfg.in @@ -16,7 +16,6 @@ config.llvm_unwinder = True config.builtins_library = "@LIBUNWIND_BUILTINS_LIBRARY@" config.enable_threads = @LIBUNWIND_ENABLE_THREADS@ -config.enable_32bit = @LIBUNWIND_BUILD_32_BITS@ config.target_info = "@LIBUNWIND_TARGET_INFO@" config.test_linker_flags = "@LIBUNWIND_TEST_LINKER_FLAGS@" config.test_compiler_flags = "@LIBUNWIND_TEST_COMPILER_FLAGS@"