Skip to content

Commit 9296fd6

Browse files
authored
runtime: Link libatomic on 64-bit RISC-V and LoongArch (#4864)
Fixes #4847.
1 parent 43b7f59 commit 9296fd6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

runtime/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ if("${C_SYSTEM_LIBS}" STREQUAL "AUTO")
141141
else()
142142
set(C_SYSTEM_LIBS m pthread)
143143
endif()
144+
# some archs need libatomic for 128-bit CAS druntime unittests
145+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64|loongarch64")
146+
set(C_SYSTEM_LIBS atomic ${C_SYSTEM_LIBS})
147+
endif()
144148
set(C_SYSTEM_LIBS_SHARED ${C_SYSTEM_LIBS})
145149
endif()
146150
else()

0 commit comments

Comments
 (0)