HardenedBSD/tools/build/options/WITH_LTOLIB
Shawn Webb 32522c8af9 HBSD: Compile (nearly) all of HardenedBSD world with LTO on amd64
As an initial first step towards supporting Cross-DSO CFI, build both
static and shared libraries with LTO. Prior to this commit, only
applications were compiled with LTO. This commit is somewhat
conservative in that we only turn LTO-ified libs on amd64. I plan to
enable LTO-ified libs on arm64 with additional testing.

Compiling all of base with LTO is incredibly memory intensive. In
memory-constrained systems, one may need to adjust how many make jobs
based on available memory (eg, `make -j 4` rather than `make -j 8`). As
of this commit, I do not have firm numbers.

To disable compiling libraries with LTO, set WITHOUT_LTOLIB in
src.conf(5).

Bump __HardenedBSD_version to account for this change. When arm64
support is added, an additional bump will be done.

As of right now, there is no plan to MFC to 13-STABLE.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
Issue:		#54
2021-05-28 09:54:58 -04:00

2 lines
51 B
Plaintext

Set to build static and shared libraries with LTO.