mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
fix(linux): Fixed linux target build failure in esp_app_format for MacOS
This commit fixes a build failure in the esp_app_format component for the linux target when built on a MacOS machine.
This commit is contained in:
@@ -11,7 +11,13 @@ idf_component_register(SRCS ${src}
|
|||||||
if(NOT BOOTLOADER_BUILD)
|
if(NOT BOOTLOADER_BUILD)
|
||||||
# esp_app_desc structure is added as an undefined symbol because otherwise the
|
# esp_app_desc structure is added as an undefined symbol because otherwise the
|
||||||
# linker will ignore this structure as it has no other files depending on it.
|
# linker will ignore this structure as it has no other files depending on it.
|
||||||
|
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
# On MacOS, the linker expects the exact mangled symbol name (with leading underscore)
|
||||||
|
# to be present in the object file.
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u _esp_app_desc")
|
||||||
|
else()
|
||||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_app_desc")
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_app_desc")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CONFIG_APP_PROJECT_VER_FROM_CONFIG)
|
if(CONFIG_APP_PROJECT_VER_FROM_CONFIG)
|
||||||
# Ignore current PROJECT_VER (which was set in project.cmake)
|
# Ignore current PROJECT_VER (which was set in project.cmake)
|
||||||
|
@@ -20,7 +20,11 @@ static const char *TAG = "app_init";
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Application version info
|
// Application version info
|
||||||
|
#if defined(__APPLE__) && CONFIG_IDF_TARGET_LINUX
|
||||||
|
const __attribute__((weak)) __attribute__((section("__RODATA_DESC,.rodata_desc"))) esp_app_desc_t esp_app_desc = {
|
||||||
|
#else
|
||||||
const __attribute__((weak)) __attribute__((section(".rodata_desc"))) esp_app_desc_t esp_app_desc = {
|
const __attribute__((weak)) __attribute__((section(".rodata_desc"))) esp_app_desc_t esp_app_desc = {
|
||||||
|
#endif /* #if defined(__APPLE__) && CONFIG_IDF_TARGET_LINUX */
|
||||||
.magic_word = ESP_APP_DESC_MAGIC_WORD,
|
.magic_word = ESP_APP_DESC_MAGIC_WORD,
|
||||||
#ifdef CONFIG_APP_EXCLUDE_PROJECT_VER_VAR
|
#ifdef CONFIG_APP_EXCLUDE_PROJECT_VER_VAR
|
||||||
.version = "",
|
.version = "",
|
||||||
|
Reference in New Issue
Block a user