PHP's configure script probes __atomic_exchange_1 as an external
function on riscv64, which only resolves against libatomic, and so
links the library although no binary references an atomic symbol.
The riscv64-only dependency and linker flag paper over that. Link
with --as-needed so the unused library is dropped and remove both;
mips and riscv64 builds import no atomic symbols.