From c467933dc723c3fff94fd1464c3870dca512d999 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 19 Dec 2012 06:59:45 +0000 Subject: [PATCH] tsan: fix -Wgnu warnings llvm-svn: 170499 --- compiler-rt/lib/tsan/Makefile.old | 4 ++-- compiler-rt/lib/tsan/rtl/Makefile.old | 5 ++++- compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | 12 ++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/compiler-rt/lib/tsan/Makefile.old b/compiler-rt/lib/tsan/Makefile.old index ff81fa9..034261a 100644 --- a/compiler-rt/lib/tsan/Makefile.old +++ b/compiler-rt/lib/tsan/Makefile.old @@ -8,7 +8,7 @@ ifeq ($(DEBUG), 0) CXXFLAGS += -O3 endif ifeq ($(CXX), clang++) - CXXFLAGS+= -Wno-unused-private-field -Wno-static-in-inline + CXXFLAGS+= -Wno-unused-private-field -Wno-static-in-inline -Wgnu endif LIBTSAN=rtl/libtsan.a @@ -35,7 +35,7 @@ help: @ echo " make install_deps # Install third-party dependencies required for building" @ echo " make presubmit # Run it every time before committing" @ echo - @ echo "For more info, see http://code.google.com/p/data-race-test/wiki/ThreadSanitizer2" + @ echo "For more info, see http://code.google.com/p/thread-sanitizer/wiki/Development" $(LIBTSAN): libtsan diff --git a/compiler-rt/lib/tsan/rtl/Makefile.old b/compiler-rt/lib/tsan/rtl/Makefile.old index 89ce832..51da5bb 100644 --- a/compiler-rt/lib/tsan/rtl/Makefile.old +++ b/compiler-rt/lib/tsan/rtl/Makefile.old @@ -1,6 +1,9 @@ CXXFLAGS = -fPIE -g -Wall -Werror -fno-builtin -DTSAN_DEBUG=$(DEBUG) ifeq ($(DEBUG), 0) - CXXFLAGS += -O3 + CXXFLAGS += -O3 +endif +ifeq ($(CXX), clang++) + CXXFLAGS+= -Wgnu endif # For interception. FIXME: move interception one level higher. diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc index da7356c..eb67c524 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc @@ -1137,9 +1137,9 @@ TSAN_INTERCEPTOR(int, signalfd, int fd, void *mask, int flags) { return fd; } -TSAN_INTERCEPTOR(int, inotify_init) { - SCOPED_TSAN_INTERCEPTOR(inotify_init); - int fd = REAL(inotify_init)(); +TSAN_INTERCEPTOR(int, inotify_init, int fake) { + SCOPED_TSAN_INTERCEPTOR(inotify_init, fake); + int fd = REAL(inotify_init)(fake); if (fd >= 0) FdInotifyCreate(thr, pc, fd); return fd; @@ -1617,10 +1617,10 @@ TSAN_INTERCEPTOR(int, munlockall, void) { return 0; } -TSAN_INTERCEPTOR(int, fork) { - SCOPED_TSAN_INTERCEPTOR(fork); +TSAN_INTERCEPTOR(int, fork, int fake) { + SCOPED_TSAN_INTERCEPTOR(fork, fake); // It's intercepted merely to process pending signals. - int pid = REAL(fork)(); + int pid = REAL(fork)(fake); if (pid == 0) { // child FdOnFork(thr, pc); -- 2.7.4