diff options
author | Dan Liew <dliew@apple.com> | 2021-08-04 19:24:56 -0700 |
---|---|---|
committer | Dan Liew <dliew@apple.com> | 2021-08-05 10:07:25 -0700 |
commit | a756239e727842f2c274208acd8fb93fa745d04a (patch) | |
tree | 52ae537f4626fadcd9fb020e29773072ea421b6f /lldb/source/Commands/CommandObjectSource.cpp | |
parent | 976bd2361237f2fafc736d26dc78d1b95cd80d94 (diff) | |
download | llvm-a756239e727842f2c274208acd8fb93fa745d04a.zip llvm-a756239e727842f2c274208acd8fb93fa745d04a.tar.gz llvm-a756239e727842f2c274208acd8fb93fa745d04a.tar.bz2 |
Fix COMPILER_RT_DEBUG build for targets that don't support thread local storage.
022439931f5be77efaf80b44d587666b0c9b13b5 added code that is only enabled
when COMPILER_RT_DEBUG is enabled. This code doesn't build on targets
that don't support thread local storage because the code added uses the
THREADLOCAL macro. Consequently the COMPILER_RT_DEBUG build broke for
some Apple targets (e.g. 32-bit iOS simulators).
```
/Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp:216:8: error: thread-local storage is not supported for the current target
static THREADLOCAL InternalDeadlockDetector deadlock_detector;
^
/Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:227:24: note: expanded from macro 'THREADLOCAL'
# define THREADLOCAL __thread
^
1 error generated.
```
To fix this, this patch introduces a `SANITIZER_SUPPORTS_THREADLOCAL`
macro that is `1` iff thread local storage is supported by the current
target. That condition is then added to `SANITIZER_CHECK_DEADLOCKS` to
ensure the code is only enabled when thread local storage is available.
The implementation of `SANITIZER_SUPPORTS_THREADLOCAL` currently assumes
Clang. See `llvm-project/clang/include/clang/Basic/Features.def` for the
definition of the `tls` feature.
rdar://81543007
Differential Revision: https://reviews.llvm.org/D107524
Diffstat (limited to 'lldb/source/Commands/CommandObjectSource.cpp')
0 files changed, 0 insertions, 0 deletions