Hacker News new | ask | show | jobs
by tsavola 3813 days ago
> LTO fixes the "source analysis and optimization across compilation units problem" by annotating object files with intermediate representation so source-aware optimizations can be carried out across compilation units at link time (this slows down the linking process noticeably, but make -j helps).

make -j doesn't help linking speed, unless multiple binaries are begin built.

2 comments

gcc has `-flto=n` to use n cores for the link-time optimization. clang doesn't like that syntax though, but I think it does parallel LTO automatically.
It's not the linking process that make -j speeds up, but the optimization part.
AFAIK the bulk of link time optimization happens in the linker. The parallelizable compiler invocations just store extra information in the object files.

The linker invocation is a single make job, which is the unit of make -j parallelism.