From 7a7cfd0d64b5ad6837393620fecc4462c21862b4 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 23 Oct 2024 20:54:46 +0200 Subject: [PATCH] cmake: gcc/ld: Fix LTO warnings Fix the following warnings: [255/261] Linking C executable zephyr/zephyr_pre0.elf lto-wrapper: warning: using serial compilation of 8 LTRANS jobs lto-wrapper: note: see the '-flto' option documentation for more information [260/261] Linking C executable zephyr/zephyr.elf lto-wrapper: warning: using serial compilation of 8 LTRANS jobs lto-wrapper: note: see the '-flto' option documentation for more information Signed-off-by: Vinayak Kariappa Chettimada --- cmake/compiler/gcc/compiler_flags.cmake | 2 +- cmake/linker/ld/linker_flags.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/compiler/gcc/compiler_flags.cmake b/cmake/compiler/gcc/compiler_flags.cmake index f92fcd9f0cc..5d348a2aacc 100644 --- a/cmake/compiler/gcc/compiler_flags.cmake +++ b/cmake/compiler/gcc/compiler_flags.cmake @@ -23,7 +23,7 @@ set_compiler_property(PROPERTY optimization_size -Os) set_compiler_property(PROPERTY optimization_size_aggressive -Oz) if(CMAKE_C_COMPILER_VERSION GREATER_EQUAL "4.5.0") - set_compiler_property(PROPERTY optimization_lto -flto) + set_compiler_property(PROPERTY optimization_lto -flto=auto) set_compiler_property(PROPERTY prohibit_lto -fno-lto) endif() diff --git a/cmake/linker/ld/linker_flags.cmake b/cmake/linker/ld/linker_flags.cmake index 5063ddb46fb..0e0e8b6b0a1 100644 --- a/cmake/linker/ld/linker_flags.cmake +++ b/cmake/linker/ld/linker_flags.cmake @@ -36,7 +36,7 @@ endif() set_property(TARGET linker PROPERTY partial_linking "-r") -set_property(TARGET linker PROPERTY lto_arguments -flto -fno-ipa-sra -ffunction-sections -fdata-sections) +set_property(TARGET linker PROPERTY lto_arguments -flto=auto -fno-ipa-sra -ffunction-sections -fdata-sections) check_set_linker_property(TARGET linker PROPERTY no_relax ${LINKERFLAGPREFIX},--no-relax)