-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix link fail caused by missing GCC char/short atomic primitives on r…
…iscv64 Issue #46 (libatomic_ops). gcc/riscv requires the client to add -latomic (or -pthread) flag if char- or short-width compare-and-swap or an arithmetic primitive is used. To avoid such a requirement, the corresponding AO primitives are not provided for now unless AO_PREFER_BUILTIN_ATOMICS is defined. * src/atomic_ops/sysdeps/gcc/generic-arithm.h: Regenerate. * src/atomic_ops/sysdeps/gcc/generic-arithm.template (AO_XSIZE_fetch_and_add_XBAR): Do not define if AO_NO_XSIZE_ARITHM. * src/atomic_ops/sysdeps/gcc/generic-arithm.template [!AO_SKIPATOMIC_ANY_and_ANY] (AO_XSIZE_and_XBAR): Likewise. * src/atomic_ops/sysdeps/gcc/generic-arithm.template [!AO_SKIPATOMIC_ANY_or_ANY] (AO_XSIZE_or_XBAR): Likewise. * src/atomic_ops/sysdeps/gcc/generic-arithm.template [!AO_SKIPATOMIC_ANY_xor_ANY] (AO_XSIZE_xor_XBAR): Likewise. * src/atomic_ops/sysdeps/gcc/riscv.h (AO_GCC_FORCE_HAVE_CAS): Define only if __clang__ or AO_PREFER_BUILTIN_ATOMICS; update comment. * src/atomic_ops/sysdeps/gcc/riscv.h [!__clang__ && !AO_PREFER_BUILTIN_ATOMICS && !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1] (AO_NO_char_ARITHM): Define macro; add comment. * src/atomic_ops/sysdeps/gcc/riscv.h [!__clang__ && !AO_PREFER_BUILTIN_ATOMICS && !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2] (AO_NO_short_ARITHM): Likewise. * src/atomic_ops/sysdeps/gcc/riscv.h (AO_NO_char_ARITHM, AO_NO_short_ARITHM): Undefine after include generic.h.
- Loading branch information
Showing
3 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters