mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04: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:
parent
fd1c213be4
commit
9901fc3058
@ -196,6 +196,12 @@ endif()
|
|||||||
|
|
||||||
list(APPEND link_options "-fno-lto")
|
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
|
# Placing jump tables in flash would cause issues with code that required
|
||||||
# to be placed in IRAM
|
# to be placed in IRAM
|
||||||
list(APPEND compile_options "-fno-jump-tables")
|
list(APPEND compile_options "-fno-jump-tables")
|
||||||
|
@ -111,13 +111,10 @@ function(__build_set_default_build_specifications)
|
|||||||
|
|
||||||
list(APPEND cxx_compile_options "-std=gnu++11")
|
list(APPEND cxx_compile_options "-std=gnu++11")
|
||||||
|
|
||||||
list(APPEND link_options "-Wl,--gc-sections")
|
|
||||||
|
|
||||||
idf_build_set_property(COMPILE_DEFINITIONS "${compile_definitions}" APPEND)
|
idf_build_set_property(COMPILE_DEFINITIONS "${compile_definitions}" APPEND)
|
||||||
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
|
idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)
|
||||||
idf_build_set_property(C_COMPILE_OPTIONS "${c_compile_options}" APPEND)
|
idf_build_set_property(C_COMPILE_OPTIONS "${c_compile_options}" APPEND)
|
||||||
idf_build_set_property(CXX_COMPILE_OPTIONS "${cxx_compile_options}" APPEND)
|
idf_build_set_property(CXX_COMPILE_OPTIONS "${cxx_compile_options}" APPEND)
|
||||||
idf_build_set_property(LINK_OPTIONS "${link_options}" APPEND)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user