From 8539a3c001c4ae7400d5b4643681ee8e7dbfff24 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 29 Aug 2021 08:56:32 +0100 Subject: [PATCH] sunos systems add sanitizer supported. --- compiler/rustc_target/src/spec/x86_64_pc_solaris.rs | 3 ++- compiler/rustc_target/src/spec/x86_64_unknown_illumos.rs | 3 ++- src/bootstrap/native.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/spec/x86_64_pc_solaris.rs b/compiler/rustc_target/src/spec/x86_64_pc_solaris.rs index b78e43d4fe9b6..34b6d2901c820 100644 --- a/compiler/rustc_target/src/spec/x86_64_pc_solaris.rs +++ b/compiler/rustc_target/src/spec/x86_64_pc_solaris.rs @@ -1,4 +1,4 @@ -use crate::spec::{LinkerFlavor, StackProbeType, Target}; +use crate::spec::{LinkerFlavor, SanitizerSet, StackProbeType, Target}; pub fn target() -> Target { let mut base = super::solaris_base::opts(); @@ -8,6 +8,7 @@ pub fn target() -> Target { base.max_atomic_width = Some(64); // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved base.stack_probes = StackProbeType::Call; + base.supported_sanitizers = SanitizerSet::ADDRESS; Target { llvm_target: "x86_64-pc-solaris".to_string(), diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_illumos.rs b/compiler/rustc_target/src/spec/x86_64_unknown_illumos.rs index d3f9349d99b8e..ec196a7f82329 100644 --- a/compiler/rustc_target/src/spec/x86_64_unknown_illumos.rs +++ b/compiler/rustc_target/src/spec/x86_64_unknown_illumos.rs @@ -1,10 +1,11 @@ -use crate::spec::{LinkerFlavor, Target}; +use crate::spec::{LinkerFlavor, SanitizerSet, Target}; pub fn target() -> Target { let mut base = super::illumos_base::opts(); base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string(), "-std=c99".to_string()]); base.cpu = "x86-64".to_string(); base.max_atomic_width = Some(64); + base.supported_sanitizers = SanitizerSet::ADDRESS; Target { // LLVM does not currently have a separate illumos target, diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 0a23d4fff6bda..8cf43eac404c6 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -839,6 +839,8 @@ fn supported_sanitizers( "x86_64-unknown-netbsd" => { common_libs("netbsd", "x86_64", &["asan", "lsan", "msan", "tsan"]) } + "x86_64-unknown-illumos" => common_libs("illumos", "x86_64", &["asan"]), + "x86_64-pc-solaris" => common_libs("solaris", "x86_64", &["asan"]), "x86_64-unknown-linux-gnu" => { common_libs("linux", "x86_64", &["asan", "lsan", "msan", "tsan"]) }