https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98003 --- Comment #5 from dave.anglin at bell dot net --- There is no --as-needed support. I think either approach would simplify things as most targets don't need to link against libatomic.