Skip to content

[cmake] Disable using FatLTO on Apple platforms #85708

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@ function(add_unittest test_suite test_name)
# The runtime benefits of LTO don't outweight the compile time costs for tests.
if(LLVM_ENABLE_LTO)
if((UNIX OR MINGW) AND LINKER_IS_LLD)
if(LLVM_ENABLE_FATLTO)
if(LLVM_ENABLE_FATLTO AND NOT APPLE)
# When using FatLTO, just use relocatable linking.
set_property(TARGET ${test_name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,--no-fat-lto-objects")
Expand Down
2 changes: 1 addition & 1 deletion llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ elseif(LLVM_ENABLE_LTO)
endif()
endif()

if(LLVM_ENABLE_FATLTO AND (FUCHSIA OR UNIX))
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)
Expand Down