[libunwind] f7d8754 - [runtimes] Move enable_32bit to the DSL
Louis Dionne via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 6 05:42:18 PDT 2021
Author: Louis Dionne
Date: 2021-07-06T08:42:07-04:00
New Revision: f7d8754312bf3d10fb902d94f2bc84e3adf12ba4
URL: https://github.com/llvm/llvm-project/commit/f7d8754312bf3d10fb902d94f2bc84e3adf12ba4
DIFF: https://github.com/llvm/llvm-project/commit/f7d8754312bf3d10fb902d94f2bc84e3adf12ba4.diff
LOG: [runtimes] Move enable_32bit to the DSL
This is necessary for from-scratch configurations to support the 32-bit
mode of the test suite.
Differential Revision: https://reviews.llvm.org/D105435
Added:
Modified:
libcxx/test/CMakeLists.txt
libcxx/test/configs/legacy.cfg.in
libcxx/utils/libcxx/test/config.py
libcxx/utils/libcxx/test/params.py
libcxxabi/test/CMakeLists.txt
libcxxabi/test/lit.site.cfg.in
libunwind/test/CMakeLists.txt
libunwind/test/lit.site.cfg.in
Removed:
################################################################################
diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index 71a7d16772d3..f5f652613937 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -113,6 +113,10 @@ if (LLVM_USE_SANITIZER)
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
index adb813644fec..23aa5051eaea 100644
--- a/libcxx/test/configs/legacy.cfg.in
+++ b/libcxx/test/configs/legacy.cfg.in
@@ -13,7 +13,6 @@ config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
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
index 9538ecc6db79..f7117ca57b1e 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -267,10 +267,6 @@ def configure_default_compile_flags(self):
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
index 991f51ef902c..21621aedb75c 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -158,6 +158,13 @@ def getStdFlag(cfg, std):
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
index b571a2437cc8..385c43eaf2cb 100644
--- a/libcxxabi/test/CMakeLists.txt
+++ b/libcxxabi/test/CMakeLists.txt
@@ -90,6 +90,10 @@ if (TARGET_TRIPLE)
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
index 4015501de482..049f822b5ed5 100644
--- a/libcxxabi/test/lit.site.cfg.in
+++ b/libcxxabi/test/lit.site.cfg.in
@@ -18,7 +18,6 @@ config.cxx_library_root = "@LIBCXXABI_LIBCXX_LIBRARY_PATH@"
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
index 24c769cb9de7..5be44e566b6c 100644
--- a/libunwind/test/CMakeLists.txt
+++ b/libunwind/test/CMakeLists.txt
@@ -40,6 +40,10 @@ if (TARGET_TRIPLE)
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
index 6f0c339b9ab6..ef2ebd919272 100644
--- a/libunwind/test/lit.site.cfg.in
+++ b/libunwind/test/lit.site.cfg.in
@@ -16,7 +16,6 @@ config.cxx_library_root = "@LIBUNWIND_LIBCXX_LIBRARY_PATH@"
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@"
More information about the cfe-commits
mailing list