Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add address sanitizer for android #94601

Merged
merged 1 commit into from
Mar 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/aarch64_linux_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ pub fn target() -> Target {
features: "+neon,+fp-armv8".to_string(),
supported_sanitizers: SanitizerSet::CFI
| SanitizerSet::HWADDRESS
| SanitizerSet::MEMTAG,
| SanitizerSet::MEMTAG
| SanitizerSet::ADDRESS,
..super::android_base::opts()
},
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/arm_linux_androideabi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::spec::{Target, TargetOptions};
use crate::spec::{SanitizerSet, Target, TargetOptions};

pub fn target() -> Target {
Target {
Expand All @@ -10,6 +10,7 @@ pub fn target() -> Target {
abi: "eabi".to_string(),
// https://developer.android.com/ndk/guides/abis.html#armeabi
features: "+strict-align,+v5te".to_string(),
supported_sanitizers: SanitizerSet::ADDRESS,
max_atomic_width: Some(32),
..super::android_base::opts()
},
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/armv7_linux_androideabi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::spec::{LinkerFlavor, Target, TargetOptions};
use crate::spec::{LinkerFlavor, SanitizerSet, Target, TargetOptions};

// This target if is for the baseline of the Android v7a ABI
// in thumb mode. It's named armv7-* instead of thumbv7-*
Expand All @@ -19,6 +19,7 @@ pub fn target() -> Target {
options: TargetOptions {
abi: "eabi".to_string(),
features: "+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon".to_string(),
supported_sanitizers: SanitizerSet::ADDRESS,
max_atomic_width: Some(64),
..base
},
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/spec/i686_linux_android.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::spec::{StackProbeType, Target};
use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions};

// See https://developer.android.com/ndk/guides/abis.html#x86
// for target ABI requirements.
Expand All @@ -21,6 +21,6 @@ pub fn target() -> Target {
f64:32:64-f80:32-n8:16:32-S128"
.to_string(),
arch: "x86".to_string(),
options: base,
options: TargetOptions { supported_sanitizers: SanitizerSet::ADDRESS, ..base },
}
}
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/spec/x86_64_linux_android.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::spec::{LinkerFlavor, StackProbeType, Target};
use crate::spec::{LinkerFlavor, SanitizerSet, StackProbeType, Target, TargetOptions};

pub fn target() -> Target {
let mut base = super::android_base::opts();
Expand All @@ -16,6 +16,6 @@ pub fn target() -> Target {
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
.to_string(),
arch: "x86_64".to_string(),
options: base,
options: TargetOptions { supported_sanitizers: SanitizerSet::ADDRESS, ..base },
}
}