https://github.com/yizishun created https://github.com/llvm/llvm-project/pull/202288
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 >From af6c0ec2f2f0a06892e7140e7019a5f696df1997 Mon Sep 17 00:00:00 2001 From: Zishun Yi <[email protected]> Date: Mon, 8 Jun 2026 07:24:09 +0000 Subject: [PATCH] [clang][FreeBSD] Enable KASAN and KMSAN for riscv64 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 --- clang/lib/Driver/ToolChains/FreeBSD.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
