On Fri, Apr 30, 2021 at 06:48:11PM -0700, Nick Desaulniers wrote:
On Fri, Apr 30, 2021 at 6:22 PM Linus Torvalds
0.92% libLLVM-12.so llvm::StringMapImpl::LookupBucketFor
^ wait a minute; notice how in your profile the `Shared Object` is
attributed to `libLLVM-12.so` while mine is `clang-13`? Clang can be
built as either having libllvm statically linked or dynamically; see
the cmake variables
I think those are frowned upon; useful for cutting down on developers
iteration speed due to not having to relink llvm when developing
clang. But shipping that in production? I just checked and it doesn't
look like we do that for AOSP's build of LLVM.
There's also `-DLLVM_ENABLE_LTO=Thin` that enables LTO for building LLVM
and Clang themselves, considered they can be bootstrapped like this
using a previous version of Clang. Combining that with a non-shared
library build mode for both Clang and LLVM, the result is possibly the
fastest and most optimized build that is achievable. Unfortunately I
see distributions neglecting to enable this in packaging this as well.
On a side note, I'm also a Fedora user and agree with Linus about this.
I'd like to see an opt-in bypass of the shared library policy via
something like `dnf install clang-optimized` that would install the
fastest and most optimized Clang build regardless of RPM install size.