<div dir="ltr">Hi Vedant,<div><br></div><div>Just want to confirm that this did indeed work for me; thanks!</div><div><br></div><div>Cheers,</div><div>Kevin<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 29, 2016 at 10:40 AM, Vedant Kumar <span dir="ltr"><<a href="mailto:vsk@apple.com" target="_blank">vsk@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You're hitting a bug which is fixed by this patch:<br>
<br>
<a href="https://reviews.llvm.org/D24990" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D24990</a><br>
[ubsan] Turn on 'Has CXXABI' to enable support for -fsanitize=vptr on Darwin<br>
<br>
As a workaround, try building with:<br>
<br>
-DSANITIZER_CAN_USE_CXXABI:<wbr>BOOL=ON<br>
<br>
vedant<br>
<div><div class="h5"><br>
> On Sep 29, 2016, at 10:23 AM, Kevin Ushey via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi everyone,<br>
><br>
> I'm running into some issues when attempting to link while using the 'undefined' sanitizer -- when linking my program, I'm getting errors of the form:<br>
><br>
> Undefined symbols for architecture x86_64:<br>
> "___ubsan_handle_dynamic_type_<wbr>cache_miss", referenced from: <...><br>
> "___ubsan_vptr_type_cache", referenced from: <...><br>
> ld: symbol(s) not found for architecture x86_64<br>
><br>
> Looking at the generated ubsan dynamic library, those symbols are not present:<br>
><br>
> kevin@cdrv:/usr/local/llvm/<wbr>db79113/lib/clang/4.0.0/lib/<wbr>darwin<br>
> $ nm libclang_rt.ubsan_osx_dynamic.<wbr>dylib | grep "ubsan_vptr_type_cache"<br>
><br>
> However, with clang-3.8 provided by Homebrew, these symbols are indeed present:<br>
><br>
> kevin@cdrv:/usr/local/Cellar/<wbr>llvm38/3.8.0/lib/llvm-3.8/lib/<wbr>clang/3.8.0/lib/darwin<br>
> $ nm libclang_rt.ubsan_osx_dynamic.<wbr>dylib | grep "ubsan_vptr_type_cache"<br>
> 0000000000b20c00 S ___ubsan_vptr_type_cache<br>
><br>
> which I think implies I'm probably missing some bit of configuration when building clang with sanitizers. For reference, I'm building the LLVM tree with:<br>
><br>
> cmake -G "Ninja" .. \<br>
> -DCMAKE_C_COMPILER=/usr/bin/<wbr>clang \<br>
> -DCMAKE_C_FLAGS="${INCLUDE_<wbr>FLAGS}" \<br>
> -DCMAKE_CXX_COMPILER=/usr/bin/<wbr>clang++ \<br>
> -DCMAKE_CXX_FLAGS="${INCLUDE_<wbr>FLAGS}" \<br>
> -DCMAKE_SHARED_LINKER_FLAGS="-<wbr>L/usr/local/lib" \<br>
> -DCMAKE_BUILD_TYPE=Release \<br>
> -DCMAKE_INSTALL_PREFIX="${<wbr>CMAKE_INSTALL_PREFIX}" \<br>
> -DLLVM_ENABLE_EH=Yes \<br>
> -DLLVM_ENABLE_RTTI=Yes<br>
> cmake --build .<br>
> cmake --build . --target install<br>
><br>
> This is built with 'clang' and 'lldb' checked out in the 'llvm/tools' folder, and 'compiler-rt', 'openmp', 'libcxx' and 'libcxxabi' checked out in the 'llvm/projects' folder, and the master branch from the various git mirrors for each project.<br>
><br>
> A bit of googling brought me to <a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150622/283017.html" rel="noreferrer" target="_blank">http://lists.llvm.org/<wbr>pipermail/llvm-commits/Week-<wbr>of-Mon-20150622/283017.html</a>, but I'm not sure if it's relevant to this particular issue.<br>
><br>
> Any idea what I could be missing?<br>
><br>
> Thanks,<br>
> Kevin<br>
</div></div>> ______________________________<wbr>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br>
</blockquote></div><br></div></div></div>