Skip to content

Conversation

@tpambor
Copy link

@tpambor tpambor commented Nov 28, 2025

Make local function DMA_List_CheckNodesBaseAddresses() never inlined.

This fixes a build issue faced with with STM32H5 DMA HAL when building TF-M for regression tests with GCC11 and GCC12 compilers with optimization directives. The build issue is not very explicit, as reported by the build error trace message below:

during GIMPLE pass: evrp
/__w/zephyr/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/stm/common/stm32h5xx/hal/Src/stm32h5xx_hal_dma_ex.c: In function 'HAL_DMAEx_List_ReplaceNode_Head': /__w/zephyr/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/stm/common/stm32h5xx/hal/Src/stm32h5xx_hal_dma_ex.c:4683:1: internal compiler error: Segmentation fault
4683 | }
| ^
0x7f6e24cfb32f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7f6e24ce01c9 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f6e24ce028a __libc_start_main_impl
../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See https://github.com/zephyrproject-rtos/sdk-ng/issues for instructions.

The issue was tracked in GCC [1] and has been addressed in GCC 13 and later.

This fix is equivalent to a fix already applied to HAL driver of stm32u5 and stm32wbaxx platforms, see commit 578a6f4 and ec61e69.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106878 [1]

@tpambor tpambor force-pushed the stm32h5-compiler-fix branch from ea91bce to ce78375 Compare December 2, 2025 20:08
@tpambor tpambor changed the title [zep fromlist] platform: stm: workaround compiler error [zep fromtree] platform: stm: workaround compiler error Dec 2, 2025
@tpambor
Copy link
Author

tpambor commented Dec 2, 2025

Patch has been merged upstream and I have updated the commit to [zep fromtree].

@tomi-font tomi-font changed the base branch from main to zephyr_tf-m_v2.2.2 December 3, 2025 09:02
@tomi-font
Copy link
Collaborator

tomi-font commented Dec 3, 2025

The default branch of this repository is being changed to zephyr_tf-m_v2.2.2 which will replace main shortly.
Please rebase your branch atop zephyr_tf-m_v2.2.2 and force-push it.
I have already changed your PR's base branch to zephyr_tf-m_v2.2.2.
Also, make sure to follow the new commit guidelines documented here.

Make local function DMA_List_CheckNodesBaseAddresses() never inlined.

This fixes a build issue faced with with STM32H5 DMA HAL when building
TF-M for regression tests with GCC11 and GCC12 compilers with optimization
directives. The build issue is not very explicit, as reported by the
build error trace message below:

during GIMPLE pass: evrp
/__w/zephyr/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/stm/common/stm32h5xx/hal/Src/stm32h5xx_hal_dma_ex.c: In function 'HAL_DMAEx_List_ReplaceNode_Head':
/__w/zephyr/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/stm/common/stm32h5xx/hal/Src/stm32h5xx_hal_dma_ex.c:4683:1: internal compiler error: Segmentation fault
 4683 | }
      | ^
0x7f6e24cfb32f ???
	./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7f6e24ce01c9 __libc_start_call_main
	../sysdeps/nptl/libc_start_call_main.h:58
0x7f6e24ce028a __libc_start_main_impl
	../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://github.com/zephyrproject-rtos/sdk-ng/issues> for instructions.

The issue was tracked in GCC [1] and has been addressed in GCC 13 and later.

This fix is equivalent to a fix already applied to HAL driver of stm32u5
and stm32wbaxx platforms, see commit 578a6f4 and ec61e69.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106878 [1]

Change-Id: I49479c45ad3407b715ef337dccb8cc9707d7c721
Signed-off-by: Tim Pambor <[email protected]>
(cherry picked from commit a2f9eb776420357dc5c747d904bc10368de51268)
@tpambor tpambor force-pushed the stm32h5-compiler-fix branch from ce78375 to aa54d75 Compare December 3, 2025 10:29
@tpambor
Copy link
Author

tpambor commented Dec 3, 2025

I have rebased on top of zephyr_tf-m_v2.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants