NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Support for builtins atomic intrinsic's

The GCC documentation on those builtins describe including a header, stdatomic.h, in the writeup. https://gcc.gnu.org/wiki/Atomic , I would imagine that the header would change the visibility of the symbols.

0 Kudos
Message 11 of 13
(906 Views)

Well, that documentation is in several ways not entirely complete. As you can see in the executable that I attached earlier, there seems to be no need to include <stdatomic.h>. Also I didn't specifically link to libstdc either although that may make a difference for a shared library.

Another point is that I have found several references that seem to indicate that the atomic intrinsics were actually added in GCC 4.1 already although most likely only for the mainstream targets like x86/x64. The documentation you pointed at do mention that arm support is rather limited so this might be were I'm running into troublealthough I'm still puzzled that the test executable seems to work anyways.

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 13
(906 Views)

I tried following the wiki and ran into issues regarding some headers that were missing, leading me to the same conclusion that this wiki page was outdated. I would recommend just writing a reasonable implementation in assembly since that's the surest way to avoid incomplete implementations of poorly-tested functionality in older tools 🙂

0 Kudos
Message 13 of 13
(906 Views)