diff options
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/cmake/config-ix.cmake | 2 | ||||
-rw-r--r-- | compiler-rt/test/shadowcallstack/libc_support.h | 6 | ||||
-rw-r--r-- | compiler-rt/test/shadowcallstack/lit.cfg | 2 | ||||
-rw-r--r-- | compiler-rt/test/shadowcallstack/minimal_runtime.h | 9 | ||||
-rw-r--r-- | compiler-rt/test/shadowcallstack/overflow-aarch64.c | 5 | ||||
-rw-r--r-- | compiler-rt/test/shadowcallstack/overflow-x86_64.c | 5 | ||||
-rw-r--r-- | compiler-rt/test/shadowcallstack/overflow.c | 10 |
7 files changed, 8 insertions, 31 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake index ec35bf6065d..a667dce690b 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -254,7 +254,7 @@ set(ALL_XRAY_SUPPORTED_ARCH ${X86_64}) else() set(ALL_XRAY_SUPPORTED_ARCH ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} powerpc64le) endif() -set(ALL_SHADOWCALLSTACK_SUPPORTED_ARCH ${X86_64} ${ARM64}) +set(ALL_SHADOWCALLSTACK_SUPPORTED_ARCH ${ARM64}) if(APPLE) include(CompilerRTDarwinUtils) diff --git a/compiler-rt/test/shadowcallstack/libc_support.h b/compiler-rt/test/shadowcallstack/libc_support.h index 5d89aab645a..9c8e0566380 100644 --- a/compiler-rt/test/shadowcallstack/libc_support.h +++ b/compiler-rt/test/shadowcallstack/libc_support.h @@ -33,9 +33,5 @@ __attribute__((noinline)) void scs_fputs_stdout(const char *p) { } #else - -__attribute__((noinline)) void scs_fputs_stdout(const char *p) { - fputs(p, stdout); -} - +#error Unsupported platform #endif diff --git a/compiler-rt/test/shadowcallstack/lit.cfg b/compiler-rt/test/shadowcallstack/lit.cfg index 313cd2b8eff..d04d37831dd 100644 --- a/compiler-rt/test/shadowcallstack/lit.cfg +++ b/compiler-rt/test/shadowcallstack/lit.cfg @@ -19,5 +19,5 @@ if config.target_arch == 'aarch64': scs_arch_cflags += ' -ffixed-x18 ' config.substitutions.append( ("%clang_scs ", config.clang + ' -O0 -fsanitize=shadow-call-stack ' + scs_arch_cflags + ' ') ) -if config.host_os not in ['Linux'] or config.target_arch not in ['x86_64', 'aarch64']: +if config.host_os not in ['Linux'] or config.target_arch not in ['aarch64']: config.unsupported = True diff --git a/compiler-rt/test/shadowcallstack/minimal_runtime.h b/compiler-rt/test/shadowcallstack/minimal_runtime.h index f36fa5a7d24..fab4fdf8006 100644 --- a/compiler-rt/test/shadowcallstack/minimal_runtime.h +++ b/compiler-rt/test/shadowcallstack/minimal_runtime.h @@ -4,10 +4,6 @@ #pragma once -#ifdef __x86_64__ -#include <asm/prctl.h> -int arch_prctl(int code, void *addr); -#endif #include <stdlib.h> #include <sys/mman.h> #include <sys/prctl.h> @@ -21,10 +17,7 @@ static void __shadowcallstack_init() { if (stack == MAP_FAILED) abort(); -#if defined(__x86_64__) - if (arch_prctl(ARCH_SET_GS, stack)) - abort(); -#elif defined(__aarch64__) +#if defined(__aarch64__) __asm__ __volatile__("mov x18, %0" ::"r"(stack)); #else #error Unsupported platform diff --git a/compiler-rt/test/shadowcallstack/overflow-aarch64.c b/compiler-rt/test/shadowcallstack/overflow-aarch64.c deleted file mode 100644 index 8da798164fe..00000000000 --- a/compiler-rt/test/shadowcallstack/overflow-aarch64.c +++ /dev/null @@ -1,5 +0,0 @@ -// See overflow.c for a description. - -// REQUIRES: aarch64-target-arch -// RUN: %clang_scs %S/overflow.c -o %t -DITERATIONS=12 -// RUN: %run %t | FileCheck %S/overflow.c diff --git a/compiler-rt/test/shadowcallstack/overflow-x86_64.c b/compiler-rt/test/shadowcallstack/overflow-x86_64.c deleted file mode 100644 index 38bb13a969a..00000000000 --- a/compiler-rt/test/shadowcallstack/overflow-x86_64.c +++ /dev/null @@ -1,5 +0,0 @@ -// See overflow.c for a description. - -// REQUIRES: x86_64-target-arch -// RUN: %clang_scs %S/overflow.c -o %t -DITERATIONS=12 -// RUN: not --crash %run %t diff --git a/compiler-rt/test/shadowcallstack/overflow.c b/compiler-rt/test/shadowcallstack/overflow.c index 8c3d50c5917..f9f64096fd1 100644 --- a/compiler-rt/test/shadowcallstack/overflow.c +++ b/compiler-rt/test/shadowcallstack/overflow.c @@ -8,12 +8,10 @@ // RUN: %clang_scs %s -o %t -DITERATIONS=3 // RUN: %run %t | FileCheck %s -// The behavioral check for SCS + overflow lives in the tests overflow-x86_64.c -// and overflow-aarch64.c. This is because the expected behavior is different -// between the two platforms. On x86_64 we crash because the comparison between -// the shadow call stack and the regular stack fails. On aarch64 there is no -// comparison, we just load the return address from the shadow call stack. So we -// just expect not to see the output from print_and_exit. +// On aarch64 we just load the return address from the shadow call stack so we +// do not expect to see the output from print_and_exit. +// RUN: %clang_scs %s -o %t -DITERATIONS=12 +// RUN: %run %t | FileCheck %S/overflow.c #include <stdio.h> #include <stdlib.h> |