<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 15, 2015 at 10:06 PM, Yury Gribov <span dir="ltr"><<a href="mailto:y.gribov@samsung.com" target="_blank">y.gribov@samsung.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 02/14/2015 01:43 AM, Alexey Samsonov wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Feb 11, 2015 at 11:41 PM, Yury Gribov <<a href="mailto:y.gribov@samsung.com" target="_blank">y.gribov@samsung.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 02/11/2015 11:01 PM, Alexey Samsonov wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Feb 11, 2015 at 12:37 AM, Yury Gribov <<a href="mailto:y.gribov@samsung.com" target="_blank">y.gribov@samsung.com</a>><br>
wrote:<br>
<br>
  On 02/11/2015 09:04 AM, Yury Gribov wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  On 02/11/2015 06:07 AM, Justin Bogner wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  Alexey Samsonov <<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a>> writes:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  Ah, right...<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Feel free to revert this change. I have plans to deal with different<br>
UBSan<br>
initialization issues soon, and will see if I would be able to<br>
reinstantiate<br>
this warning on all platforms.<br>
<br>
<br>
</blockquote>
Reverted in r228795.<br>
<br>
<br>
</blockquote>
Can't we just move initializer to separate file for which we then<br>
disable this warning?<br>
<br>
<br>
</blockquote>
Does something like this make sense? It passes tests on Linux x64. I<br>
haven't verified OSX but I can see that -Wglobal-constructors is indeed<br>
disabled for ubsan_init.cc.<br>
<br>
</blockquote>
<br>
<br>
In fact, I wanted to split UBSan runtime into three parts: UBSan<br>
(UBSAN_SOURCES without ubsan_init.cc), UBSanCXX (UBSAN_CXX_SOURCES) and<br>
UBSanStandalone (~ubsan_init.cc).<br>
Standalone UBSan would contain all three of them, while the first two<br>
would<br>
also be embedded into ASan runtime. After we do this separation, it would<br>
be easy<br>
to specify -Wglobal-constructors just for UBSan and UBSanCXX.<br>
<br>
</blockquote>
<br>
I wonder if we should move ubsan_init.cc to ubsan_init.o and prelink it<br>
similar to how we do this with asan_preinit.o.<br>
</blockquote>
<br>
<br>
Not sure I understand this. We don't have shared UBSan runtime at the<br>
moment.<br>
</blockquote>
<br></div></div>
Ah, another time I got hit by incompatibilities between GCC and LLVM sanitizers. Are there plans for dynamic runtime by the way? This could simplify (or actually make possible) separate sanitization of shared libraries.</blockquote><div><br></div><div>Yeah, we could probably add a similar way to use shared UBSan runtime on Linux (mimic ASan approach, with libubsan.so, libubsan-preinit.a, etc.)). Note, however, that we will *not* support linking against</div><div>both ASan and standalone UBSan runtime, as each of them will have its own copy of sanitizer_common.</div></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>