llvm-project/compiler-rt/include
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
..
fuzzer [compiler-rt] Fix a typo in a comment in FuzzedDataProvider.h. 2020-02-25 17:10:16 -08:00
profile Reland: [Coverage] Revise format to reduce binary size 2020-02-28 18:12:04 -08:00
sanitizer tsan: tsan_interface.h: make constants static 2020-03-10 09:13:41 +01:00
xray Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00