Skip to content

iar: Zephyr 4.2 fails with IAR EWARM 9.70.1 #94842

@RobinKastberg

Description

@RobinKastberg

Describe the bug

Currently, IAR toolchain 9.70..1 does not support .ltorg statement.
This was added in d7d3ae5 just in time for 4.2 release.
It has been fixed in fa165da, but needs backport to 4.2
It would be very good if stable zephyr worked with stable IAR.

Regression

  • This is a regression.

Steps to reproduce

The problem can be reproduced by running, e.g., west build -p -b frdm_mcxn947/mcxn947/cpu0 tests/kernel/mem_protect/sys_sem -T kernel.memory_protection.sys_sem.nouser

Relevant log output

[54/169] Building C object zephyr/arch/arch...iles/arch__arm__core__cortex_m.dir/thread.o
FAILED: zephyr/arch/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/thread.o
ccache /opt/iarsystems/cxarm/arm/bin/iccarm  --silent /workdir/zephyr/arch/arm/core/cortex_m/thread.c -DCPU_MCXN947VDF_cm33_core0 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DLPFLEXCOMM_INIT_NOT_USED_IN_DRIVER=1 -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/workdir/zephyr/kernel/include -I/workdir/zephyr/arch/arm/include -I/workdir/zephyr/build/zephyr/include/generated/zephyr -I/workdir/zephyr/include -I/workdir/zephyr/build/zephyr/include/generated -I/workdir/zephyr/soc/nxp/mcx -I/workdir/zephyr/soc/nxp/mcx/mcxn/. -I/workdir/zephyr/subsys/testsuite/include -I/workdir/zephyr/subsys/testsuite/coverage -I/workdir/zephyr/subsys/testsuite/ztest/include -I/workdir/modules/hal/cmsis/CMSIS/Core/Include -I/workdir/modules/hal/cmsis_6/CMSIS/Core/Include -I/workdir/zephyr/modules/cmsis_6/. -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/drivers/common -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/drivers/lpflexcomm -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/drivers/mcx_spc -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/drivers/port -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/drivers/cache/cache64 -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/drivers/lpflexcomm/lpuart -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN947 -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/devices/MCX/MCXN/periph -I/workdir/modules/hal/nxp/mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN947/drivers -I/workdir/modules/hal/ti/mspm0/source/ti/devices/msp/. -I/workdir/modules/hal/ti/mspm0/source/ti/devices/msp/m0p -I/workdir/modules/hal/ti/mspm0/source/ti/devices/msp/peripherals -I/workdir/modules/hal/ti/mspm0/source/ti/devices/msp/peripherals/m0p -I/workdir/modules/hal/ti/mspm0/source/ti/devices/msp/peripherals/m0p/sysctl -I/workdir/zephyr/lib/libc/minimal/include -I/workdir/zephyr/lib/libc/common/include -e -Ohz --preinclude /workdir/zephyr/build/zephyr/include/generated/zephyr/autoconf.h --debug --preinclude /workdir/zephyr/include/zephyr/toolchain/iar/iar_missing_defs.h -e --language gnu --do_explicit_init_in_named_sections --macro_positions_in_diagnostics --no_wrap_diagnostics --endian=little --cpu=Cortex-M33 -DRTT_USE_ASM=0 --diag_suppress=Ta184 --vla --cmse --aeabi --thumb --diag_suppress=Pe068,Pe1143,Pe111,Pe1675,Pe054,Pe223 --diag_suppress=Pe381 --diag_suppress=Pe513,Pe177,Pe144,Pe167,Pe185,Pa084,Pa082,Pe1097 --diag_suppress=Pe054,Pe186,Pe546,Pe550,Pe128,Pe188,Pe144,Pe167 -D__IAR_CSTD_c17 --dependencies=ns zephyr/arch/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/thread.o.d -o zephyr/arch/arch/arm/core/cortex_m/CMakeFiles/arch__arm__core__cortex_m.dir/thread.o

                         ".ltorg\n"
                          ^
"/workdir/zephyr/arch/arm/core/cortex_m/thread.c",563  Error[Og005]: Unknown symbol in inline assembly: ".ltorg"

                         ".ltorg\n"
                              ^
"/workdir/zephyr/arch/arm/core/cortex_m/thread.c",563  Error[Og006]: Error in inline assembly: "Expression can not be forward"
[59/169] Building C object zephyr/arch/arch...arch__arm__core__cortex_m.dir/isr_wrapper.o
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /workdir/zephyr/build

Impact

Major – Severely degrades functionality; workaround is difficult or unavailable.

Environment

EWARM 9.70.1
Zephyr v4.2-branch

Additional Context

No response

Metadata

Metadata

Assignees

Labels

BackportBackport PR and backport failure issuesarea: IARIAR ToolchainbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions