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) #89000

Merged
merged 1 commit into from
Apr 17, 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.

(cherry picked from commit 0d2bb7f)

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 16, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 16, 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.

(cherry picked from commit 0d2bb7f)


Full diff: https://github.com/llvm/llvm-project/pull/89000.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 "")
 

@tstellar tstellar added this to the LLVM 18.X Release milestone 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 tstellar merged commit e6c3289 into llvm:release/18.x Apr 17, 2024
9 of 10 checks passed
@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
Projects
Development

Successfully merging this pull request may close these issues.

2 participants