<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 6, 2021, at 09:34, Ken Cunningham <<a href="mailto:ken.cunningham.webuse@gmail.com" class="">ken.cunningham.webuse@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 22, 2021 at 2:08 PM Louis Dionne via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" class="">libcxx-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jul 10, 2021, at 09:33, Isuru Fernando via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank" class="">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="">Hi Ken,<br class=""><br class="">I'm in the same situation as you in conda package manager.<br class="">Note that with libcxx 12, <a href="https://reviews.llvm.org/D91517" target="_blank" class="">https://reviews.llvm.org/<wbr class="">D91517</a> was merged where<div class="">codecvt with char8_t is added in the middle of a structure instead of at the end.<br class=""></div><div class="">This means that you have to be careful that all applications link to the custom libc++.<br class=""><br class=""></div><div class="">For libcxx developers,</div><div class=""><div class="">While we are discussing how to avoid ODR violations, is it possible to move the two lines at<br class=""><a href="https://github.com/llvm/llvm-project/blob/llvmorg-12.0.1/libcxx/src/locale.cpp#L210-L211" target="_blank" class="">https://github.com/llvm/llvm-<wbr class="">project/blob/llvmorg-12.0.1/<wbr class="">libcxx/src/locale.cpp#L210-<wbr class="">L211 </a><br class=""></div><div class="">to the bottom to avoid segfaults resulting from this?<br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Generally speaking, we make the assumption that there's a single copy of libc++ in use inside a final linked image. Or if you want to use libc++ as an implementation detail and link it statically, ensure it doesn't export any symbols and has absolutely no ABI surface outside of the executable where it's being used. Chrome does that.</div><div class=""><br class=""></div><div class="">Anything else is very brittle, and I'm reluctant to add workarounds that make it look like it works, because you may run into other issues that we won't be able to patch so easily.</div><div class=""><br class=""></div><div class="">Louis</div><div class=""></div></div></div><br class="">
</blockquote></div><div class=""><br class=""></div><div class="">I had thought libc++ was more immune to this kind of problem given Apple's usual support to deploy on older systems.</div></div></blockquote><div><br class=""></div><div>It can't really be immune to those problems since they are byproducts of how linking works at a pretty fundamental level. Back-deploying to older platforms works nicely as long as you use the libc++ shipped with the system (we make sure of that), or that you "embed" libc++ into your application by linking it as a static archive and disregard the system libc++ altogether (Chrome does that). When you do something in-between, that's when things start failing.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div class=""><br class=""></div><div class="">If the libc++ structures have changed and are now incompatible with previous versions of libc++, would that now mean that an Apple build system using the new libc++ structures can no longer target a deployment target with an older libc++ (any system prior to the change)?</div></div></blockquote><div><br class=""></div><div>There was no ABI breaking change to the libc++ structures in <a href="https://reviews.llvm.org/D91517" class="">https://reviews.llvm.org/D91517</a>. We still support the same back-deployment targets as before.</div><div><br class=""></div><div>Louis</div><div><br class=""></div></div></body></html>