-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][cmake] Fixes for PGO builds when invoking ninja twice (#92591)
This fixes two problems with the 2-stage PGO builds. The first problem was that the stage2-instrumented and stage2 targets would not be built on the second ninja invocation. For example: This would work as expected. $ ninja -v -C build stage2-instrumented-generate-profdata Edit a file. $ touch llvm/lib/Support/StringExtras.cpp This would rebuild stage1 only and not build stage2-instrumented or regenerate the profile data. $ ninja -v -C build stage2-instrumented-generate-profdata The second problem was that in some cases, the profile data would be regenerated, but not all of the stage2 targets would be rebuilt. One common scenario where this would happen is: This would work as expected. $ ninja -C build stage2-check-all This would regenerate the profile data, but then only build the targets that were needed for install, but weren't needed for check-all. This would cause errors like: ld.lld: error: Function Import: link error: linking module flags 'ProfileSummary': IDs have conflicting values in ... This is because the executibles being built for the install target used the new profile data, but they were linking with libraries that used the old profile data. $ ninja -C build stage2-install With this change we can re-enable PGO for the release builds.
- Loading branch information
Showing
3 changed files
with
21 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters