<div style="font-family: arial, helvetica, sans-serif"><font size="2">Hello folks,<div><br></div><div>TL;DR: When working on better/simpler CMake suport for Clang/LLVM I am often thwarted by one of the most complex parts of the Clang setup: the ability to do a "standalone" build of Clang. I would like to get rid of this feature in order to simplify and make more progress. Any objections?</div>
<div><br></div><div><br></div><div>Most people don't even know what the "standalone" build is, so in summary it allows you to check out *just* clang and to build it against a separate checkout and build tree of LLVM. It doesn't re-use the build output tree of LLVM, or the source tree of LLVM.</div>
<div><br></div><div>Why does this exist? I'll try to summarize the points from the last time I talked to Doug about it, but honestly, I don't use this so I may mess it up. I've CC-ed Doug who is (I suspect) one of the few using it to clarify anything I miss:</div>
<div>1) It allows updating the LLVM source checkout and build tree less frequently than the Clang checkout and build tree.</div><div>2) It allows sharing a single LLVM checkout and build tree amongst many Clang checkouts and build trees.</div>
<div>3) ???</div><div><br></div><div>Certainly #1 and #2 can (in some cases) combine to improve incremental rebuild speed, but in practice I rarely benefit from them as the time is now heavily dominated by running the test suite. Thus, I see this benefit as diminishing these days, and also as offset by improved performance of CMake, especially when coupled with the bleeding edge ninja system.</div>
<div><br></div><div><br></div><div>Now, why do I want to get rid of this? What is it preventing or getting in the way of?</div><div>1) Remove duplication! Massive amounts of the CMake infrastructure of LLVM are copied into Clang's CMake build in order for the latter to not depend on the former. What's worse, these copies have evolved independently and now often diverge, duplicate bugs, and sometimes give birth to their own bugs.</div>
<div><br></div><div>2) Remove duplication! The 'lit' based test running is needlessly duplicated in Clang's CMake build. It is also incorrect, missing dependencies, and behaving differently from LLVM's. Yep. 'make check && make clang-test' does not in fact test the same thing as 'make check-all'. Scary, eh?</div>
<div><br></div><div>3) Integrate with CompilerRT: This comes out of the LLVM projects subtree, and so is inherently missing in a stand-alone build.</div><div><br></div><div>4) Integrate with libc++: Same story as CompilerRT.</div>
<div><br></div><div>5) Integrate support for automatic bootstrapping: This will be among the most complex things to add to our CMake builds, but also one of the highest value. I'd really like to not spend time thinking about how this interacts with Clang's standalone cmake bits, but I have to as long as its there.</div>
<div><br></div><div><br></div><div>So, thoughts?</div><div>-Chandler</div></font></div>