diff options
author | Alexander Richardson <alexrichardson@google.com> | 2023-10-04 15:11:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 18:11:37 -0400 |
commit | e5994229541bbe78c3e6eb548224b46f8c3c91be (patch) | |
tree | 843aa0402e4bc8cab8ab9a5edb1980c4eb5e4d6f /libunwind | |
parent | 5099dc341f7fa9baec160c2991072eb445469d46 (diff) | |
download | llvm-e5994229541bbe78c3e6eb548224b46f8c3c91be.zip llvm-e5994229541bbe78c3e6eb548224b46f8c3c91be.tar.gz llvm-e5994229541bbe78c3e6eb548224b46f8c3c91be.tar.bz2 |
[runtimes] Fix parsing of LIB{CXX,CXXABI,UNWIND}_TEST_PARAMS (#67691)
Since 78d649a417b48cb8a2ba2e755f0e7c8fb8b1bb83 the recommended way to
pass an executor is to use the _TEST_PARAMS variable, which means we now
pass more complicated value (including ones that may contain multiple
`=`) as part of this variable. However, the `REGEX REPLACE` being used
has greedy matches so everything up to the last = becomes part of the
variable name which results in invalid syntax in the generated lit
config file.
This was noticed due to builder failures for those using the
CrossWinToARMLinux.cmake cache file.
---------
Co-authored-by: Vladimir Vereschaka <vvereschaka@accesssoftek.com>
Diffstat (limited to 'libunwind')
-rw-r--r-- | libunwind/test/CMakeLists.txt | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt index 084da0a..21dfbb0 100644 --- a/libunwind/test/CMakeLists.txt +++ b/libunwind/test/CMakeLists.txt @@ -1,4 +1,5 @@ include(AddLLVM) # for add_lit_testsuite +include(HandleLitArguments) macro(pythonize_bool var) if (${var}) set(${var} True) @@ -14,32 +15,24 @@ pythonize_bool(LIBUNWIND_USES_ARM_EHABI) set(AUTO_GEN_COMMENT "## Autogenerated by libunwind configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") -macro(serialize_lit_param param value) - string(APPEND SERIALIZED_LIT_PARAMS "config.${param} = ${value}\n") -endmacro() - if (LIBUNWIND_EXECUTOR) message(DEPRECATION "LIBUNWIND_EXECUTOR is deprecated, please add executor=... to LIBUNWIND_TEST_PARAMS") - serialize_lit_param(executor "\"${LIBUNWIND_EXECUTOR}\"") + serialize_lit_string_param(SERIALIZED_LIT_PARAMS executor "${LIBUNWIND_EXECUTOR}") endif() -serialize_lit_param(enable_experimental False) +serialize_lit_param(SERIALIZED_LIT_PARAMS enable_experimental False) if (LLVM_USE_SANITIZER) - serialize_lit_param(use_sanitizer "\"${LLVM_USE_SANITIZER}\"") + serialize_lit_string_param(SERIALIZED_LIT_PARAMS use_sanitizer "${LLVM_USE_SANITIZER}") endif() if (CMAKE_CXX_COMPILER_TARGET) - serialize_lit_param(target_triple "\"${CMAKE_CXX_COMPILER_TARGET}\"") + serialize_lit_string_param(SERIALIZED_LIT_PARAMS target_triple "${CMAKE_CXX_COMPILER_TARGET}") else() - serialize_lit_param(target_triple "\"${LLVM_DEFAULT_TARGET_TRIPLE}\"") + serialize_lit_string_param(SERIALIZED_LIT_PARAMS target_triple "${LLVM_DEFAULT_TARGET_TRIPLE}") endif() -foreach(param IN LISTS LIBUNWIND_TEST_PARAMS) - string(REGEX REPLACE "(.+)=(.+)" "\\1" name "${param}") - string(REGEX REPLACE "(.+)=(.+)" "\\2" value "${param}") - serialize_lit_param("${name}" "\"${value}\"") -endforeach() +serialize_lit_params_list(SERIALIZED_LIT_PARAMS LIBUNWIND_TEST_PARAMS) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/configs/cmake-bridge.cfg.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake-bridge.cfg" |