Merge branch 'feature/xtensa-size-optimize-mno-target-align' into 'master'

change(xtensa): Add -mno-target-align to size-optimized builds

Closes IDFGH-14980

See merge request espressif/esp-idf!39348
This commit is contained in:
Alexey Lapshin
2025-08-25 18:50:01 +04:00

View File

@@ -23,6 +23,9 @@ if(BOOTLOADER_BUILD)
endif() endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU") if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks") list(APPEND compile_options "-freorder-blocks")
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
list(APPEND compile_options "-mno-target-align")
endif()
endif() endif()
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG) elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG)
list(APPEND compile_options "-Og") list(APPEND compile_options "-Og")
@@ -52,6 +55,9 @@ else()
endif() endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU") if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks") list(APPEND compile_options "-freorder-blocks")
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
list(APPEND compile_options "-mno-target-align")
endif()
endif() endif()
elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG) elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG)
list(APPEND compile_options "-Og") list(APPEND compile_options "-Og")