运行AddressSanitizer时出现Clang链接器错误

时间:2020-01-27 16:38:13

标签: macos linker clang llvm address-sanitizer

我最近与LLVM一起安装了Clang。我试图了解ASAN。当我尝试将clang和ASAN标志一起运行时:

clang -fsanitize=address <file_name>

我收到以下错误

ld: file not found: /Users/vishal/Desktop/llvm/llvm-project/build/lib/clang/11.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

C语版本:

clang version 11.0.0 (https://github.com/llvm/llvm-project.git b780df052dd2b246a760d00e00f7de9ebdab9d09)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Users/vishal/Desktop/llvm/llvm-project/build/bin/.

我看到链接器有问题。正在生产ASAN的LLVM IR,没有任何错误。问题似乎是使用Clang链接ASAN运行时库。任何帮助将不胜感激。

0 个答案:

没有答案