4 ms·
> LTO fixes the "source analysis and optimization across compilation units problem" by annotating object files with intermediate representation so source-aware
by tsavola 11y 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.
- delinka 11y agoIt's not the linking process that make -j speeds up, but the optimization part.
- tsavola 11y agoAFAIK 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.
- deleted 11y ago[deleted]
- lorenzhs 11y agogcc 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.