<div dir="ltr">On Mon, Mar 25, 2013 at 8:30 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Mar 25, 2013 at 8:55 AM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> wrote:<br>

><br>
> On Mon, Mar 25, 2013 at 7:14 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Mar 25, 2013 at 3:31 AM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>><br>
>> wrote:<br>
>> > Author: samsonov<br>
>> > Date: Mon Mar 25 05:31:49 2013<br>
>> > New Revision: 177860<br>
>> ><br>
>> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=177860&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=177860&view=rev</a><br>
>> > Log:<br>
>> > [Sanitizer] Compile sanitizer runtimes with -Wno-non-virtual-dtor.<br>
>> > Virtual dtors may be a problem for us, as sanitizer runtime should not<br>
>> > generally assume libstdc++ presence.<br>
>><br>
>> I'm not sure I understand the correlation between virtual dtors and<br>
>> the use (or not) of libstdc++. Could you explain it?<br>
><br>
><br>
> The compiler emits the call to "operator delete(void*)" while generating a<br>
> destructor.<br>
<br>
</div>I know very little about this stuff - but I sort of would've expected<br>
that sort of thing to be in the ABI runtime like libc++abi or<br>
equivalent - but perhaps I'm wrong or you don't link with that either.<br></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
>> > Modified:<br>
>> >     compiler-rt/trunk/CMakeLists.txt<br>
>> >     compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc<br>
>> >     compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h<br>
>> ><br>
>> > Modified: compiler-rt/trunk/CMakeLists.txt<br>
>> > URL:<br>
>> > <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=177860&r1=177859&r2=177860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=177860&r1=177859&r2=177860&view=diff</a><br>

>> ><br>
>> > ==============================================================================<br>
>> > --- compiler-rt/trunk/CMakeLists.txt (original)<br>
>> > +++ compiler-rt/trunk/CMakeLists.txt Mon Mar 25 05:31:49 2013<br>
>> > @@ -147,6 +147,12 @@ check_cxx_compiler_flag(-Wno-c99-extensi<br>
>> >  if(SUPPORTS_NO_C99_EXTENSIONS_FLAG)<br>
>> >    list(APPEND SANITIZER_COMMON_CFLAGS -Wno-c99-extensions)<br>
>> >  endif()<br>
>> > +# Sanitizer may not have libstdc++, so we can have problems with<br>
>> > virtual<br>
>> > +# destructors.<br>
>> > +check_cxx_compiler_flag(-Wno-non-virtual-dtor<br>
>> > SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG)<br>
>> > +if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG)<br>
>> > +  list(APPEND SANITIZER_COMMON_CFLAGS -Wno-non-virtual-dtor)<br>
>> > +endif()<br>
>> ><br>
>> >  # Setup min Mac OS X version.<br>
>> >  if(APPLE)<br>
>> ><br>
>> > Modified:<br>
>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc<br>
>> > URL:<br>
>> > <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc?rev=177860&r1=177859&r2=177860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc?rev=177860&r1=177859&r2=177860&view=diff</a><br>

>> ><br>
>> > ==============================================================================<br>
>> > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc<br>
>> > (original)<br>
>> > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc<br>
>> > Mon Mar 25 05:31:49 2013<br>
>> > @@ -22,11 +22,10 @@ ThreadContextBase::ThreadContextBase(u32<br>
>> >    name[0] = '\0';<br>
>> >  }<br>
>> ><br>
>> > -#ifndef SANITIZER_GO<br>
>> >  ThreadContextBase::~ThreadContextBase() {<br>
>> > +  // ThreadContextBase should never be deleted.<br>
>> >    CHECK(0);<br>
>> >  }<br>
>> > -#endif<br>
>> ><br>
>> >  void ThreadContextBase::SetName(const char *new_name) {<br>
>> >    name[0] = '\0';<br>
>> ><br>
>> > Modified:<br>
>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h<br>
>> > URL:<br>
>> > <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h?rev=177860&r1=177859&r2=177860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h?rev=177860&r1=177859&r2=177860&view=diff</a><br>

>> ><br>
>> > ==============================================================================<br>
>> > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h<br>
>> > (original)<br>
>> > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h<br>
>> > Mon Mar 25 05:31:49 2013<br>
>> > @@ -34,10 +34,7 @@ enum ThreadStatus {<br>
>> >  class ThreadContextBase {<br>
>> >   public:<br>
>> >    explicit ThreadContextBase(u32 tid);<br>
>> > -#ifndef SANITIZER_GO  // Go does not have libstdc++<br>
>> > -  virtual<br>
>> > -#endif<br>
>> > -  ~ThreadContextBase();<br>
>> > +  ~ThreadContextBase();  // Should never be called.<br>
>><br>
>> You could replace this comment with a use of the LLVM_DELETED_FUNCTION<br>
>> macro that will help the compiler provide better diagnostics when this<br>
>> code is compiled as C++11<br>
><br>
><br>
> We don't include any LLVM headers in compiler-rt libs. Do you think there is<br>
> a value in porting this macro?<br>
<br>
</div></div>Up to you - it's not a big deal, but it's perhaps convenient.<br>
<br>
(given that you're building the runtimes with the just-built Clang<br>
anyway, why not just build it as C++11 always & then you wouldn't need<br>
the compatibility macro & you could just use "= delete" directly?)<br></blockquote><div><br></div><div style>That's not true either :(</div><div style>In CMake build we use host compiler to build runtimes (of course, during a development</div>
<div style>we use "fresh enough clang" as a host, but that's not the general case). The runtime code</div><div style>is used in gcc as well.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5"><br>
><br>
>><br>
>> ><br>
>> >    const u32 tid;  // Thread ID. Main thread should have tid = 0.<br>
>> >    u64 unique_id;  // Unique thread ID.<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>
><br>
><br>
><br>
> --<br>
> Alexey Samsonov, MSK<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>