When using ThinLTO, the linker performs its own parallelism. This
change limits the number of parallel link jobs that Ninja will issue
to keep the total number of threads reasonable when linking with
ThinLTO.
Details
Diff Detail
- Build Status
Buildable 5545 Build 5545: arc lint + arc unit
Event Timeline
Alternatively, we could limit the parallelism of the link jobs, but limiting the number of link jobs is better, because it avoids having to wait a very long time for the last link job. For the same reason, the number of concurrent link jobs is 2 rather than 1.
cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
20 | This code is unchanged, but has been moved up to make uppercase_LLVM_ENABLE_LTO available when setting the number of link jobs. |
This will emit a warning when ThinLTO is enabled and the build system is not Ninja. I'll cook up a version that inhibits that warning.
- No warning when not using Ninja.
- Simplified the change.
- Fixed buggy behavior on Linux.
This code is unchanged, but has been moved up to make uppercase_LLVM_ENABLE_LTO available when setting the number of link jobs.