[Bug 261977] lang/gcc12-devel: enable LTO

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 28 Mar 2022 11:11:44 UTC

--- Comment #14 from Dimitry Andric <dim@FreeBSD.org> ---
LTO is a trade-off, where you sacrifice more memory and CPU at link time for
possibly faster and/or smaller final binaries. That it eats more resources is
almost guaranteed, but slightly "better" binaries may not be worth the cost...

(Side note: one annoying aspect is that because it can be so time consuming,
these heavy link jobs tend to cluster up, if you do a multi-jobbed build,
either via poudriere or some other build system. Which then means that you have
a bunch of huge linking processes running in parallel, eating up even more

That said, I would say the safe, conservative choice is to make use of LTO an
opt-in (either global, or per port), instead of an opt-out?

I mean, if you have a huge machine with plenty of CPU and RAM, then by all
means LTO the hell out of everything, but most people aren't that lucky (or
rich). :-)

You are receiving this mail because:
You are on the CC list for the bug.