Skip to content

Commit f38347c

Browse files
authored
Update CMakeLists.txt
1 parent 92ef76d commit f38347c

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

CMakeLists.txt

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,6 @@ if(CONFIG_COMPILER_DISABLE_GCC14_WARNINGS)
179179
list(APPEND compile_options "-Wno-calloc-transposed-args")
180180
endif()
181181

182-
if(CONFIG_COMPILER_ENABLE_LTO)
183-
set(CMAKE_AR ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar)
184-
set(CMAKE_RANLIB ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib)
185-
list(APPEND compile_options "-flto=auto"
186-
"-ffat-lto-objects"
187-
"-flto-compression-level=9")
188-
list(APPEND link_options "-flto"
189-
"-fuse-linker-plugin"
190-
"-ffat-lto-objects"
191-
"-flto-partition=max")
192-
else()
193-
list(APPEND compile_options "-fno-lto")
194-
list(APPEND link_options "-fno-lto")
195-
endif()
196-
197182
if(CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS)
198183
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
199184
idf_build_replace_option_from_property(COMPILE_OPTIONS "-Werror" "-Werror=all")
@@ -213,6 +198,8 @@ if(CONFIG_ESP_SYSTEM_USE_EH_FRAME)
213198
list(APPEND link_options "-Wl,--eh-frame-hdr")
214199
endif()
215200

201+
list(APPEND link_options "-fno-lto")
202+
216203
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
217204
# Not all versions of the MacOS linker support the -warn_commons flag.
218205
# ld version 1053.12 (and above) have been tested to support it.

0 commit comments

Comments
 (0)