fix: Use BOOST_USE_TSAN instead of BOOST_USE_ASAN for TSAN builds

The cleanup in 959c7bcae2 merged separate ASAN/TSAN if-blocks into one,
but incorrectly defined BOOST_USE_ASAN for both. TSAN builds don't link
ASan's runtime, so __sanitizer_start/finish_switch_fiber are unresolved.

Restore the original separate blocks from d2079574c7.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-03-24 15:53:46 +00:00
parent 959c7bcae2
commit 1866a07add

View File

@@ -55,13 +55,20 @@ endif()
# stack-use-after-scope errors. BOOST_USE_UCONTEXT ensures the ucontext backend
# is selected (fcontext does not support ASAN annotations).
# These defines must match what Boost was compiled with (see conan/profiles/sanitizers).
# TSAN also requires the ucontext backend so that Boost.Context uses
# POSIX ucontext (not fcontext assembly) for fiber switching. This
# allows TSAN to properly track context switches and avoids false positives.
# These defines must match what Boost was compiled with (see conan/profiles/sanitizers).
if(enable_asan OR enable_tsan)
if(enable_asan)
target_compile_definitions(
xrpl_boost
INTERFACE BOOST_USE_ASAN BOOST_USE_UCONTEXT
)
endif()
# TSAN also requires the ucontext backend so that Boost.Context uses
# POSIX ucontext (not fcontext assembly) for fiber switching. This
# allows TSAN to properly track context switches and avoids false positives.
# These defines must match what Boost was compiled with (see conan/profiles/sanitizers).
if(enable_tsan)
target_compile_definitions(
xrpl_boost
INTERFACE BOOST_USE_TSAN BOOST_USE_UCONTEXT
)
endif()