[PATCH] D124153: [CMake] Change default CMAKE_BUILD_TYPE to Release

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 11:39:50 PDT 2022


zero9178 added a comment.

I can also confirm that a Release build is a LOT easier to build than a debug build.

- 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)
- A debug build on Windows using MSVC can take around 70 to roughly 100 GB of storage space, which are always surprising and may also lead to out of disk space errors. Release builds are comparatively just a few Gigabytes. I believe they are also multiply tens of Gigabytes on other OSs
- Due to object file limits it is actually impossible to build Clang in debug mode when using a MinGW toolchain without building shared libs as the final linked clang executable is larger than 4GB.

I sadly don't currently have access to my Windows workstation where I actually build some of these configurations to have the precise numbers, but I think others will be able to confirm that they've had similar experiences.

While it is true that LLVM does require somewhat of a supercomputer to build, a release build is somewhat doable for the average user. My ultrabook that I use for when I am out and about has only 8 GB of RAM, which is absolutely enough to build a release build of LLVM on Fedora 35 without ever having RAM OOM issues or having to tweak any settings like job count.


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