Add MSan compiler-rt library to LDC install and add it to linkerline for --fsanitize=memory (#3751)

* Add MSan compiler-rt library to LDC install and add it to linkerline for --fsanitize=memory

* MSan: Add support for `-fsanitize-memory-track-origins=`
This commit is contained in:
Johan Engelen 2021-06-07 00:29:18 +02:00 committed by GitHub
parent 4e6c9d0ffd
commit a5025bf83e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 5 deletions

View file

@ -471,10 +471,8 @@ void ArgsBuilder::addSanitizers(const llvm::Triple &triple) {
addFuzzLinkFlags(triple);
}
// TODO: instead of this, we should link with our own sanitizer libraries
// because LDC's LLVM version could be different from the system clang.
if (opts::isSanitizerEnabled(opts::MemorySanitizer)) {
args.push_back("-fsanitize=memory");
addSanitizerLinkFlags(triple, "msan", "-fsanitize=memory");
}
if (opts::isSanitizerEnabled(opts::ThreadSanitizer)) {