<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 Oct 11, 2018, at 17:49, Eric Fiselier via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Oct 11, 2018 at 6:57 PM Richard Smith <<a href="mailto:richard@metafoo.co.uk" class="">richard@metafoo.co.uk</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">How do you see this interacting with the move to a git monorepository?</div></blockquote><div class=""><br class=""></div><div class="">Moving to a mono-repository alone would address most of the code sharing/duplication problems.</div><div class="">And if the move is forseeable, we could start the process now by making libc++abi require that libc++</div><div class="">is checked out next to it.</div><div class=""><br class=""></div><div class="">/Eric</div></div></div></div></blockquote><div><br class=""></div><div>I don't think that's the right order of changes.  It seems like a Git monorepo should come <i class="">before</i> introducing a dependency between repos.</div><div><br class=""></div><div>On the other hand, I don't see a fundamental problem with nesting libcxxabi inside of libcxx.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div dir="ltr" class="">On Wed, 10 Oct 2018 at 17:05, Eric Fiselier via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Hi All,<div class=""><br class=""></div><div class="">The status quo of libc++abi and libc++ requires the duplication of a lot of code and logic between the repositories, and often in ways that require the two be kept in perfect sync. As it stands now, this it too complicated. This email proposes putting libc++abi and libc++ into the same repository.</div><div class=""><br class=""></div><div class="">Before I go any further, I want to clarify what I'm NOT PROPOSING.</div><div class=""><br class="">I'm NOT proposing removing support for using libsupc++, libstdc++, or libcxxrt  as the runtime library under libc++. I'm NOT proposing absorbing libc++abi into libc++; they will remain distinct entities. In summary, If you use libc++ or libc++abi in a weird configuration today, then that should continue to work after this change.</div><div class=""><font size="4" class=""><br class=""></font></div><div class=""><font size="4" class="">The Problem</font></div><div class=""><font size="4" class="">==========</font></div><div class=""><br class=""></div><div class="">So why do I want to keep the two libraries together? Because the amount of duplication across libc++ and libc++abi is becoming unmaintainable, and that's causing bugs.</div><div class=""><br class=""></div><div class="">For example, libc++abi shipped a serious regression in the 7.0 release which caused thrown exceptions to have the wrong alignment, and in turn caused programs to segfault. It was caused because libc++abi forgot to define _LIBCPP_BUILDING_LIBRARY like libc++ does [1][2]. In the above case a bug was caused because libc++abi depended on libc++ internals, but it was not kept in sync with changes to libc++.</div><div class=""><br class=""></div><div class="">The goal of the merge is to prevent bugs like this from happening in the future.</div><div class=""><br class=""></div><div class="">libc++ and libc++abi also contain duplicate versions of large amounts of code, including the cpp files which implement <new>, <stdexcept>, <exception>, and <typeinfo>. The versions in libc++ and libc++abi should be *the exact same*, but we're forced to keep them in separate repositories. This causes bugs where one version isn't updated when the other gets a new feature or a bug fix [3].</div><div class=""><br class=""></div><div class="">Finally, libc++ and libc++abi could share almost all of their CMake and LIT configuration, but they don't. This introduces a serious but unneeded maintenance cost. Here's an example from today where the libc++ sanitizer configuration for Mac had to be copied into libc++abi verbatim. [4]</div><div class=""><font size="4" class=""><br class=""></font></div><div class=""><font size="4" class="">Solutions</font></div><div class=""><font size="4" class="">=======</font></div><div class=""><br class=""></div><div class="">I propose merging the libc++ and libc++abi repositories into one. The exact structure of this merged repository is TBD. For simplicity I'll assume we decide to move libc++abi INTO libc++.</div><div class=""><br class=""></div><div class="">There are some open questions:</div><div class=""><br class=""></div><div class=""><ol class=""><li class="">Should we create a new repository for this purpose? Or is it better to use libc++ as shared home (I vote for using libc++).<br class=""><br class=""></li><li class="">Should we do the same for libunwind?<br class=""><br class=""></li><li class="">We want to be able to build libc++ w/o libc++abi, but is the reverse true? Does anybody have an existing use case for building libc++abi w/o libc++?</li></ol></div><div class=""><br class=""></div><div class="">I look forward to the discussion this generates.</div><div class=""><br class=""></div><div class="">[1] <a href="http://llvm.org/PR39051" target="_blank" class="">llvm.org/PR39051</a></div><div class="">[2] Fix for PR39051 - <a href="https://github.com/llvm-mirror/libcxxabi/commit/ed902ff267148f3d76d33283766613056f57a06f" target="_blank" class="">r242815</a></div><div class="">[3] Copying libc++'s new into libc++abi - <a href="https://github.com/llvm-mirror/libcxxabi/commit/4bf15a00704552100c7ffcf92e93c8d3414c9b50" target="_blank" class="">r296787</a></div><div class="">[4] Duplicating more CMake configuration - <a href="https://github.com/llvm-mirror/libcxxabi/commit/6d635f5765e76c66d31a26cb4d5d5e802e274b4f" target="_blank" class="">r344191</a></div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div></div></div>
_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="">
</blockquote></div>
</blockquote></div></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></body></html>