-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using sanitizer runtimes on RISC-V #564
base: dev
Are you sure you want to change the base?
Changes from all commits
a7421e8
09d7ac6
9a1a63a
d4dda34
6880e5d
418cc82
16ac532
de6704f
f5ac08e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// RUN: %riscv64_cheri_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined %s -### 2>&1 | FileCheck --check-prefixes=UBSAN,UBSAN-RISCV64 %s | ||
// RUN: %riscv64_cheri_purecap_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined %s -### 2>&1 | FileCheck --check-prefixes=UBSAN,UBSAN-PURECAP-RISCV64 %s | ||
// RUN: %riscv32_cheri_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined %s -### 2>&1 | FileCheck --check-prefixes=UBSAN,UBSAN-RISCV32 %s | ||
// RUN: %riscv32_cheri_purecap_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined %s -### 2>&1 | FileCheck --check-prefixes=UBSAN,UBSAN-PURECAP-RISCV32 %s | ||
// RUN: %cheri_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined %s -### 2>&1 | FileCheck --check-prefixes=UBSAN,UBSAN-MIPS64 %s | ||
// RUN: %cheri_purecap_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined %s -### 2>&1 | FileCheck --check-prefixes=UBSAN,UBSAN-PURECAP-MIPS64 %s | ||
|
||
// UBSAN: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" "-isysroot" | ||
// UBSAN-SAME: "-fsanitize=alignment,array-bounds, | ||
// UBSAN-SAME: "-fsanitize-recover=alignment,array-bounds, | ||
// UBSAN-NEXT: "/usr/bin/ld" | ||
// UBSAN-RISCV64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-riscv64.a" | ||
// UBSAN-PURECAP-RISCV64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-riscv64c.a" | ||
// UBSAN-RISCV32-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-riscv32.a" | ||
// UBSAN-PURECAP-RISCV32-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-riscv32c.a" | ||
// UBSAN-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-mips64.a" | ||
// UBSAN-PURECAP-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-mips64c128.a" | ||
|
||
// RUN: %riscv64_cheri_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck --check-prefixes=UBSAN-MINIMAL,UBSAN-MINIMAL-RISCV64 %s | ||
// RUN: %riscv64_cheri_purecap_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck --check-prefixes=UBSAN-MINIMAL,UBSAN-MINIMAL-PURECAP-RISCV64 %s | ||
// RUN: %riscv32_cheri_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck --check-prefixes=UBSAN-MINIMAL,UBSAN-MINIMAL-RISCV32 %s | ||
// RUN: %riscv32_cheri_purecap_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck --check-prefixes=UBSAN-MINIMAL,UBSAN-MINIMAL-PURECAP-RISCV32 %s | ||
// RUN: %cheri_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck --check-prefixes=UBSAN-MINIMAL,UBSAN-MINIMAL-MIPS64 %s | ||
// RUN: %cheri_purecap_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=undefined -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck --check-prefixes=UBSAN-MINIMAL,UBSAN-MINIMAL-PURECAP-MIPS64 %s | ||
|
||
// UBSAN-MINIMAL: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" "-isysroot" | ||
// UBSAN-MINIMAL-SAME: "-fsanitize=alignment,array-bounds, | ||
// UBSAN-MINIMAL-SAME: "-fsanitize-recover=alignment,array-bounds, | ||
// UBSAN-MINIMAL-NEXT: "/usr/bin/ld" | ||
// UBSAN-MINIMAL-RISCV64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_minimal-riscv64.a" | ||
// UBSAN-MINIMAL-PURECAP-RISCV64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_minimal-riscv64c.a" | ||
// UBSAN-MINIMAL-RISCV32-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_minimal-riscv32.a" | ||
// UBSAN-MINIMAL-PURECAP-RISCV32-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_minimal-riscv32c.a" | ||
// UBSAN-MINIMAL-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_minimal-mips64.a" | ||
// UBSAN-MINIMAL-PURECAP-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_minimal-mips64c128.a" | ||
|
||
// FIXME: fsanitize=fuzzer is not accepted for RISC-V | ||
// RUN: %cheri_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=fuzzer %s -### 2>&1 | FileCheck --check-prefixes=FUZZER,FUZZER-MIPS64 %s | ||
// RUN: %cheri_purecap_clang --sysroot=%S/Inputs/basic_cheribsd_libXXc_tree \ | ||
// RUN: -fsanitize=fuzzer %s -### 2>&1 | FileCheck --check-prefixes=FUZZER,FUZZER-PURECAP-MIPS64 %s | ||
|
||
|
||
// FUZZER: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" "-isysroot" | ||
// FUZZER-SAME: "-fsanitize-coverage | ||
// FUZZER-SAME: "-fsanitize=fuzzer,fuzzer-no-link" | ||
// FUZZER: "/usr/bin/ld" | ||
// FUZZER-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.fuzzer-mips64.a" | ||
// FUZZER-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-mips64.a" | ||
// FUZZER-PURECAP-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.fuzzer-mips64c128.a" | ||
// FUZZER-PURECAP-MIPS64-SAME: "[[RESOURCE_DIR]]/lib/freebsd/libclang_rt.ubsan_standalone-mips64c128.a" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -606,7 +606,6 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} | |
set(mips64el_SOURCES ${GENERIC_TF_SOURCES} | ||
${mips_SOURCES}) | ||
set(mips64c128_SOURCES ${GENERIC_TF_SOURCES} ${mips_SOURCES}) | ||
set(mips64c256_SOURCES ${GENERIC_TF_SOURCES} ${mips_SOURCES}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You won't be missed... |
||
|
||
|
||
set(powerpc_SOURCES ${GENERIC_SOURCES}) | ||
|
@@ -645,10 +644,15 @@ set(riscv32_SOURCES | |
riscv/mulsi3.S | ||
${riscv_SOURCES} | ||
) | ||
set(riscv32c_SOURCES ${riscv64_SOURCES}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy-paste error, though the lists happen to be the same |
||
set(riscv64_SOURCES | ||
riscv/muldi3.S | ||
${riscv_SOURCES} | ||
) | ||
set(riscv64c_SOURCES ${riscv64_SOURCES}) | ||
# save.S and restore.S need https://github.com/CTSRD-CHERI/llvm-project/pull/533 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can drop this now |
||
list(REMOVE_ITEM riscv32c_SOURCES riscv/save.S riscv/restore.S) | ||
list(REMOVE_ITEM riscv64c_SOURCES riscv/save.S riscv/restore.S) | ||
|
||
set(sparc_SOURCES ${GENERIC_SOURCES} ${GENERIC_TF_SOURCES}) | ||
set(sparcv9_SOURCES ${GENERIC_SOURCES} ${GENERIC_TF_SOURCES}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay more CheriPurecap environment removal, last I looked at it it was a bit awkward to remove from several places but maybe I should revisit that