<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt">That's because by default we are building the run-time with the host compiler (gcc) and don't see this. <div>Alexey, what's the story about using the fresh clang for compiler-rt? </div>
<div><br></div><div>--kcc <br><br><div class="gmail_quote">On Wed, Dec 19, 2012 at 3:50 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Dec 18, 2012 at 4:35 AM, Dmitry Vyukov <<a href="mailto:dvyukov@google.com">dvyukov@google.com</a>> wrote:<br>
> Author: dvyukov<br>
> Date: Tue Dec 18 06:35:31 2012<br>
> New Revision: 170429<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=170429&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=170429&view=rev</a><br>
> Log:<br>
> tsan: add signalfd() and inotify_init() interceptors<br>
><br>
> Modified:<br>
> compiler-rt/trunk/lib/tsan/rtl/tsan_fd.cc<br>
> compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h<br>
> compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc<br>
> compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc<br>
> compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h<br>
><br>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_fd.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_fd.cc?rev=170429&r1=170428&r2=170429&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_fd.cc?rev=170429&r1=170428&r2=170429&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_fd.cc (original)<br>
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_fd.cc Tue Dec 18 06:35:31 2012<br>
> @@ -90,11 +90,12 @@<br>
> FdDesc *d = fddesc(thr, pc, fd);<br>
> // As a matter of fact, we don't intercept all close calls.<br>
> // See e.g. libc __res_iclose().<br>
> - if (d->sync)<br>
> + if (d->sync) {<br>
> unref(thr, pc, d->sync);<br>
> + d->sync = 0;<br>
> + }<br>
> if (flags()->io_sync == 0) {<br>
> unref(thr, pc, s);<br>
> - d->sync = 0;<br>
> } else if (flags()->io_sync == 1) {<br>
> d->sync = s;<br>
> } else if (flags()->io_sync == 2) {<br>
> @@ -189,6 +190,16 @@<br>
> init(thr, pc, fd, allocsync());<br>
> }<br>
><br>
> +void FdSignalCreate(ThreadState *thr, uptr pc, int fd) {<br>
> + DPrintf("#%d: FdSignalCreate(%d)\n", thr->tid, fd);<br>
> + init(thr, pc, fd, 0);<br>
> +}<br>
> +<br>
> +void FdInotifyCreate(ThreadState *thr, uptr pc, int fd) {<br>
> + DPrintf("#%d: FdInotifyCreate(%d)\n", thr->tid, fd);<br>
> + init(thr, pc, fd, 0);<br>
> +}<br>
> +<br>
> void FdPollCreate(ThreadState *thr, uptr pc, int fd) {<br>
> DPrintf("#%d: FdPollCreate(%d)\n", thr->tid, fd);<br>
> init(thr, pc, fd, allocsync());<br>
><br>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h?rev=170429&r1=170428&r2=170429&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h?rev=170429&r1=170428&r2=170429&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h (original)<br>
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_fd.h Tue Dec 18 06:35:31 2012<br>
> @@ -46,6 +46,8 @@<br>
> void FdDup(ThreadState *thr, uptr pc, int oldfd, int newfd);<br>
> void FdPipeCreate(ThreadState *thr, uptr pc, int rfd, int wfd);<br>
> void FdEventCreate(ThreadState *thr, uptr pc, int fd);<br>
> +void FdSignalCreate(ThreadState *thr, uptr pc, int fd);<br>
> +void FdInotifyCreate(ThreadState *thr, uptr pc, int fd);<br>
> void FdPollCreate(ThreadState *thr, uptr pc, int fd);<br>
> void FdSocketCreate(ThreadState *thr, uptr pc, int fd);<br>
> void FdSocketAccept(ThreadState *thr, uptr pc, int fd, int newfd);<br>
><br>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=170429&r1=170428&r2=170429&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=170429&r1=170428&r2=170429&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)<br>
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Tue Dec 18 06:35:31 2012<br>
> @@ -1128,6 +1128,31 @@<br>
> return fd;<br>
> }<br>
><br>
> +TSAN_INTERCEPTOR(int, signalfd, int fd, void *mask, int flags) {<br>
> + SCOPED_TSAN_INTERCEPTOR(signalfd, fd, mask, flags);<br>
> + FdClose(thr, pc, fd);<br>
> + fd = REAL(signalfd)(fd, mask, flags);<br>
> + if (fd >= 0)<br>
> + FdSignalCreate(thr, pc, fd);<br>
> + return fd;<br>
> +}<br>
> +<br>
> +TSAN_INTERCEPTOR(int, inotify_init) {<br>
<br>
</div></div>This (& some other recent commits) seems to be breaking a clang<br>
self-hosting -Werror build:<br>
<br>
llvm/src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1140:35:<br>
error: must specify at least one argument for '...' parameter of<br>
variadic macro [-Werror,-Wgnu]<br>
TSAN_INTERCEPTOR(int, inotify_init) {<br>
^<br>
<br>
Could you fix/revert ASAP, please?<br>
<br>
Thanks,<br>
- David<br>
<div class="HOEnZb"><div class="h5"><br>
> + SCOPED_TSAN_INTERCEPTOR(inotify_init);<br>
> + int fd = REAL(inotify_init)();<br>
> + if (fd >= 0)<br>
> + FdInotifyCreate(thr, pc, fd);<br>
> + return fd;<br>
> +}<br>
> +<br>
> +TSAN_INTERCEPTOR(int, inotify_init1, int flags) {<br>
> + SCOPED_TSAN_INTERCEPTOR(inotify_init1, flags);<br>
> + int fd = REAL(inotify_init1)(flags);<br>
> + if (fd >= 0)<br>
> + FdInotifyCreate(thr, pc, fd);<br>
> + return fd;<br>
> +}<br>
> +<br>
> TSAN_INTERCEPTOR(int, socket, int domain, int type, int protocol) {<br>
> SCOPED_TSAN_INTERCEPTOR(socket, domain, type, protocol);<br>
> int fd = REAL(socket)(domain, type, protocol);<br>
> @@ -1743,6 +1768,9 @@<br>
> TSAN_INTERCEPT(dup2);<br>
> TSAN_INTERCEPT(dup3);<br>
> TSAN_INTERCEPT(eventfd);<br>
> + TSAN_INTERCEPT(signalfd);<br>
> + TSAN_INTERCEPT(inotify_init);<br>
> + TSAN_INTERCEPT(inotify_init1);<br>
> TSAN_INTERCEPT(socket);<br>
> TSAN_INTERCEPT(socketpair);<br>
> TSAN_INTERCEPT(connect);<br>
><br>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc?rev=170429&r1=170428&r2=170429&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc?rev=170429&r1=170428&r2=170429&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc (original)<br>
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc Tue Dec 18 06:35:31 2012<br>
> @@ -189,6 +189,9 @@<br>
> name[StatInt_dup2] = " dup2 ";<br>
> name[StatInt_dup3] = " dup3 ";<br>
> name[StatInt_eventfd] = " eventfd ";<br>
> + name[StatInt_signalfd] = " signalfd ";<br>
> + name[StatInt_inotify_init] = " inotify_init ";<br>
> + name[StatInt_inotify_init1] = " inotify_init1 ";<br>
> name[StatInt_socket] = " socket ";<br>
> name[StatInt_socketpair] = " socketpair ";<br>
> name[StatInt_connect] = " connect ";<br>
><br>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h?rev=170429&r1=170428&r2=170429&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h?rev=170429&r1=170428&r2=170429&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h (original)<br>
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h Tue Dec 18 06:35:31 2012<br>
> @@ -184,6 +184,9 @@<br>
> StatInt_dup2,<br>
> StatInt_dup3,<br>
> StatInt_eventfd,<br>
> + StatInt_signalfd,<br>
> + StatInt_inotify_init,<br>
> + StatInt_inotify_init1,<br>
> StatInt_socket,<br>
> StatInt_socketpair,<br>
> StatInt_connect,<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>