| Issue |
164216
|
| Summary |
sanitize/tsan_interface.h is NOT modules friendly
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
pinskia
|
fowarded from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122344.
GCC's libstdc++'s memory includes sanitize/tsan_interface.h if thread sanitizer is turned on BUT if you use memory in a modules to export anything, GCC 15+ errors out due to `TU-local entities` being in use:
```
error: 'template<class _Tp> std::_Sp_atomic< <template-parameter-1-1> >::_Atomic_count::~_Atomic_count()' exposes TU-local entity '__tsan_mutex_not_static'
tsan_interface.h:50:23: note: '__tsan_mutex_not_static' declared with internal linkage
50 | static const unsigned __tsan_mutex_not_static = 1 << 8;
```
That is __tsan_mutex_not_static is not modules friendly.
None of the following are:
```
// Mutex has static storage duration and no-op constructor and destructor.
// This effectively makes tsan ignore destroy annotation.
static const unsigned __tsan_mutex_linker_init = 1 << 0;
// Mutex is write reentrant.
static const unsigned __tsan_mutex_write_reentrant = 1 << 1;
// Mutex is read reentrant.
static const unsigned __tsan_mutex_read_reentrant = 1 << 2;
// Mutex does not have static storage duration, and must not be used after
// its destructor runs. The opposite of __tsan_mutex_linker_init.
// If this flag is passed to __tsan_mutex_destroy, then the destruction
// is ignored unless this flag was previously set on the mutex.
static const unsigned __tsan_mutex_not_static = 1 << 8;
```
These constants still are an issue:
https://github.com/llvm/llvm-project/blob/086666de834a72eadc302a18e2bc51ba2bce1937/compiler-rt/include/sanitizer/tsan_interface.h#L50
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs