Skip to content

Commit e8b9d42

Browse files
anoopkg6anoopkg6
andauthored
[tysan] Type Sanitizer support for SystemZ (#162396)
Type Sanitizer support for SystemZ. Co-authored-by: anoopkg6 <[email protected]>
1 parent 9e1d3ca commit e8b9d42

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ SanitizerMask Linux::getSupportedSanitizers() const {
922922
if (IsX86_64 || IsMIPS64 || IsAArch64 || IsPowerPC64 || IsSystemZ ||
923923
IsLoongArch64 || IsRISCV64)
924924
Res |= SanitizerKind::Thread;
925-
if (IsX86_64 || IsAArch64)
925+
if (IsX86_64 || IsAArch64 || IsSystemZ)
926926
Res |= SanitizerKind::Type;
927927
if (IsX86_64 || IsSystemZ || IsPowerPC64)
928928
Res |= SanitizerKind::KernelMemory;

compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ else()
8989
set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64} ${S390X}
9090
${LOONGARCH64} ${RISCV64})
9191
endif()
92-
set(ALL_TYSAN_SUPPORTED_ARCH ${X86_64} ${ARM64})
92+
set(ALL_TYSAN_SUPPORTED_ARCH ${X86_64} ${ARM64} ${S390X})
9393
set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
9494
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
9595
${LOONGARCH64})

compiler-rt/lib/tysan/tysan_platform.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ struct Mapping48 {
4545
static const uptr kPtrShift = 3;
4646
};
4747
#define TYSAN_RUNTIME_VMA 1
48+
#elif defined(__s390x__)
49+
struct Mapping {
50+
static const uptr kShadowAddr = 0x080000000000ULL;
51+
static const uptr kAppAddr = 0x460000000000ULL;
52+
static const uptr kAppMemMsk = ~0xC00000000000ULL;
53+
};
4854
#else
4955
#error "TySan not supported for this platform!"
5056
#endif

0 commit comments

Comments
 (0)