Skip to content

Revert "[Fuchsia][cmake] Allow using FatLTO when building runtimes" #119252

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

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Dec 9, 2024

Reverts #112277

This broke something on Fuchsia's Mac builders,
so there's still something in the CMake that needs to be updated before we reland.

Failed build:
https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-mac-xarm64/b8729005878443108801/overview

@llvmbot llvmbot added cmake Build system in general and CMake in particular clang Clang issues not falling into any other category labels Dec 9, 2024
@ilovepi ilovepi merged commit 1cbd67e into main Dec 9, 2024
5 of 6 checks passed
@ilovepi ilovepi deleted the revert-112277-users/ilovepi/spr/libcxxcmake-allow-using-fatlto-in-libc-builds branch December 9, 2024 19:25
@llvmbot
Copy link
Member

llvmbot commented Dec 9, 2024

@llvm/pr-subscribers-clang

Author: Paul Kirth (ilovepi)

Changes

Reverts llvm/llvm-project#112277

This broke something on Fuchsia's Mac builders,
so there's still something in the CMake that needs to be updated before we reland.

Failed build:
https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-mac-xarm64/b8729005878443108801/overview


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

2 Files Affected:

  • (modified) clang/cmake/caches/Fuchsia-stage2.cmake (-16)
  • (modified) llvm/cmake/modules/HandleLLVMOptions.cmake (+1-1)
diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake
index 9eb295548500ee..784a883a3bf916 100644
--- a/clang/cmake/caches/Fuchsia-stage2.cmake
+++ b/clang/cmake/caches/Fuchsia-stage2.cmake
@@ -190,10 +190,6 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
     set(RUNTIMES_${target}_LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR}/bin" CACHE BOOL "")
     set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
 
-    # Enable FatLTO for Linux and baremetal runtimes
-    set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
-    set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
-
     # Use .build-id link.
     list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
   endif()
@@ -276,10 +272,6 @@ if(FUCHSIA_SDK)
     set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
     set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
 
-    # Enable FatLTO for Fuchsia runtimes
-    set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
-    set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
-
     # Use .build-id link.
     list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
   endforeach()
@@ -371,10 +363,6 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi;armv8.1m.
   set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "")
-
-  # Enable FatLTO for baremetal runtimes
-  set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
-  set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
 endforeach()
 
 foreach(target riscv32-unknown-elf)
@@ -426,10 +414,6 @@ foreach(target riscv32-unknown-elf)
   set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "")
-
-  # Enable FatLTO for baremetal runtimes
-  set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
-  set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
 endforeach()
 
 set(LLVM_BUILTIN_TARGETS "${BUILTIN_TARGETS}" CACHE STRING "")
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 55a87f5fdbb138..f19125eb6bf273 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -1285,7 +1285,7 @@ elseif(LLVM_ENABLE_LTO)
   endif()
 endif()
 
-if(LLVM_ENABLE_FATLTO AND ((UNIX AND NOT APPLE) OR FUCHSIA))
+if(LLVM_ENABLE_FATLTO AND UNIX AND NOT APPLE)
   append("-ffat-lto-objects" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   if(NOT LINKER_IS_LLD_LINK)
     append("-ffat-lto-objects" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS)

ilovepi added a commit that referenced this pull request Jan 27, 2025
…119252) (#121820)

The previous failures were addressed with CMake changes in #121819
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 cmake Build system in general and CMake in particular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants