07-02-2014 03:50 PM
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.
07-03-2014 03:41 AM
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.
07-03-2014 08:39 AM
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 🙂