mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +08:00
elf(bugfix):fix elf compile link error when enable LTO
fix compilation errors when enabling the LTO linker Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -38,6 +38,12 @@ nuttx_mod_link_options(-r)
|
||||
|
||||
nuttx_elf_link_options_ifdef(CONFIG_BUILD_KERNEL -Bstatic)
|
||||
|
||||
nuttx_elf_link_options_ifdef(CONFIG_DEBUG_OPT_UNUSED_SECTIONS --gc-sections)
|
||||
if(CONFIG_DEBUG_OPT_UNUSED_SECTIONS)
|
||||
if("${CMAKE_LD}" MATCHES "gcc$")
|
||||
nuttx_elf_link_options(-Wl,--gc-sections)
|
||||
else()
|
||||
nuttx_elf_link_options(--gc-sections)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
nuttx_elf_link_options(-e __start)
|
||||
|
||||
Reference in New Issue
Block a user