forked from OSchip/llvm-project
a72dc86cdd
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) |
||
---|---|---|
.. | ||
allocator_interface.h | ||
asan_interface.h | ||
common_interface_defs.h | ||
coverage_interface.h | ||
dfsan_interface.h | ||
hwasan_interface.h | ||
linux_syscall_hooks.h | ||
lsan_interface.h | ||
msan_interface.h | ||
netbsd_syscall_hooks.h | ||
scudo_interface.h | ||
tsan_interface.h | ||
tsan_interface_atomic.h | ||
ubsan_interface.h |