[clang] 2538e55 - [Sanitizer] [Scudo] Add riscv64 support for scudo
via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 18 23:38:47 PDT 2023
Author: Jun Sha (Joshua)
Date: 2023-03-18T23:37:46-07:00
New Revision: 2538e550420fed5036d224fd93e9145c845f0ffe
URL: https://github.com/llvm/llvm-project/commit/2538e550420fed5036d224fd93e9145c845f0ffe
DIFF: https://github.com/llvm/llvm-project/commit/2538e550420fed5036d224fd93e9145c845f0ffe.diff
LOG: [Sanitizer] [Scudo] Add riscv64 support for scudo
Enable Scudo on RISCV64 on both clang side and compiler-rt side.
Reviewers: cryptoad, eugenis, vitalybuka, luismarques, hiraditya
Reviewed By: vitalybuka, luismarques
Differential Revision: https://reviews.llvm.org/D137397
Added:
Modified:
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/Driver/fsanitize.c
compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index 4bbb2f8ef6818..848d7247c20c0 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -776,7 +776,7 @@ SanitizerMask Linux::getSupportedSanitizers() const {
if (IsX86 || IsX86_64)
Res |= SanitizerKind::Function;
if (IsX86_64 || IsMIPS64 || IsAArch64 || IsX86 || IsMIPS || IsArmArch ||
- IsPowerPC64 || IsHexagon || IsLoongArch64)
+ IsPowerPC64 || IsHexagon || IsLoongArch64 || IsRISCV64)
Res |= SanitizerKind::Scudo;
if (IsX86_64 || IsAArch64 || IsRISCV64) {
Res |= SanitizerKind::HWAddress;
diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index 8ad6dc25b4d17..3b89e132a944f 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -898,6 +898,7 @@
// RUN: %clang --target=mipsel-unknown-linux-gnu -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO
// RUN: %clang --target=powerpc64-unknown-linux -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO
// RUN: %clang --target=powerpc64le-unknown-linux -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO
+// RUN: %clang --target=riscv64-linux-gnu -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO
// CHECK-SCUDO: "-fsanitize=scudo"
// RUN: %clang --target=x86_64-linux-gnu -fsanitize=scudo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SCUDO-PIE
diff --git a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
index cc929c521f85f..e3fe5570de26a 100644
--- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
@@ -70,7 +70,7 @@ set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64}
set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64}
${HEXAGON})
set(ALL_SCUDO_STANDALONE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
- ${MIPS32} ${MIPS64} ${PPC64} ${HEXAGON} ${LOONGARCH64})
+ ${MIPS32} ${MIPS64} ${PPC64} ${HEXAGON} ${LOONGARCH64} ${RISCV64})
if(APPLE)
set(ALL_XRAY_SUPPORTED_ARCH ${X86_64})
else()
More information about the cfe-commits
mailing list