<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 14 nov. 2012 à 21:11, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Nov 14, 2012 at 7:40 AM, Sean McBride <<a href="mailto:sean@rogue-research.com">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><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; text-indent: -12px; font-size: 11px; font-family: Menlo; ">  "typeinfo for __cxxabiv1::__class_type_info", referenced from:</div><div style="margin: 0px 0px 0px 12px; text-indent: -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; text-indent: -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; text-indent: -12px; font-size: 11px; font-family: Menlo; ">  "typeinfo for std::type_info", referenced from:</div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; font-size: 11px; font-family: Menlo; ">      vtable for testing::internal::ExecDeathTest in gtest-all.o</div><div style="margin: 0px 0px 0px 12px; text-indent: -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; text-indent: -12px; font-size: 11px; font-family: Menlo; ">  "typeinfo for __cxxabiv1::__si_class_type_info", referenced from:</div><div style="margin: 0px 0px 0px 12px; text-indent: -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; text-indent: -12px; font-size: 11px; font-family: Menlo; ">  "typeinfo for __cxxabiv1::__vmi_class_type_info", referenced from:</div><div style="margin: 0px 0px 0px 12px; text-indent: -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; text-indent: -12px; font-size: 11px; font-family: Menlo; "><br></div><div><br></div><div>Does someone with more knowledge about this subject can help ?</div><div><br></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
</body></html>