[PATCH] D124153: [CMake] Change default CMAKE_BUILD_TYPE to Release
Aaron Puchert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 22 16:02:03 PDT 2022
aaronpuchert added a comment.
In D124153#3468447 <https://reviews.llvm.org/D124153#3468447>, @zero9178 wrote:
> - Linker OOMs are mainly caused by large object files, both due to code size of unoptimized code and especially due to the extra debug info. Hence the first recommendation in any of the forums when people show a linker OOM is to make sure they're using a release build, if that is what they intended, and to use LLD or Gold (that is a separate topic however)
Dropping debug info solves the problem, but then you don't have debug info. You can still build with debug info if you use `BUILD_SHARED_LIBS=ON` and/or `LLVM_USE_SPLIT_DWARF=ON` on platforms that support it.
Another helpful option is `LLVM_PARALLEL_LINK_JOBS` (only works with Ninja though).
In D124153#3468675 <https://reviews.llvm.org/D124153#3468675>, @nikic wrote:
> Apart from being slow to build, debug builds also make running tests prohibitively slow.
It depends. I work on specific warnings usually and then do `llvm-lit -sv $(git grep -l Wwarning clang/test/)`. That takes a couple of seconds regardless of the build profile. Running all tests takes a few minutes in Release, I don't have the patience for that. ;)
Otherwise I run larger subsets, like all `Sema` tests or all `Parser` tests and so on. Similarly if you're doing backend work in LLVM you might subset to that backend.
> [Debug is] not a configuration I would recommend for routine development, and certainly not something I would recommend to new developers.
Quite a number of people I work with are completely lost if they can't step through code. And since we're talking about newbies here... it takes some experience to find bugs without a debugger.
In D124153#3467419 <https://reviews.llvm.org/D124153#3467419>, @thieta wrote:
> The only real downside to it I can see right now is that I haven't seen many other projects behave in this way - so it would set LLVM apart, but on the other hand - as you point out: LLVM is big and building the "wrong" configuration has bigger ramification than for example "zlib".
Well put. We're probably the outlier if we were to force a choice. But the costs of getting it wrong are high and so I think we're acting in the best interests of all users, including new ones. LLVM isn't a quick build anyway, so let them take a minute to think about what they want.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124153/new/
https://reviews.llvm.org/D124153
More information about the llvm-commits
mailing list