Skip to content

Commit 996be7c

Browse files
authored
Unrolled build for rust-lang#131334
Rollup merge of rust-lang#131334 - heiher:loong-sanitizers, r=Mark-Simulacrum Enable sanitizers for loongarch64-unknown-* Enable sanitizers for `loongarch64-unknown-linux-{gnu,musl,ohos}` targets.
2 parents ef4e825 + 8a5e03b commit 996be7c

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{CodeModel, Target, TargetOptions, base};
1+
use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions, base};
22

33
pub(crate) fn target() -> Target {
44
Target {
@@ -18,6 +18,11 @@ pub(crate) fn target() -> Target {
1818
features: "+f,+d".into(),
1919
llvm_abiname: "lp64d".into(),
2020
max_atomic_width: Some(64),
21+
supported_sanitizers: SanitizerSet::ADDRESS
22+
| SanitizerSet::CFI
23+
| SanitizerSet::LEAK
24+
| SanitizerSet::MEMORY
25+
| SanitizerSet::THREAD,
2126
direct_access_external_data: Some(false),
2227
..base::linux_gnu::opts()
2328
},

compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_musl.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{CodeModel, Target, TargetOptions, base};
1+
use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions, base};
22

33
pub(crate) fn target() -> Target {
44
Target {
@@ -19,6 +19,11 @@ pub(crate) fn target() -> Target {
1919
llvm_abiname: "lp64d".into(),
2020
max_atomic_width: Some(64),
2121
crt_static_default: false,
22+
supported_sanitizers: SanitizerSet::ADDRESS
23+
| SanitizerSet::CFI
24+
| SanitizerSet::LEAK
25+
| SanitizerSet::MEMORY
26+
| SanitizerSet::THREAD,
2227
..base::linux_musl::opts()
2328
},
2429
}

compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{Target, TargetOptions, base};
1+
use crate::spec::{SanitizerSet, Target, TargetOptions, base};
22

33
pub(crate) fn target() -> Target {
44
Target {
@@ -17,6 +17,11 @@ pub(crate) fn target() -> Target {
1717
features: "+f,+d".into(),
1818
llvm_abiname: "lp64d".into(),
1919
max_atomic_width: Some(64),
20+
supported_sanitizers: SanitizerSet::ADDRESS
21+
| SanitizerSet::CFI
22+
| SanitizerSet::LEAK
23+
| SanitizerSet::MEMORY
24+
| SanitizerSet::THREAD,
2025
..base::linux_ohos::opts()
2126
},
2227
}

src/bootstrap/src/core/build_steps/llvm.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,9 @@ fn supported_sanitizers(
12281228
"aarch64-unknown-linux-ohos" => {
12291229
common_libs("linux", "aarch64", &["asan", "lsan", "msan", "tsan", "hwasan"])
12301230
}
1231+
"loongarch64-unknown-linux-gnu" | "loongarch64-unknown-linux-musl" => {
1232+
common_libs("linux", "loongarch64", &["asan", "lsan", "msan", "tsan"])
1233+
}
12311234
"x86_64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
12321235
"x86_64-unknown-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
12331236
"x86_64-apple-ios" => darwin_libs("iossim", &["asan", "tsan"]),

src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ENV RUST_CONFIGURE_ARGS \
4747
--enable-extended \
4848
--enable-full-tools \
4949
--enable-profiler \
50+
--enable-sanitizers \
5051
--disable-docs
5152

5253
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $TARGETS

src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ENV RUST_CONFIGURE_ARGS \
2929
--enable-extended \
3030
--enable-full-tools \
3131
--enable-profiler \
32+
--enable-sanitizers \
3233
--disable-docs \
3334
--set target.loongarch64-unknown-linux-musl.crt-static=false \
3435
--musl-root-loongarch64=/x-tools/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/usr

0 commit comments

Comments
 (0)