2026-05-11 7:00 AM - edited 2026-05-11 7:06 AM
I'm trying to use _Atomic with 64 bit objects, but I get a link failure:
undefined reference to `__atomic_load_8'The internet says I need to add an option to the link command:
-latomicHowever, it looks as if that library is not included with the ST tool chain:
cannot find -latomic: No such file or directoryHas anyone managed to get this working?
There are a number of workarounds that could be used here, but it would be much easier to use the native C feature that's been available since C11.
I'm using STM32CubeIDE V 1.18.1 with GNU Tools 13.3
2026-05-11 7:17 AM
C or C++?
Maybe this helps a bit: https://community.st.com/t5/stm32-mcus-embedded-software/how-atomic-are-the-strd-ldrd-instructions-on-cortex-m4/td-p/884526