Skip to content

Commit 2e9c870

Browse files
committed
Auto merge of #87664 - devnexen:netbsd_sanitizers_support, r=nagisa
netbsd x86_64 arch enable supported sanitizers.
2 parents 8d57c0a + 4258e93 commit 2e9c870

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/rustc_target/src/spec/x86_64_unknown_netbsd.rs

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

33
pub fn target() -> Target {
44
let mut base = super::netbsd_base::opts();
@@ -7,6 +7,8 @@ pub fn target() -> Target {
77
base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m64".to_string());
88
// don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
99
base.stack_probes = StackProbeType::Call;
10+
base.supported_sanitizers =
11+
SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::MEMORY | SanitizerSet::THREAD;
1012

1113
Target {
1214
llvm_target: "x86_64-unknown-netbsd".to_string(),

src/bootstrap/native.rs

+3
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,9 @@ fn supported_sanitizers(
821821
"x86_64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
822822
"x86_64-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
823823
"x86_64-unknown-freebsd" => common_libs("freebsd", "x86_64", &["asan", "msan", "tsan"]),
824+
"x86_64-unknown-netbsd" => {
825+
common_libs("netbsd", "x86_64", &["asan", "lsan", "msan", "tsan"])
826+
}
824827
"x86_64-unknown-linux-gnu" => {
825828
common_libs("linux", "x86_64", &["asan", "lsan", "msan", "tsan"])
826829
}

0 commit comments

Comments
 (0)