src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knob

In commit 2e47f35be5 libllvm, libclang and liblldb were converted into
private shared libraries. This allowed clang, lld, lldb, and other llvm
tools to be linked against these shared libraries, which makes them
smaller and avoids duplication.

However, this also comes at the cost of some performance, since the
dynamic libraries are quite large, and contain lots of long symbols
(mangled C++ identifiers).

Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go
back to the previous behavior: libllvm, libclang and liblldb are built
as internal static libraries, i.e. only available during buildworld, and
fully linked into the various executables such as clang, lld, etc.

PR:		287447
Reviewed by:	emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D50956
This commit is contained in:
Dimitry Andric
2025-06-18 12:06:25 +02:00
parent 5819f8b285
commit 8d5a11cd01
13 changed files with 61 additions and 17 deletions
+8 -1
View File
@@ -1,5 +1,5 @@
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
.Dd December 15, 2025
.Dd December 21, 2025
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -999,6 +999,13 @@ Install ELF Tool Chain's cxxfilt as c++filt, instead of LLVM's llvm-cxxfilt.
.It Va WITH_LLVM_FULL_DEBUGINFO
Generate full debug information for LLVM libraries and tools, which uses
more disk space and build resources, but allows for easier debugging.
.It Va WITH_LLVM_LINK_STATIC_LIBRARIES
Link LLVM libraries (libllvm, libclang, liblldb) statically into each of
the binaries that use them.
This means that binaries linked against these libraries, such as clang,
ld.lld and lldb will be much larger and position dependent, but will
start more quickly.
.It Va WITHOUT_LLVM_TARGET_AARCH64
Do not build LLVM target support for AArch64.
The
+1
View File
@@ -213,6 +213,7 @@ __DEFAULT_NO_OPTIONS = \
LOADER_VERBOSE \
LOADER_VERIEXEC_PASS_MANIFEST \
LLVM_FULL_DEBUGINFO \
LLVM_LINK_STATIC_LIBRARIES \
MALLOC_PRODUCTION \
OFED_EXTRA \
OPENLDAP \