llvm-project/compiler-rt/lib
Alex Richardson aa85c6f2a5 [compiler-rt] Fix atomic support functions on 32-bit architectures
The code currently uses __c11_atomic_is_lock_free() to detect whether an
atomic operation is natively supported. However, this can result in a
runtime function call to determine whether the given operation is lock-free
and clang generating a call to e.g. __atomic_load_8 since the branch is
not a constant zero. Since we are implementing those runtime functions, we
must avoid those calls. This patch replaces __c11_atomic_is_lock_free()
with __atomic_always_lock_free() which always results in a compile-time
constant value. This problem was found while compiling atomic.c for MIPS32
since the -Watomic-alignment warning was being triggered and objdump showed
an undefined reference to _atomic_is_lock_free.

In addition to fixing 32-bit platforms this also enables the 16-byte case
that was disabled in r153779 (185f2edd70).

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D86510
2020-09-21 10:21:11 +01:00
..
BlocksRuntime
asan [compiler-rt] Replace INLINE with inline 2020-09-17 16:24:20 +02:00
builtins [compiler-rt] Fix atomic support functions on 32-bit architectures 2020-09-21 10:21:11 +01:00
cfi [sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks 2020-09-08 10:12:05 -07:00
crt [cmake] Strip quotes in compiler-rt/lib/crt; error if checks fail 2020-03-09 15:52:39 -07:00
dfsan [DFSan] Add strpbrk wrapper. 2020-09-18 08:54:14 -07:00
fuzzer [libFuzzer] Enable entropic by default. 2020-09-16 10:44:34 -07:00
gwp_asan [GWP-ASan] Crash handler API returns sizeof(collected trace) 2020-07-27 10:51:55 -07:00
hwasan [compiler-rt] [hwasan] Replace INLINE with inline 2020-09-17 16:46:32 +02:00
interception Fix check-interception link error in compiler-rt debug mode 2019-10-10 23:30:54 +00:00
lsan [NFC][LSAN] Change SuspendedThreadsList interface 2020-09-16 14:01:27 -07:00
msan [compiler-rt] Replace INLINE with inline 2020-09-17 16:24:20 +02:00
profile [gcov] Delete flush_fn_list (unused since D83149) 2020-09-10 10:15:27 -07:00
safestack compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cpp 2019-08-01 13:56:52 +00:00
sanitizer_common [NFC][sanitizer] Don't use ::testing::internal 2020-09-18 15:26:05 -07:00
scudo [scudo/standalone] Fix undefined behavior in checksum test 2020-09-19 12:28:00 -07:00
stats compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
tsan [compiler-rt] [tsan] [netbsd] Catch unsupported LONG_JMP_SP_ENV_SLOT 2020-09-17 16:28:11 +02:00
ubsan [sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks 2020-09-08 10:12:05 -07:00
ubsan_minimal [ubsan] Check implicit casts in ObjC for-in statements 2020-07-13 15:11:18 -07:00
xray [XRay] Change mips to use version 2 sled (PC-relative address) 2020-09-20 17:59:57 -07:00
CMakeLists.txt scudo: Add support for diagnosing memory errors when memory tagging is enabled. 2020-04-17 17:26:30 -07:00