Skip to content

[NFC][CFI] Fix setup of UBSAN_TEST_HAS_CFI #137424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vitalybuka
Copy link
Collaborator

For #137245

Created using spr 1.3.4
@vitalybuka vitalybuka added the skip-precommit-approval PR for CI feedback, not intended for review label Apr 26, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 26, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Vitaly Buka (vitalybuka)

Changes

For #137245


Full diff: https://github.com/llvm/llvm-project/pull/137424.diff

2 Files Affected:

  • (modified) compiler-rt/test/ubsan_minimal/CMakeLists.txt (+5-1)
  • (modified) compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in (+1-1)
diff --git a/compiler-rt/test/ubsan_minimal/CMakeLists.txt b/compiler-rt/test/ubsan_minimal/CMakeLists.txt
index 819428c6e80d9..5b722a15e9827 100644
--- a/compiler-rt/test/ubsan_minimal/CMakeLists.txt
+++ b/compiler-rt/test/ubsan_minimal/CMakeLists.txt
@@ -13,7 +13,11 @@ foreach(arch ${UBSAN_TEST_ARCH})
   string(TOLOWER "-${arch}-${OS_NAME}" UBSAN_TEST_CONFIG_SUFFIX)
   get_test_cc_for_arch(${arch} UBSAN_TEST_TARGET_CC UBSAN_TEST_TARGET_CFLAGS)
   set(CONFIG_NAME ${arch})
-  set(UBSAN_TEST_HAS_CFI ${arch} IN_LIST CFI_SUPPORTED_ARCH)
+  if(${arch} IN_LIST CFI_SUPPORTED_ARCH)
+    set(UBSAN_TEST_HAS_CFI TRUE)
+  else()
+    set(UBSAN_TEST_HAS_CFI FALSE)
+  endif()
   pythonize_bool(UBSAN_TEST_HAS_CFI)
   configure_lit_site_cfg(
     ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
diff --git a/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in b/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in
index 457ddff867b84..8400af6ff5a81 100644
--- a/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in
+++ b/compiler-rt/test/ubsan_minimal/lit.site.cfg.py.in
@@ -5,7 +5,7 @@ config.name_suffix = "@UBSAN_TEST_CONFIG_SUFFIX@"
 # Tool-specific config options.
 config.target_cflags = "@UBSAN_TEST_TARGET_CFLAGS@"
 config.target_arch = "@UBSAN_TEST_TARGET_ARCH@"
-config.test_cfi = "@UBSAN_TEST_HAS_CFI_PYBOOL@"
+config.test_cfi = @UBSAN_TEST_HAS_CFI_PYBOOL@
 
 # Load common config for all compiler-rt lit tests.
 lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")

@vitalybuka vitalybuka merged commit 367b91a into main Apr 26, 2025
11 of 14 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfccfi-fix-setup-of-ubsan_test_has_cfi branch April 26, 2025 00:23
jyli0116 pushed a commit to jyli0116/llvm-project that referenced this pull request Apr 28, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt:sanitizer compiler-rt:ubsan Undefined behavior sanitizer compiler-rt skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants