STM32 Zephyr link issue on PIO 6.1.16

Hello everyone,

I’m back with some more automated builds issues using PlatformIO for Zephyr on STM32 following the update to PIO 6.1.16 (worked fine in 6.1.15):

 Linking .pio/build/nucleo_f767zi/zephyr/firmware-pre0.elf
/home/runner/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.bfd: GNU-style constructors required but STATIC_INIT_GNU not enabled
/home/runner/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.bfd: warning: .pio/build/nucleo_f767zi/zephyr/firmware-pre0.elf has a LOAD segment with RWX permissions
/home/runner/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.bfd: /home/runner/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(libc_a-fini.o): in function `__libc_fini_array':
(.text.__libc_fini_array+0x1c): undefined reference to `_fini'

The config files:

Do you know if something changed on your end regarding this?

For the STATIC_INIT_GNU error , seems Zephyr had a similar issue on esp32 back in June esp32: temp sensor fails due to constructor attribute · Issue #75169 · zephyrproject-rtos/zephyr · GitHub.

Don’t know how to solve this one but reverting the Zephyr version. Is there a way to specify a Zephyr version through the platformio.ini file?

framework = zephyr@3.5.0 or framework = zephyr@2.30500.231204 doesn’t seem to work (Error: This board doesn't support zephyr @ 3.5.0 framework!)

For the LOAD segment thing it’s actually just a warning, but I still managed to solve it by following this post: Solved: STM32CubeIDE 1.15.0: elf has a LOAD segment with R... - STMicroelectronics Community

and manually updating files in platformio/platforms/ststm32/ldscripts/