diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b94636212..d21d2a38ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,9 @@ if(BOOTLOADER_BUILD) endif() if(CMAKE_C_COMPILER_ID MATCHES "GNU") list(APPEND compile_options "-freorder-blocks") + if(CONFIG_IDF_TARGET_ARCH_XTENSA) + list(APPEND compile_options "-mno-target-align") + endif() endif() elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG) list(APPEND compile_options "-Og") @@ -52,6 +55,9 @@ else() endif() if(CMAKE_C_COMPILER_ID MATCHES "GNU") list(APPEND compile_options "-freorder-blocks") + if(CONFIG_IDF_TARGET_ARCH_XTENSA) + list(APPEND compile_options "-mno-target-align") + endif() endif() elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG) list(APPEND compile_options "-Og")