According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938, configure GCC with '-with-arch=armv7-a' should do the job (setting __GCC_ATOMIC_INT_LOCK_FREE / ATOMIC_INT_LOCK_FREE to 2), IIUC.