Skip to content

Commit 40aa91f

Browse files
anoopkg6anoopkg6
andauthored
[TySan] TySan support for SystemZ - Re-submission of original pr#162396 (#169850)
This is a re-submission of original reverted patch [(#162396) ](https://github.com/llvm/llvm-project/pull/162396url)for adding TySan support for systemzZ along with build failure patch [#169746](#169746). See conversations in #169746. Co-authored-by: anoopkg6 <[email protected]>
1 parent fddf7b0 commit 40aa91f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ 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+
static const uptr kPtrShift = 3;
54+
};
4855
#else
4956
#error "TySan not supported for this platform!"
5057
#endif

0 commit comments

Comments
 (0)