Skip to content

Commit d4b7a60

Browse files
committed
Revert [Sanitizers] Add support for RISC-V 64-bit
This reverts r375132 (git commit 00bbe99) llvm-svn: 375136
1 parent 08de59b commit d4b7a60

File tree

6 files changed

+9
-20
lines changed

6 files changed

+9
-20
lines changed

compiler-rt/cmake/config-ix.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ if(APPLE)
256256
set(X86_64 x86_64 x86_64h)
257257
endif()
258258

259-
set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} ${RISCV64}
259+
set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64}
260260
${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9})
261261
set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
262262
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9})
@@ -290,7 +290,7 @@ set(ALL_HWASAN_SUPPORTED_ARCH ${X86_64} ${ARM64})
290290
set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64}
291291
${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9})
292292
set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64})
293-
set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
293+
set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
294294
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9})
295295
set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64})
296296
set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64})

compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,7 @@ uptr internal_unlink(const char *path) {
407407
}
408408

409409
uptr internal_rename(const char *oldpath, const char *newpath) {
410-
#if defined(__riscv)
411-
return internal_syscall(SYSCALL(renameat2), AT_FDCWD, (uptr)oldpath, AT_FDCWD,
412-
(uptr)newpath, 0);
413-
#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS || SANITIZER_OPENBSD
410+
#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS || SANITIZER_OPENBSD
414411
return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD,
415412
(uptr)newpath);
416413
#else
@@ -1975,11 +1972,6 @@ static void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
19751972
# endif
19761973
*bp = ucontext->uc_mcontext.gregs[11];
19771974
*sp = ucontext->uc_mcontext.gregs[15];
1978-
#elif defined(__riscv)
1979-
ucontext_t *ucontext = (ucontext_t*)context;
1980-
*pc = ucontext->uc_mcontext.__gregs[REG_PC];
1981-
*bp = ucontext->uc_mcontext.__gregs[REG_S0];
1982-
*sp = ucontext->uc_mcontext.__gregs[REG_SP];
19831975
#else
19841976
# error "Unsupported arch"
19851977
#endif

compiler-rt/lib/sanitizer_common/sanitizer_platform.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@
255255
#define SANITIZER_SIGN_EXTENDED_ADDRESSES 0
256256
#endif
257257

258-
// The AArch64 and RISC-V linux ports use the canonical syscall set as
259-
// mandated by the upstream linux community for all new ports. Other ports
260-
// may still use legacy syscalls.
258+
// The AArch64 linux port uses the canonical syscall set as mandated by
259+
// the upstream linux community for all new ports. Other ports may still
260+
// use legacy syscalls.
261261
#ifndef SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
262-
# if (defined(__aarch64__) || defined(__riscv)) && SANITIZER_LINUX
262+
# if defined(__aarch64__) && SANITIZER_LINUX
263263
# define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 1
264264
# else
265265
# define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 0

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace __sanitizer {
6565

6666
#if !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__aarch64__)\
6767
&& !defined(__mips__) && !defined(__s390__)\
68-
&& !defined(__sparc__) && !defined(__riscv)
68+
&& !defined(__sparc__)
6969
COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat));
7070
#endif
7171

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ namespace __sanitizer {
230230
// has been removed from glibc 2.28.
231231
#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
232232
|| defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
233-
|| defined(__x86_64__) || (defined(__riscv) && __riscv_xlen == 64)
233+
|| defined(__x86_64__)
234234
#define SIZEOF_STRUCT_USTAT 32
235235
#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
236236
|| defined(__powerpc__) || defined(__s390__) || defined(__sparc__)

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ const unsigned struct_kernel_stat64_sz = 144;
9898
const unsigned struct___old_kernel_stat_sz = 0;
9999
const unsigned struct_kernel_stat_sz = 64;
100100
const unsigned struct_kernel_stat64_sz = 104;
101-
#elif defined(__riscv) && __riscv_xlen == 64
102-
const unsigned struct_kernel_stat_sz = 128;
103-
const unsigned struct_kernel_stat64_sz = 104;
104101
#endif
105102
struct __sanitizer_perf_event_attr {
106103
unsigned type;

0 commit comments

Comments
 (0)