Hi, I just want to backport the commit to gcc-13 branch: commit 203f3060dd363361b172f7295f42bb6bf5ac0b3b Author: Andreas Schwab Date: Sat Apr 23 15:48:42 2022 +0200 riscv/linux: Don't add -latomic with -pthread Now that we have support for inline subword atomic operations, it is no longer necessary to link against libatomic. This also fixes testsuite failures because the framework does not properly set up the linker flags for finding libatomic. The use of atomic operations is also independent of the use of libpthread. gcc/ * config/riscv/linux.h (LIB_SPEC): Don't redefine. The discussion is here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104338#c20 -- Regards, -- Bo YU