Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf

Add SanitizerSet::ADDRESS to the supported_sanitizers for the
arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf targets.

The AddressSanitizer is already enabled on the armv7-linux-androideabi
platform, which shares the same ARM architecture. There is no reason
these Linux GNU targets should not also support it, as the underlying
LLVM support for ASan on 32-bit ARM is already in place.
This commit is contained in:
Chris Burel
2026-04-20 17:29:22 -04:00
committed by Chris Burel
parent 93637f398f
commit e981edde2b
2 changed files with 8 additions and 2 deletions
@@ -1,4 +1,6 @@
use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, base};
use crate::spec::{
Arch, CfgAbi, FloatAbi, SanitizerSet, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
Target {
@@ -24,6 +26,7 @@ pub(crate) fn target() -> Target {
// linker error, so set it to `true` here.
// FIXME(#146996): Remove this override once #146996 has been fixed.
default_uwtable: false,
supported_sanitizers: SanitizerSet::ADDRESS,
..base::linux_gnu::opts()
},
}
@@ -1,4 +1,6 @@
use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, base};
use crate::spec::{
Arch, CfgAbi, FloatAbi, SanitizerSet, Target, TargetMetadata, TargetOptions, base,
};
// This target is for glibc Linux on ARMv7 without NEON or
// thumb-mode. See the thumbv7neon variant for enabling both.
@@ -23,6 +25,7 @@ pub(crate) fn target() -> Target {
max_atomic_width: Some(64),
mcount: "\u{1}__gnu_mcount_nc".into(),
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
supported_sanitizers: SanitizerSet::ADDRESS,
..base::linux_gnu::opts()
},
}