我正在尝试在OSX上使用clang的--thread-sanitizer选项:
$ clang++ -fthread-sanitizer -fpic tsan1.cc
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
[...]
clang -cc1 version 4.2 based upon LLVM 3.2svn default target x86_64-apple-darwin12.3.0
[...]
Undefined symbols for architecture x86_64:
"___tsan_func_entry", referenced from:
threadfunc(void*) in tsan1-6f7gbr.o
[...]
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)看起来像是链接错误。我应该链接一些额外的库吗?
发布于 2014-02-19 17:07:05
在用于C++的Darwin上还不支持ThreadSanitizer。这种情况至少在半年内不太可能改变。
发布于 2019-11-07 20:25:22
已经修好了。根据https://clang.llvm.org/docs/ThreadSanitizer.html的说法
以下操作系统支持
ThreadSanitizer:...达尔文arm64,x86_64,...
此外,我只是使用它没有任何问题。
https://stackoverflow.com/questions/16096683
复制相似问题