Skip to content

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Jul 29, 2025

Backport cff9ae7

Requested by: @tstellar

@llvmbot
Copy link
Member Author

llvmbot commented Jul 29, 2025

@nikic What do you think about merging this PR to the release branch?

@llvmbot llvmbot requested a review from nikic July 29, 2025 22:40
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jul 29, 2025
@llvmbot
Copy link
Member Author

llvmbot commented Jul 29, 2025

@llvm/pr-subscribers-clang

Author: None (llvmbot)

Changes

Backport cff9ae7

Requested by: @tstellar


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

2 Files Affected:

  • (modified) clang/cmake/caches/Release.cmake (+5-1)
  • (added) clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake (+5)
diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index fb12dfcdcb5a5..a523cc561b3f9 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -102,7 +102,7 @@ if (LLVM_RELEASE_ENABLE_LTO)
   # FIXME: We can't use LLVM_ENABLE_LTO=Thin here, because it causes the CMake
   # step for the libcxx build to fail.  CMAKE_INTERPROCEDURAL_OPTIMIZATION does
   # enable ThinLTO, though.
-  set(RUNTIMES_CMAKE_ARGS "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DLLVM_ENABLE_LLD=ON" CACHE STRING "")
+  set(RUNTIMES_CMAKE_ARGS "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DLLVM_ENABLE_LLD=ON -DLLVM_ENABLE_FATLTO=ON" CACHE STRING "")
 endif()
 
 # Stage 1 Common Config
@@ -144,3 +144,7 @@ set_final_stage_var(CPACK_GENERATOR "TXZ" STRING)
 set_final_stage_var(CPACK_ARCHIVE_THREADS "0" STRING)
 
 set_final_stage_var(LLVM_USE_STATIC_ZSTD "ON" BOOL)
+if (LLVM_RELEASE_ENABLE_LTO)
+  set_final_stage_var(LLVM_ENABLE_FATLTO "ON" BOOL)
+  set_final_stage_var(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/release_cpack_pre_build_strip_lto.cmake" STRING)
+endif()
diff --git a/clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake b/clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake
new file mode 100644
index 0000000000000..743b64fe00f58
--- /dev/null
+++ b/clang/cmake/caches/release_cpack_pre_build_strip_lto.cmake
@@ -0,0 +1,5 @@
+file(GLOB files ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib/*.a)
+
+foreach(file ${files})
+  execute_process(COMMAND ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/bin/llvm-strip --no-strip-all -R .llvm.lto ${file})
+endforeach()

@nikic
Copy link
Contributor

nikic commented Jul 30, 2025

Looks like the release binaries jobs are failing.

@tstellar
Copy link
Collaborator

The failures aren't related to this change. The Linux failures are due to test failures which was already happening with -rc1. The MacOS failures are happening because the PR testing uses the free runners and they always timeout before they finish.

@tru
Copy link
Collaborator

tru commented Aug 5, 2025

How do we want to handle this? Some of the errors looks just like it could be fixed with a rebuild?

@tru tru moved this from Needs Triage to Needs Review in LLVM Release Status Aug 5, 2025
@tru
Copy link
Collaborator

tru commented Aug 11, 2025

ping @tstellar

@tru
Copy link
Collaborator

tru commented Sep 15, 2025

Ping - do we still want to include this in 21.x?

@tstellar
Copy link
Collaborator

Yes, I think we should. This will help reduce the size of the binary packages.

@tstellar
Copy link
Collaborator

Yes, I think we should. This will help reduce the size of the binary packages.

Although, it looks like the builds are failing. I need to investigate that first.

@dyung
Copy link
Collaborator

dyung commented Oct 1, 2025

Ping. Can we get an update/review @nikic and/or @tstellar?

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
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

5 participants