llvm-project/compiler-rt/include/sanitizer
Dmitry Vyukov a72dc86cdd tsan: tsan_interface.h: make constants static
Note that in C++ the static keyword is implicit for const objects.
In C however it is not, and we get clashes at link time after
including the header from more than one C file:

lib.a(bar.o):(.rodata+0x0): multiple definition of `__tsan_mutex_linker_init'
lib.a(foo.o):(.rodata+0x0): first defined here
lib.a(bar.o):(.rodata+0xc): multiple definition of `__tsan_mutex_not_static'
lib.a(foo.o):(.rodata+0xc): first defined here
<snip>
Indeed both foo.o and bar.o define the clashing symbols:

$ nm foo.o
<snip>
0000000000000000 R __tsan_mutex_linker_init
000000000000000c R __tsan_mutex_not_static
<snip>
Fix it by explicitly making the constants static.

Reviewed-in: https://reviews.llvm.org/D75820
Author: cota (Emilio G. Cota)
2020-03-10 09:13:41 +01:00
..
allocator_interface.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_interface.h [asan] Provide an interface to update an allocation stack trace. 2019-10-31 13:54:46 -07:00
common_interface_defs.h [compiler-rt] Update comments in asan header to doxygen format; NFC. 2019-06-11 08:59:46 +00:00
coverage_interface.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
dfsan_interface.h [dfsan] Revert dfsan_set_label removal 2019-09-11 23:43:23 +00:00
hwasan_interface.h [sanitizer] Implement reallocarray. 2019-05-01 17:33:01 +00:00
linux_syscall_hooks.h [sanitizer] Add missing declarations for sigaltstack syscall wrappers. 2020-02-04 13:10:43 -08:00
lsan_interface.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
msan_interface.h [MSan] Introduce __msan_unpoison_param(). 2019-05-09 21:50:57 +00:00
netbsd_syscall_hooks.h [compiler-rt] Adapt for ptrace(2) changes in NetBSD-9.99.30 2019-12-24 20:34:58 +01:00
scudo_interface.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
tsan_interface.h tsan: tsan_interface.h: make constants static 2020-03-10 09:13:41 +01:00
tsan_interface_atomic.h Remove NOLINTs from compiler-rt 2019-09-11 23:19:48 +00:00
ubsan_interface.h [compiler-rt] Add ubsan interface header. 2019-09-13 08:22:58 +00:00