Skip to content

Commit

Permalink
sanitizers: Stabilize core sanitizers
Browse files Browse the repository at this point in the history
Stabilize AddressSanitizer, LeakSanitizer, MemorySanitizer,
ThreadSanitizer for the Tier 1 targets that support them.
  • Loading branch information
rcvalle authored and Ramon de C Valle committed Apr 23, 2024
1 parent 91bd12e commit f81f25d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ pub fn target() -> Target {
max_atomic_width: Some(128),
stack_probes: StackProbeType::Inline,
supported_sanitizers: SanitizerSupport {
stable: SanitizerSet::empty(),
unstable: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::HWADDRESS
| SanitizerSet::KCFI
stable: SanitizerSet::ADDRESS
| SanitizerSet::LEAK
| SanitizerSet::MEMORY
| SanitizerSet::MEMTAG
| SanitizerSet::THREAD,
unstable: SanitizerSet::CFI
| SanitizerSet::KCFI
| SanitizerSet::MEMTAG
| SanitizerSet::HWADDRESS,
},
supports_xray: true,
..base::linux_gnu::opts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub fn target() -> Target {
base.cpu = "pentium4".into();
base.max_atomic_width = Some(64);
base.supported_sanitizers =
SanitizerSupport { stable: SanitizerSet::empty(), unstable: SanitizerSet::ADDRESS };
SanitizerSupport { stable: SanitizerSet::ADDRESS, unstable: SanitizerSet::empty() };

base.add_pre_link_args(
LinkerFlavor::Msvc(Lld::No),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn target() -> Target {
base.cpu = "pentium4".into();
base.max_atomic_width = Some(64);
base.supported_sanitizers =
SanitizerSupport { stable: SanitizerSet::empty(), unstable: SanitizerSet::ADDRESS };
SanitizerSupport { stable: SanitizerSet::ADDRESS, unstable: SanitizerSet::empty() };
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);
base.stack_probes = StackProbeType::Inline;

Expand Down
7 changes: 2 additions & 5 deletions compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ pub fn target() -> Target {
base.frame_pointer = FramePointer::Always;
base.add_pre_link_args(LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-m64"]);
base.supported_sanitizers = SanitizerSupport {
stable: SanitizerSet::empty(),
unstable: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::LEAK
| SanitizerSet::THREAD,
stable: SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::THREAD,
unstable: SanitizerSet::CFI,
};

Target {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn target() -> Target {
base.plt_by_default = false;
base.max_atomic_width = Some(128);
base.supported_sanitizers =
SanitizerSupport { stable: SanitizerSet::empty(), unstable: SanitizerSet::ADDRESS };
SanitizerSupport { stable: SanitizerSet::ADDRESS, unstable: SanitizerSet::empty() };

Target {
llvm_target: "x86_64-pc-windows-msvc".into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ pub fn target() -> Target {
base.stack_probes = StackProbeType::Inline;
base.static_position_independent_executables = true;
base.supported_sanitizers = SanitizerSupport {
stable: SanitizerSet::empty(),
unstable: SanitizerSet::ADDRESS
| SanitizerSet::CFI
| SanitizerSet::DATAFLOW
| SanitizerSet::KCFI
stable: SanitizerSet::ADDRESS
| SanitizerSet::LEAK
| SanitizerSet::MEMORY
| SanitizerSet::SAFESTACK
| SanitizerSet::THREAD,
unstable: SanitizerSet::CFI
| SanitizerSet::KCFI
| SanitizerSet::DATAFLOW
| SanitizerSet::SAFESTACK,
};
base.supports_xray = true;

Expand Down

0 comments on commit f81f25d

Please sign in to comment.