Skip to content
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

Enable sanitizers for s390x-linux #107127

Merged
merged 1 commit into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::abi::Endian;
use crate::spec::{StackProbeType, Target};
use crate::spec::{SanitizerSet, StackProbeType, Target};

pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
Expand All @@ -13,6 +13,8 @@ pub fn target() -> Target {
base.max_atomic_width = Some(64);
base.min_global_align = Some(16);
base.stack_probes = StackProbeType::Inline;
base.supported_sanitizers =
SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::MEMORY | SanitizerSet::THREAD;

Target {
llvm_target: "s390x-unknown-linux-gnu".into(),
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_target/src/spec/s390x_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::abi::Endian;
use crate::spec::{StackProbeType, Target};
use crate::spec::{SanitizerSet, StackProbeType, Target};

pub fn target() -> Target {
let mut base = super::linux_musl_base::opts();
Expand All @@ -14,6 +14,8 @@ pub fn target() -> Target {
base.min_global_align = Some(16);
base.static_position_independent_executables = true;
base.stack_probes = StackProbeType::Inline;
base.supported_sanitizers =
SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::MEMORY | SanitizerSet::THREAD;

Target {
llvm_target: "s390x-unknown-linux-musl".into(),
Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,12 @@ fn supported_sanitizers(
"x86_64-unknown-linux-musl" => {
common_libs("linux", "x86_64", &["asan", "lsan", "msan", "tsan"])
}
"s390x-unknown-linux-gnu" => {
common_libs("linux", "s390x", &["asan", "lsan", "msan", "tsan"])
}
"s390x-unknown-linux-musl" => {
common_libs("linux", "s390x", &["asan", "lsan", "msan", "tsan"])
}
_ => Vec::new(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/dist-s390x-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ ENV \

ENV HOSTS=s390x-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --enable-profiler --disable-docs
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --enable-sanitizers --enable-profiler --disable-docs
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
11 changes: 9 additions & 2 deletions src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub const ASAN_SUPPORTED_TARGETS: &[&str] = &[
"x86_64-linux-android",
"x86_64-unknown-freebsd",
"x86_64-unknown-linux-gnu",
"s390x-unknown-linux-gnu",
];

// FIXME(rcvalle): More targets are likely supported.
Expand Down Expand Up @@ -50,17 +51,23 @@ pub const LSAN_SUPPORTED_TARGETS: &[&str] = &[
"aarch64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"s390x-unknown-linux-gnu",
];

pub const MSAN_SUPPORTED_TARGETS: &[&str] =
&["aarch64-unknown-linux-gnu", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu"];
pub const MSAN_SUPPORTED_TARGETS: &[&str] = &[
"aarch64-unknown-linux-gnu",
"x86_64-unknown-freebsd",
"x86_64-unknown-linux-gnu",
"s390x-unknown-linux-gnu",
];

pub const TSAN_SUPPORTED_TARGETS: &[&str] = &[
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-unknown-freebsd",
"x86_64-unknown-linux-gnu",
"s390x-unknown-linux-gnu",
];

pub const HWASAN_SUPPORTED_TARGETS: &[&str] =
Expand Down