aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierrick Bouvier <pierrick.bouvier@linaro.org>2024-10-23 12:33:52 +0100
committerAlex Bennée <alex.bennee@linaro.org>2024-10-24 09:56:09 +0100
commitcf6fbba724f19355d31b7d8dd1a711538dd91645 (patch)
tree31d07a8fb6d84757acd9fd9320880f6d53f755a9
parente4239ee92fe07bffe74759832499cf732923c76a (diff)
downloadqemu-cf6fbba724f19355d31b7d8dd1a711538dd91645.zip
qemu-cf6fbba724f19355d31b7d8dd1a711538dd91645.tar.gz
qemu-cf6fbba724f19355d31b7d8dd1a711538dd91645.tar.bz2
meson: hide tsan related warnings
When building with gcc-12 -fsanitize=thread, gcc reports some constructions not supported with tsan. Found on debian stable. qemu/include/qemu/atomic.h:36:52: error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’ [-Werror=tsan] 36 | #define smp_mb() ({ barrier(); __atomic_thread_fence(__ATOMIC_SEQ_CST); }) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20240910174013.1433331-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241023113406.1284676-5-alex.bennee@linaro.org>
-rw-r--r--meson.build10
1 files changed, 9 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index d26690c..bdd67a2 100644
--- a/meson.build
+++ b/meson.build
@@ -538,7 +538,15 @@ if get_option('tsan')
prefix: '#include <sanitizer/tsan_interface.h>')
error('Cannot enable TSAN due to missing fiber annotation interface')
endif
- qemu_cflags = ['-fsanitize=thread'] + qemu_cflags
+ tsan_warn_suppress = []
+ # gcc (>=11) will report constructions not supported by tsan:
+ # "error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’"
+ # https://gcc.gnu.org/gcc-11/changes.html
+ # However, clang does not support this warning and this triggers an error.
+ if cc.has_argument('-Wno-tsan')
+ tsan_warn_suppress = ['-Wno-tsan']
+ endif
+ qemu_cflags = ['-fsanitize=thread'] + tsan_warn_suppress + qemu_cflags
qemu_ldflags = ['-fsanitize=thread'] + qemu_ldflags
endif