<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt">Hi Jean-Daniel!<div><br></div><div>I've applied parts of your patches relevant to Linux+make build support in r168038, r168039.</div><div><br><div class="gmail_quote">
On Thu, Nov 15, 2012 at 12:34 AM, Jean-Daniel Dupas <span dir="ltr"><<a href="mailto:devlists@shadowlab.org" target="_blank">devlists@shadowlab.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div>Le 14 nov. 2012 à 21:11, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> a écrit :</div><br><blockquote type="cite"><div>
<div class="h5">On Wed, Nov 14, 2012 at 7:40 AM, Sean McBride <<a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a>> wrote:<br><blockquote type="cite">On Tue, 13 Nov 2012 16:17:39 -0800, Richard Smith said:<br>
<br><blockquote type="cite">Thanks for the prod, I've checked in some pending patches to add OS X<br>support, in r167888, r167889, and r167890. If you could build<br>clang_rt.ubsan_osx and let me know whether everything is working as<br>
intended, that'd be great; we can then ask to get those patches pulled<br>onto the 3.2 branch.<br></blockquote><br>I've rebuilt clang r167897 and still get link errors, ex:<br><br>Undefined symbols for architecture x86_64:<br>
  "___ubsan_handle_shift_out_of_bounds", referenced from:<br></blockquote><br>I don't have a Darwin machine to test against. Does the attached patch help?<br></div></div><span><driver-ubsan-darwin.diff></span></blockquote>
</div><div><br></div><div>This patch is definitively a step in the right direction. </div><div><br></div><div>We need to tweak to clang runtime makefile to tell it to build ubsan on OS X (ubsan-make.patch).</div><div><br>
</div><div>Also, in the previous compiler-rt patch has an issue. It neither builds sanitize-common objects, not include them in the ubsan archive.</div><div>I fix this by looking at how asan is actually built (ubsan.patch). Note that this patch make the previous change to the compiler-rt SDK headers useless, as building sanitizer-common requires a full SDK, and so we now use the system headers instead of the headers provided by compiler-rt.</div>
<div><br></div><div>But I hit a blocking issue that I don't know how to workaround.</div><div>AFAIK, on darwin, there is no library that currently provide "typeinfo for std::type_info".</div><div>The libc++abi provided by OS X does not properly export this symbol (and other typeinfo related symbols). As ubsan_type_hash.cpp require them, trying to link a software with the libubsan produce the following error:</div>
<div><br></div><div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">  "typeinfo for __cxxabiv1::__class_type_info", referenced from:</div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">
      __ubsan::checkDynamicType(void*, void*, unsigned long) in libclang_rt.ubsan_osx.a(ubsan_type_hash.o)</div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">      isDerivedFromAtOffset(__cxxabiv1::__class_type_info const*, __cxxabiv1::__class_type_info const*, long) in libclang_rt.ubsan_osx.a(ubsan_type_hash.o)</div>
<div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">  "typeinfo for std::type_info", referenced from:</div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">      vtable for testing::internal::ExecDeathTest in gtest-all.o</div>
<div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">      __ubsan::checkDynamicType(void*, void*, unsigned long) in libclang_rt.ubsan_osx.a(ubsan_type_hash.o)</div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">
  "typeinfo for __cxxabiv1::__si_class_type_info", referenced from:</div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">      isDerivedFromAtOffset(__cxxabiv1::__class_type_info const*, __cxxabiv1::__class_type_info const*, long) in libclang_rt.ubsan_osx.a(ubsan_type_hash.o)</div>
<div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">  "typeinfo for __cxxabiv1::__vmi_class_type_info", referenced from:</div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">
      isDerivedFromAtOffset(__cxxabiv1::__class_type_info const*, __cxxabiv1::__class_type_info const*, long) in libclang_rt.ubsan_osx.a(ubsan_type_hash.o)</div></div><div style="margin:0px 0px 0px 12px;font-size:11px;font-family:Menlo">
<br></div><div><br></div><div>Does someone with more knowledge about this subject can help ?</div><span class="HOEnZb"><font color="#888888"><div><br></div><br><div>
<span style="border-collapse:separate;border-spacing:0px"><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br>

</div>
</font></span></div><br><div style="word-wrap:break-word"></div><br><div style="word-wrap:break-word"></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div><br>
</div></div>