missing atomic builtins for M0

Bug #1898209 reported by José Simões
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
New
Undecided
Unassigned

Bug Description

Hi,

I was trying to use some atomic built-ins in my code and I'm getting an error when building for M0.
The exact same code is building fine for M4.

This is the code line:
__atomic_fetch_or(&systemEvents, events, __ATOMIC_RELAXED);

(I have other similar calls)

And these are the errors I'm getting:
undefined reference to `__atomic_fetch_or_4'
undefined reference to `__atomic_fetch_nand_4'
undefined reference to `__atomic_fetch_add_4'
undefined reference to `__atomic_fetch_sub_4'

I'm using GCC 9-2020-q2-update .

Thanks,

Revision history for this message
David Brown (davidbrown) wrote :

See also https://answers.launchpad.net/gcc-arm-embedded/+question/616213

These functions are presumably not included in the library you are using in the linking stage. And you should actually be glad about that - because the implementations that exist in gcc for these functions are horribly wrong. They use spin locks, which are totally inappropriate for single processor systems with different priority contexts (like interrupts). If you use them, you'll get code that will appear to work, but lock your system if there happens to be contention.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.