Missing atomics

I’m trying to build hl2, and for some reason it seems all the GCC atomics get defined, but they aren’t actually defined?

threadtools.cpp:(.text+0xb00): undefined reference to `__sync_add_and_fetch_8'
/usr/bin/ld: threadtools.cpp:(.text+0xb08): undefined reference to `__sync_sub_and_fetch_8'
/usr/bin/ld: threadtools.cpp:(.text+0xb0c): undefined reference to `__sync_lock_test_and_set_8'
/usr/bin/ld: threadtools.cpp:(.text+0xb10): undefined reference to `__sync_fetch_and_add_8'
/usr/bin/ld: tier0/threadtools.cpp.31.o: in function `CThreadEvent::Reset()':

I’m using Bianbu Linux
Linux milkv-jupiter 6.1.15 #1.0.15.1 SMP PREEMPT Sat Sep 7 07:20:18 UTC 2024 riscv64 riscv64 riscv64 GNU/Linux

And the G++ is:

jsteve@milkv-jupiter:~/src/source-engine$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/riscv64-linux-gnu/13/lto-wrapper
Target: riscv64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 13.2.0-4ubuntu3-bb2' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=riscv64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --disable-multilib --with-arch=rv64gc --with-abi=lp64d --enable-checking=release --build=riscv64-linux-gnu --host=riscv64-linux-gnu --target=riscv64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (Ubuntu 13.2.0-4ubuntu3-bb2)

best I can configure is that GCC is defining them:

jsteve@milkv-jupiter:~/src/source-engine$ echo | gcc -dM -E - | grep SY
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1