|
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>
|