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

Saves space, about 6K in our application

Merges https://github.com/espressif/esp-idf/pull/15677
This commit is contained in:
Deomid rojer Ryabkov
2025-03-30 00:24:12 +02:00
committed by BOT
parent 6e0fd570b2
commit e2e51c08f6

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")