From 4b40295e0194478487d4fb51a72a2a3ff641f35c Mon Sep 17 00:00:00 2001 From: Lars-Ove Karlsson Date: Mon, 17 Feb 2025 16:56:08 +0100 Subject: [PATCH] cmake: Always use Dwarf 4 for IAR The IAR linker does not handle Dwarf 5 and since it uses the GCC assembler for assembler files, we need to make sure the assembler output uses Dwarf 4. Signed-off-by: Lars-Ove Karlsson --- cmake/compiler/iar/target.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/compiler/iar/target.cmake b/cmake/compiler/iar/target.cmake index 94422739e16..e6c89c875c4 100644 --- a/cmake/compiler/iar/target.cmake +++ b/cmake/compiler/iar/target.cmake @@ -90,10 +90,8 @@ if("${IAR_TOOLCHAIN_VARIANT}" STREQUAL "iccarm") ) endif() -if(CONFIG_DEBUG) - # GCC defaults to Dwarf 5 output - list(APPEND IAR_ASM_FLAGS -gdwarf-4) -endif() +# IAR needs Dwarf 4 output +list(APPEND IAR_ASM_FLAGS -gdwarf-4) if(DEFINED CONFIG_ARM_SECURE_FIRMWARE) list(APPEND IAR_COMMON_FLAGS --cmse)