From 49e8620fe191da4fabc79896d05d56cb531ed673 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 28 Aug 2024 11:15:08 -0400 Subject: build: Move tsan/target_clones conflict to the prelude --- build/flags.mk | 4 ---- src/prelude.h | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build/flags.mk b/build/flags.mk index 504df63..4636620 100644 --- a/build/flags.mk +++ b/build/flags.mk @@ -41,10 +41,6 @@ _GCOV := ${TRUTHY,${GCOV}} _LINT := ${TRUTHY,${LINT}} _RELEASE := ${TRUTHY,${RELEASE}} -# https://github.com/google/sanitizers/issues/342 -TSAN_CPPFLAGS,y := -DBFS_USE_TARGET_CLONES=0 -_CPPFLAGS += ${TSAN_CPPFLAGS,${_TSAN}} - ASAN_CFLAGS,y := -fsanitize=address LSAN_CFLAGS,y := -fsanitize=leak MSAN_CFLAGS,y := -fsanitize=memory -fsanitize-memory-track-origins diff --git a/src/prelude.h b/src/prelude.h index 1f5c152..48f377c 100644 --- a/src/prelude.h +++ b/src/prelude.h @@ -310,9 +310,11 @@ extern const char bfs_ldlibs[]; /** * Check if function multiversioning via GNU indirect functions (ifunc) is supported. + * + * Disabled on TSan due to https://github.com/google/sanitizers/issues/342. */ #ifndef BFS_USE_TARGET_CLONES -# if __has_attribute(target_clones) && (__GLIBC__ || __FreeBSD__) +# if __has_attribute(target_clones) && (__GLIBC__ || __FreeBSD__) && !__SANITIZE_THREAD__ # define BFS_USE_TARGET_CLONES true # endif #endif -- cgit v1.2.3