Rollup merge of #131334 - heiher:loong-sanitizers, r=Mark-Simulacrum

Enable sanitizers for loongarch64-unknown-*

Enable sanitizers for `loongarch64-unknown-linux-{gnu,musl,ohos}` targets.
This commit is contained in:
Trevor Gross 2024-10-12 21:38:35 -05:00 committed by GitHub
commit d576cdda7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 23 additions and 3 deletions

View File

@ -1,4 +1,4 @@
use crate::spec::{CodeModel, Target, TargetOptions, base};
use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@ -18,6 +18,11 @@ pub(crate) fn target() -> Target {
features: "+f,+d".into(),
llvm_abiname: "lp64d".into(),
max_atomic_width: Some(64),
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::LEAK
| SanitizerSet::MEMORY
| SanitizerSet::THREAD,
direct_access_external_data: Some(false),
..base::linux_gnu::opts()
},

View File

@ -1,4 +1,4 @@
use crate::spec::{CodeModel, Target, TargetOptions, base};
use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@ -19,6 +19,11 @@ pub(crate) fn target() -> Target {
llvm_abiname: "lp64d".into(),
max_atomic_width: Some(64),
crt_static_default: false,
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::LEAK
| SanitizerSet::MEMORY
| SanitizerSet::THREAD,
..base::linux_musl::opts()
},
}

View File

@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions, base};
use crate::spec::{SanitizerSet, Target, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
@ -17,6 +17,11 @@ pub(crate) fn target() -> Target {
features: "+f,+d".into(),
llvm_abiname: "lp64d".into(),
max_atomic_width: Some(64),
supported_sanitizers: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::LEAK
| SanitizerSet::MEMORY
| SanitizerSet::THREAD,
..base::linux_ohos::opts()
},
}

View File

@ -1228,6 +1228,9 @@ fn supported_sanitizers(
"aarch64-unknown-linux-ohos" => {
common_libs("linux", "aarch64", &["asan", "lsan", "msan", "tsan", "hwasan"])
}
"loongarch64-unknown-linux-gnu" | "loongarch64-unknown-linux-musl" => {
common_libs("linux", "loongarch64", &["asan", "lsan", "msan", "tsan"])
}
"x86_64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
"x86_64-unknown-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
"x86_64-apple-ios" => darwin_libs("iossim", &["asan", "tsan"]),

View File

@ -47,6 +47,7 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-full-tools \
--enable-profiler \
--enable-sanitizers \
--disable-docs
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $TARGETS

View File

@ -29,6 +29,7 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-full-tools \
--enable-profiler \
--enable-sanitizers \
--disable-docs \
--set target.loongarch64-unknown-linux-musl.crt-static=false \
--musl-root-loongarch64=/x-tools/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/usr