Page MenuHomeFreeBSD

Convert libllvm, libclang and liblldb into private shared libraries
ClosedPublic

Authored by dim on Apr 22 2025, 6:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 6, 9:15 PM
Unknown Object (File)
Sat, Nov 29, 10:36 PM
Unknown Object (File)
Sat, Nov 29, 2:06 AM
Unknown Object (File)
Fri, Nov 28, 11:20 AM
Unknown Object (File)
Fri, Nov 28, 7:38 AM
Unknown Object (File)
Fri, Nov 28, 12:21 AM
Unknown Object (File)
Thu, Nov 27, 3:33 PM
Unknown Object (File)
Thu, Nov 27, 9:45 AM

Details

Summary

This allows clang, lld, lldb, and other llvm tools to be linked against
these shared libraries, which makes them smaller and avoids duplication.

Since these are not quite the same as the shared libraries shipped by
the upstream llvm build system, and we do not want to expose the ABI to
external programs such as ports, make them private libraries.

Note that during the cross-tools stage they are still built as static
libraries, so the cross compiler and linker are static binaries, as they
have always been.

This also requires a depend-cleanup.sh kludge, to ensure binaries are
rebuilt against the shared libraries in case of incremental builds.

NOTE: Requires D49966 to be committed first.

MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim requested review of this revision.Apr 22 2025, 6:49 PM
dim created this revision.

Add workaround for powerpc "relocation R_PPC_GOT16 out of range" errors.

Add OptionalObsoleteFiles.inc entries.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 25 2025, 6:00 PM
This revision was automatically updated to reflect the committed changes.

It turns out that this change looks to have notable port-package build time consequences for at least aarch64 on ampere[123] and on, for example, the Microsoft Dev Kit 2023 that I have access to.

Examples (not trying to show variability):

38:25:51 14.3-RELEASE -> 53:33:46 15.0-RELEASE, ratio about 1.39, for qt6-webengine-6.9.3 on the ampere*'s
15:24:24 14.3-RELEASE -> 21:26:14 15.0-RELEASE, ratio about 1.39, for llvm21-21.1.2 on the ampere*'s
00:09:18 14.3-RELEASE -> 00:12:19 14.3-STABLE, ratio about 1.32, for cmake-core-3.31.9 on the Microsoft Dev Kit 2023 (using all 8 cores)

The time vs. memory use tradeoff and which should be the default if control is allowed over the choice probably needs consideration for if something should change.

Note: the more detailed exploration was done on the Microsoft Dev Kit 2023. But the exploration was made in light of pre-existing ampere* data that was available. Builds were via poudriere-devel on the Dev Kit. The ampere* data is from official FreeBSD port-package build activity.

https://lists.freebsd.org/archives/freebsd-stable/2025-December/003702.html includes the comparison/contrast with 14.3-STABLE, which has fewer changes involved overall than 15.0-RELEASE does, eliminating those extra changes from consideration as a primary source of the multiplication factors involved.

Things like lang/gcc15 do not show such large factors as only a small part of its bootstrap sequence is clang/clang++ based for the default way of building.