<div dir="ltr"><div>That's useful to know and not something I was aware of, this might be a sufficient reason to alter the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR layout and move libc++ out of the resource directory.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 25, 2019 at 2:32 AM Ilya Biryukov <<a href="mailto:ibiryukov@google.com">ibiryukov@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">> From this point of view, what LLVM_ENABLE_PER_TARGET_RUNTIME_DIR breaks the tools and the proposed alternative fixes this problem<div>what  LLVM_ENABLE_PER_TARGET_RUNTIME_DIR <b>does now </b>...</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 25, 2019 at 11:31 AM Ilya Biryukov <<a href="mailto:ibiryukov@google.com" target="_blank">ibiryukov@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Using the resource-dir in the header search paths would break tools that use compilation database, e.g. clang-tidy and clangd.<div>They override the resource-dir as it's very common for them to be built from a different revision than the used compiler. They rely on the fact that the same standard library can be found with the overridden resouce-dir.</div><div><br></div><div>From this point of view, what LLVM_ENABLE_PER_TARGET_RUNTIME_DIR breaks the tools and the proposed alternative fixes this problem.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 25, 2019 at 11:17 AM Petr Hosek via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Wed, Feb 20, 2019 at 6:14 PM Joel E. Denny <<a href="mailto:jdenny.ornl@gmail.com" target="_blank">jdenny.ornl@gmail.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
My alternative to LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is the preceding<br>
bullets.  In other words, you wouldn't need to specify<br>
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR because it would effectively be<br>
always on (except the directories might be different than now if the<br>
version locking issue is important, as noted above).  Is that what<br>
you're asking?<br></blockquote><div><br></div><div>That would be my preference. I always hoped that LLVM_ENABLE_PER_TARGET_RUNTIME_DIR would eventually become the default. It would be nice to finish the Darwin support so we can completely deprecate the old layout, but I don't know how far along beanz is in his effort. We should also update openmp to stop using the custom Android-specific runtime layout.</div><div><br></div><div>There's also the unresolved question of where should libc++ headers and libraries go. Currently, in LLVM_ENABLE_PER_TARGET_RUNTIME_DIR we use the resource dir, but some people expressed the opinion that we shouldn't be using these for libc++ et al. since they're not version-locked to Clang. This is different from what GCC does (e.g. GCC would use $prefix/lib/gcc/x86_64-linux-gnu/8/libstdc++.a) and it's one of the reasons why I used the resource dir for libc++ et al. when implementing LLVM_ENABLE_PER_TARGET_RUNTIME_DIR.</div><div><br></div><div>So concretely, today LLVM_ENABLE_PER_TARGET_RUNTIME_DIR uses the following layout:</div><div><br></div><div><div>headers: $prefix/lib/clang/$version/include(/$triple)(/c++/v1)</div><div>libraries: $prefix/lib/clang/$version/$triple/lib/$name.$ext</div></div><div><br></div><div>The alternative that doesn't use resource dir for libc++ would be the following:</div><div><br></div><div><div>compiler-rt:</div><div>  headers: $prefix/lib/clang/$version/include</div><div>  libraries: $prefix/lib/clang/$version/$triple/lib/$name.$ext</div><div><br></div><div>libc++, libc++abi, libunwind:</div><div>  headers: $prefix/include/c++/v1</div><div>  libraries: $prefix/lib/$triple/$name.$ext</div><div><br></div><div>Making this change should be trivial, it's the matter of changing three CMakeLists.txt files (<a href="https://github.com/llvm/llvm-project/blob/master/libunwind/CMakeLists.txt#L189" target="_blank">libunwind</a>, <a href="https://github.com/llvm/llvm-project/blob/master/libcxxabi/CMakeLists.txt#L179" target="_blank">libc++abi</a> and <a href="https://github.com/llvm/llvm-project/blob/master/libcxx/CMakeLists.txt#L419" target="_blank">libc++</a>) and Clang driver <a href="https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/ToolChain.cpp#L79" target="_blank">in one place</a>. However, if we're going to make that change, I'd like to get a broader consensus. It'd be also useful to get feedback from libc++ maintainers on this.</div></div></div></div></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-2207674420983085819gmail-m_-1747776127329268296gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-2207674420983085819gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div><div>Ilya Biryukov</div></div></div></div></div>
</blockquote></div></div>