Elektrine lite

← Feed

@edwintorok@discuss.systems

Post #1546581

2026-04-14 11:22 UTC

@david_chisnall @regehr if you have LTO enabled then linking becomes much slower, so running multiple linking jobs in parallel is still useful if your project consists of lots of executables. I noticed this when Fedora turned on LTO by default in GCC. Perhaps the build manager could look at the number and size of input files to the linker and try to limit parallelism based on that. E.g. you could probably link 2 executables in parallel if each uses 3 small inputs, but not if they use 1000 small inputs, or 3 large inputs. i.e. gave a budget of N linket inputs and M MiB and only launch additional linker jobs if this is not exceeded (with an exception to always launch the first if it is alone). But I don't know how to express this in any existing build system.

Replies (1)

  • @edwintorok @regehr I've never looked at GCC's implementation, but LLD's LTO is multithreaded unless you're doing 'full' LTO (which combines all of the IR and does compilation as if you had a single compilation unit), but no one would enable that as the default because it's really slow.

    Open ##1546585