https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96898
--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> --- Created attachment 49195 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49195&action=edit Tentative patch Introduces an option -fatomic-libcalls (analogous to -fsync-libcalls) such that __atomic_test_and_set maps onto libatomic function __atomic_test_and_set_1.