[clang] [CMake][Release] Disable PGO (PR #88465)

Tom Stellard via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 18:17:04 PDT 2024


https://github.com/tstellar created https://github.com/llvm/llvm-project/pull/88465

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.

>From 9ebb7efc47a76902fcce078eca4e371d3cf99b68 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 12 Apr 2024 01:10:45 +0000
Subject: [PATCH] [CMake][Release] Disable PGO

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.
---
 clang/cmake/caches/Release.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 "")
 



More information about the cfe-commits mailing list