Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake][Release] Disable PGO #88465

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

tstellar
Copy link
Collaborator

Running the test-release.sh script with PGO enabled causes build errors like:

ld.lld: error: Function Import: link error: linking module flags 'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being generated unconditionally. If you run ninja check-all and then ninja install like we do in test-release.sh, then the profile data is regenerated during ninja install and some of the clang tools which are not test dependencies get build during the ninja install step with different profile data. When these tools link against the LLVM libraries, like libSupport, we end up with these errors.

Running the test-release.sh script with PGO enabled causes build errors
like:

ld.lld: error: Function Import: link error: linking module flags 'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being
generated unconditionally.  If you run `ninja check-all` and then
`ninja install` like we do in test-release.sh, then the profile data
is regenerated during `ninja install` and some of the clang tools
which are not test dependencies get build during the ninja install
step with different profile data.  When these tools link against the
LLVM libraries, like libSupport, we end up with these errors.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 12, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 12, 2024

@llvm/pr-subscribers-clang

Author: Tom Stellard (tstellar)

Changes

Running the test-release.sh script with PGO enabled causes build errors like:

ld.lld: error: Function Import: link error: linking module flags 'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being generated unconditionally. If you run ninja check-all and then ninja install like we do in test-release.sh, then the profile data is regenerated during ninja install and some of the clang tools which are not test dependencies get build during the ninja install step with different profile data. When these tools link against the LLVM libraries, like libSupport, we end up with these errors.


Full diff: https://github.com/llvm/llvm-project/pull/88465.diff

1 Files Affected:

  • (modified) clang/cmake/caches/Release.cmake (+1-1)
diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index 1ca9138b980731..bd1f688d61a7ea 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -4,7 +4,7 @@
 
 # General Options
 set(LLVM_RELEASE_ENABLE_LTO THIN CACHE STRING "")
-set(LLVM_RELEASE_ENABLE_PGO ON CACHE BOOL "")
+set(LLVM_RELEASE_ENABLE_PGO OFF CACHE BOOL "")
 
 set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
 

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I've run into the issue where profile data is generated again where it shouldn't be. I've meant to open up an issue and look into it at some point, but haven't had time to do so. I haven't previously run into this causing recompilations, but the outlined flow makes sense.

I'm assuming this is a stop-gap, and the plan is to eventually fix the issue and reenable PGO in the release cache?

@tstellar
Copy link
Collaborator Author

I'm assuming this is a stop-gap, and the plan is to eventually fix the issue and reenable PGO in the release cache?

Yes, I would like to fix this at some point, but not sure when I'll get to it.

@tstellar tstellar merged commit 0d2bb7f into llvm:main Apr 12, 2024
6 checks passed
@tstellar tstellar added this to the LLVM 18.X Release milestone Apr 12, 2024
@tstellar
Copy link
Collaborator Author

/cherry-pick 0d2bb7f)

@llvmbot
Copy link
Member

llvmbot commented Apr 12, 2024

Failed to cherry-pick: 0d2bb7f)

https://github.com/llvm/llvm-project/actions/runs/8668528827

Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request

bazuzi pushed a commit to bazuzi/llvm-project that referenced this pull request Apr 15, 2024
Running the test-release.sh script with PGO enabled causes build errors
like:

ld.lld: error: Function Import: link error: linking module flags
'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being
generated unconditionally. If you run `ninja check-all` and then `ninja
install` like we do in test-release.sh, then the profile data is
regenerated during `ninja install` and some of the clang tools which are
not test dependencies get build during the ninja install step with
different profile data. When these tools link against the LLVM
libraries, like libSupport, we end up with these errors.
tstellar added a commit to tstellar/llvm-project that referenced this pull request Apr 16, 2024
Running the test-release.sh script with PGO enabled causes build errors
like:

ld.lld: error: Function Import: link error: linking module flags
'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being
generated unconditionally. If you run `ninja check-all` and then `ninja
install` like we do in test-release.sh, then the profile data is
regenerated during `ninja install` and some of the clang tools which are
not test dependencies get build during the ninja install step with
different profile data. When these tools link against the LLVM
libraries, like libSupport, we end up with these errors.

(cherry picked from commit 0d2bb7f)
@tstellar
Copy link
Collaborator Author

PR is here: #89000

tstellar added a commit to tstellar/llvm-project that referenced this pull request Apr 17, 2024
Running the test-release.sh script with PGO enabled causes build errors
like:

ld.lld: error: Function Import: link error: linking module flags
'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being
generated unconditionally. If you run `ninja check-all` and then `ninja
install` like we do in test-release.sh, then the profile data is
regenerated during `ninja install` and some of the clang tools which are
not test dependencies get build during the ninja install step with
different profile data. When these tools link against the LLVM
libraries, like libSupport, we end up with these errors.

(cherry picked from commit 0d2bb7f)
tstellar added a commit that referenced this pull request Apr 17, 2024
Running the test-release.sh script with PGO enabled causes build errors
like:

ld.lld: error: Function Import: link error: linking module flags
'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being
generated unconditionally. If you run `ninja check-all` and then `ninja
install` like we do in test-release.sh, then the profile data is
regenerated during `ninja install` and some of the clang tools which are
not test dependencies get build during the ninja install step with
different profile data. When these tools link against the LLVM
libraries, like libSupport, we end up with these errors.

(cherry picked from commit 0d2bb7f)
tstellar added a commit to tstellar/llvm-project that referenced this pull request Apr 25, 2024
Running the test-release.sh script with PGO enabled causes build errors
like:

ld.lld: error: Function Import: link error: linking module flags
'ProfileSummary': IDs have conflicting values

I believe this a build system bug due to the PGO profile data being
generated unconditionally. If you run `ninja check-all` and then `ninja
install` like we do in test-release.sh, then the profile data is
regenerated during `ninja install` and some of the clang tools which are
not test dependencies get build during the ninja install step with
different profile data. When these tools link against the LLVM
libraries, like libSupport, we end up with these errors.
@pointhex pointhex mentioned this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category release:cherry-pick-failed
Projects
Development

Successfully merging this pull request may close these issues.

3 participants