mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
cmake: don't pass --gc-sections to macOS linker, use -dead_strip
When building for "linux" (~POSIX) target on macOS, the system linker is normally used. MacOS linker doesn't recognise --gc-sections, but has a -dead_strip flag which is equivalent.
This commit is contained in:
@@ -196,6 +196,12 @@ endif()
|
||||
|
||||
list(APPEND link_options "-fno-lto")
|
||||
|
||||
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||
list(APPEND link_options "-Wl,-dead_strip")
|
||||
else()
|
||||
list(APPEND link_options "-Wl,--gc-sections")
|
||||
endif()
|
||||
|
||||
# Placing jump tables in flash would cause issues with code that required
|
||||
# to be placed in IRAM
|
||||
list(APPEND compile_options "-fno-jump-tables")
|
||||
|
||||
Reference in New Issue
Block a user