This is mainly motivated at being able to use the ThreadSanitizer to give the MTTCG work a good testing for corner cases. However this should be generally useful.
The first two patches are simple configure tweaks to make the passing of flags sane. To build on my machine I installed the latest/greatest GCC PPA and configured with: ./configure ${TARGET_LIST} --cc=gcc-5 --cxx=g++-5 \ --extra-cflags="-fsanitize=thread" --extra-libs="-ltsan" \ --with-coroutine=gthread The compiler selection gives the new GCC and I pass the -fsanitize option in the cflags. I've introduced --extra-libs so we can link in the ThreadSanitizer support library. The third patch ensure we use the __atomic builtins for all atomic functions if we have it available. This is needed so the ThreadSanitizer can properly instrument the code but we should use it anyway for consistency. The code generation for atomic accesses on x86 it unaffected. Finally there is a patch with a few of the fixes for bugs thrown up running make check. It doesn't fix them all as there are still some warnings I need to look into more deeply. Alex Bennée (4): configure: move EXTRA_CFLAGS append to the end configure: introduce --extra-libs include/qemu/atomic.h: default to __atomic functions tsan: various fixes for make check async.c | 4 +- configure | 18 ++++++- include/qemu/atomic.h | 126 ++++++++++++++++++++++++++++++----------------- tests/test-thread-pool.c | 2 +- thread-pool.c | 9 ++-- 5 files changed, 105 insertions(+), 54 deletions(-) -- 2.7.0