aboutsummaryrefslogtreecommitdiff
path: root/cmake/modules/FindAtomic.cmake
AgeCommit message (Collapse)Author
2022-08-11[cmake] link atomic library for certain CPU architecturesYixun Lan
For those CPU architectures: RISC-V lack 8-bit and 16-bit atomic instructions, and ARM/MIPS/PPC lack 64-bit atomic instruction. GCC is supposed to convert these atomics via masking and shifting like LLVM, which means anything that wants to use these instructions needs the link option -latomic. In this patch, we will try to detect if 8-bit, 64-bit atomic instructions exist, otherwise the atomic library will append to the DEPLIBS list. Original issue: * https://gitlab.kitware.com/cmake/cmake/-/issues/23021#note_1098733 For reference: * https://gcc.gnu.org/wiki/Atomic/GCCMM riscv64 specific: * https://lists.debian.org/debian-riscv/2022/01/msg00009.html Signed-off-by: Yixun Lan <dlan@gentoo.org>