I just compiled Clang using CMake and then tried running a sanitizer (with clang -fsanitize=address
), but got:
/usr/bin/ld: cannot find <CLANG_DIR>/9.0.0/lib/linux/libclang_rt.asan-x86_64.a:
No such file or directory
I then went to the "How to build" Address sanitizer page, but it simply says:
Build LLVM/Clang with CMake.
Which takes me back to the first page. The only mention of "sanitize" anywhere within the page is:
LLVM_USE_SANITIZER:STRING
Define the sanitizer used to build LLVM binaries and tests. Possible values are Address, Memory, MemoryWithOrigins, Undefined, Thread, and Address;Undefined. Defaults to empty string.
But this is related to using sanitizers to build LLVM itself, not to making them available after the build.
So, how can I actually build the sanitizers and make them available for Clang?