https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67843
--- Comment #8 from Christophe Lyon <clyon at gcc dot gnu.org> --- I've tested the patch you attached. It needs a slight modification because it does not apply to current trunk: _GLIBCXX_READ_MEM_BARRIER; _GLIBCXX_WRITE_MEM_BARRIER; have been replaced by: __atomic_thread_fence (__ATOMIC_ACQ_REL); I then ran the tests as I usually do (build a armv7-a toolchain, force -march=armv5t when running make check), and the test FAILed: /tmp/ccyPksY2.o: In function `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)1>::_M_release()':^M /home/christophe.lyon/src/GCC/builds/gcc-fsf-trunk/obj-arm-none-linux-gnueabi/gcc3/arm-none-linux-gnueabi/libstdc++-v3/include/bits/shared_ptr_base.h:160: undefined reference to `void std::__check_lock_policy<(__gnu_cxx::_Lock_policy)1>()'^M [....] If I don't force -march=armv5t (and use the default armv7-a), the test PASSes.