@@ -190,6 +190,10 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
190
190
set (RUNTIMES_${target} _LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR} /bin" CACHE BOOL "" )
191
191
set (RUNTIMES_${target} _LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "" )
192
192
193
+ # Enable FatLTO for Linux and baremetal runtimes
194
+ set (RUNTIMES_${target} _LLVM_ENABLE_LTO ON CACHE BOOL "" )
195
+ set (RUNTIMES_${target} _LLVM_ENABLE_FATLTO ON CACHE BOOL "" )
196
+
193
197
# Use .build-id link.
194
198
list (APPEND RUNTIME_BUILD_ID_LINK "${target} " )
195
199
endif ()
@@ -272,6 +276,10 @@ if(FUCHSIA_SDK)
272
276
set (RUNTIMES_${target} +asan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "" )
273
277
set (RUNTIMES_${target} +asan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "" )
274
278
279
+ # Enable FatLTO for Fuchsia runtimes
280
+ set (RUNTIMES_${target} _LLVM_ENABLE_LTO ON CACHE BOOL "" )
281
+ set (RUNTIMES_${target} _LLVM_ENABLE_FATLTO ON CACHE BOOL "" )
282
+
275
283
# Use .build-id link.
276
284
list (APPEND RUNTIME_BUILD_ID_LINK "${target} " )
277
285
endforeach ()
@@ -369,6 +377,10 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-n
369
377
set (RUNTIMES_${target} _LLVM_INCLUDE_TESTS OFF CACHE BOOL "" )
370
378
set (RUNTIMES_${target} _LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "" )
371
379
set (RUNTIMES_${target} _LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "" )
380
+
381
+ # Enable FatLTO for baremetal runtimes
382
+ set (RUNTIMES_${target} _LLVM_ENABLE_LTO ON CACHE BOOL "" )
383
+ set (RUNTIMES_${target} _LLVM_ENABLE_FATLTO ON CACHE BOOL "" )
372
384
endforeach ()
373
385
374
386
foreach (target riscv32-unknown-elf)
@@ -420,6 +432,10 @@ foreach(target riscv32-unknown-elf)
420
432
set (RUNTIMES_${target} _LLVM_INCLUDE_TESTS OFF CACHE BOOL "" )
421
433
set (RUNTIMES_${target} _LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "" )
422
434
set (RUNTIMES_${target} _LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "" )
435
+
436
+ # Enable FatLTO for baremetal runtimes
437
+ set (RUNTIMES_${target} _LLVM_ENABLE_LTO ON CACHE BOOL "" )
438
+ set (RUNTIMES_${target} _LLVM_ENABLE_FATLTO ON CACHE BOOL "" )
423
439
endforeach ()
424
440
425
441
set (LLVM_BUILTIN_TARGETS "${BUILTIN_TARGETS} " CACHE STRING "" )
0 commit comments