Skip to content

Commit 3cd9dcc

Browse files
authored
[cmake] Disable using FatLTO on Apple platforms (#85708)
FatLTO currently only supports ELF, so ensure we don't use it on non-ELF platforms.
1 parent ac7a456 commit 3cd9dcc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ function(add_unittest test_suite test_name)
16371637
# The runtime benefits of LTO don't outweight the compile time costs for tests.
16381638
if(LLVM_ENABLE_LTO)
16391639
if((UNIX OR MINGW) AND LINKER_IS_LLD)
1640-
if(LLVM_ENABLE_FATLTO)
1640+
if(LLVM_ENABLE_FATLTO AND NOT APPLE)
16411641
# When using FatLTO, just use relocatable linking.
16421642
set_property(TARGET ${test_name} APPEND_STRING PROPERTY
16431643
LINK_FLAGS " -Wl,--no-fat-lto-objects")

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ elseif(LLVM_ENABLE_LTO)
12821282
endif()
12831283
endif()
12841284

1285-
if(LLVM_ENABLE_FATLTO AND (FUCHSIA OR UNIX))
1285+
if(LLVM_ENABLE_FATLTO AND UNIX AND NOT APPLE)
12861286
append("-ffat-lto-objects" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
12871287
if(NOT LINKER_IS_LLD_LINK)
12881288
append("-ffat-lto-objects" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS)

0 commit comments

Comments
 (0)