[llvm-branch-commits] [compiler-rt] c9fbd57 - dfsan: Fix test with gcc 15.
Cullen Rhodes via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Oct 14 06:07:27 PDT 2025
Author: Peter Collingbourne
Date: 2025-10-14T13:07:16Z
New Revision: c9fbd571b52c1659b915d6276a8d522df18cbc65
URL: https://github.com/llvm/llvm-project/commit/c9fbd571b52c1659b915d6276a8d522df18cbc65
DIFF: https://github.com/llvm/llvm-project/commit/c9fbd571b52c1659b915d6276a8d522df18cbc65.diff
LOG: dfsan: Fix test with gcc 15.
With gcc 15 we end up emitting a reference to the
std::__glibcxx_assert_fail function because of this change:
https://github.com/gcc-mirror/gcc/commit/361d230fd7800a7e749aba8ed020f54f5c26d504
combined with assertion checks in the std::atomic implementation.
This reference is undefined with dfsan causing the test to fail. Fix it
by defining the macro that disables assertions.
Pull Request: https://github.com/llvm/llvm-project/pull/153873
Added:
Modified:
compiler-rt/test/dfsan/atomic.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/dfsan/atomic.cpp b/compiler-rt/test/dfsan/atomic.cpp
index 22ee323c752f8..73e1cbd17a7cd 100644
--- a/compiler-rt/test/dfsan/atomic.cpp
+++ b/compiler-rt/test/dfsan/atomic.cpp
@@ -1,9 +1,12 @@
-// RUN: %clangxx_dfsan %s -fno-exceptions -o %t && %run %t
-// RUN: %clangxx_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 %s -fno-exceptions -o %t && %run %t
+// RUN: %clangxx_dfsan %s -fno-exceptions -D_GLIBCXX_NO_ASSERTIONS -o %t && %run %t
+// RUN: %clangxx_dfsan -DORIGIN_TRACKING -mllvm -dfsan-track-origins=1 %s -fno-exceptions -D_GLIBCXX_NO_ASSERTIONS -o %t && %run %t
//
// Use -fno-exceptions to turn off exceptions to avoid instrumenting
// __cxa_begin_catch, std::terminate and __gxx_personality_v0.
//
+// Use -D_GLIBCXX_NO_ASSERTIONS to avoid depending on
+// std::__glibcxx_assert_fail with gcc >= 15.
+//
// TODO: Support builtin atomics. For example, https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
// DFSan instrumentation pass cannot identify builtin callsites yet.
More information about the llvm-branch-commits
mailing list