llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-driver

Author: 1s (yizishun)

<details>
<summary>Changes</summary>

enables KASAN and KMSAN for the riscv64 freebsd target in the Clang driver.

The corresponding FreeBSD kernel runtime support for riscv64 KASAN is currently 
under active review.

Depends on: https://reviews.freebsd.org/D57381

---
Full diff: https://github.com/llvm/llvm-project/pull/202288.diff


1 Files Affected:

- (modified) clang/lib/Driver/ToolChains/FreeBSD.cpp (+2-1) 


``````````diff
diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp 
b/clang/lib/Driver/ToolChains/FreeBSD.cpp
index 1218868ac3bda..a9d0ecb0dc152 100644
--- a/clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -483,6 +483,7 @@ FreeBSD::getSupportedSanitizers(StringRef BoundArch,
   const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
   const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
   const bool IsMIPS64 = getTriple().isMIPS64();
+  const bool IsRISCV64 = getTriple().getArch() == llvm::Triple::riscv64;
   SanitizerMask Res =
       ToolChain::getSupportedSanitizers(BoundArch, DeviceOffloadKind);
   Res |= SanitizerKind::Address;
@@ -498,7 +499,7 @@ FreeBSD::getSupportedSanitizers(StringRef BoundArch,
     Res |= SanitizerKind::Fuzzer;
     Res |= SanitizerKind::FuzzerNoLink;
   }
-  if (IsAArch64 || IsX86_64) {
+  if (IsAArch64 || IsX86_64 || IsRISCV64) {
     Res |= SanitizerKind::KernelAddress;
     Res |= SanitizerKind::KernelMemory;
     Res |= SanitizerKind::Memory;

``````````

</details>


https://github.com/llvm/llvm-project/pull/202288
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to