https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62250
--- Comment #8 from Hans-Peter Nilsson <hp at gcc dot gnu.org> --- Created attachment 34394 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34394&action=edit Patch to add -latomic only when available; -p0 -d path/to/gcc/testsuite David, could you please check if the attached patch still works for hppa*-*-hpux*? I've verified that it fixes the regressions I see (cross to cris-elf; a system without a -latomic port and where the operations are built-in) and that -latomic is still added for a native x86_64-unknown-linux-gnu build, with tests still passing. Though, as -latomic is redundant on that last system, I haven't actually tested it on a system where -latomic is *required*; the point if this PR (and BTW sorry for being lazy and hijacking it - a pointer to a new PR would have been more appropriate).