Skip to content

Commit fb736a6

Browse files
fix: add Legacy profile for unsupported ARMv4T and ARMv5TE
- Introduced Profile::Legacy for ARMv4T and ARMv5TE as they predate A/R/M profiles - Updated TargetInfo and Arch::profile() mapping accordingly - Removed any references to unsupported ARMv4
1 parent 67e7411 commit fb736a6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arm-targets/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ impl Arch {
179179
Arch::Armv6M | Arch::Armv7M | Arch::Armv7EM | Arch::Armv8MBase | Arch::Armv8MMain => {
180180
Profile::M
181181
}
182-
Arch::Armv4T | Arch::Armv5TE | Arch::Armv7R | Arch::Armv8R => Profile::R,
182+
Arch::Armv4T | Arch::Armv5TE => Profile::Legacy,
183+
Arch::Armv7R | Arch::Armv8R => Profile::R,
183184
Arch::Armv7A | Arch::Armv8A => Profile::A,
184185
}
185186
}
@@ -237,6 +238,8 @@ pub enum Profile {
237238
R,
238239
/// Applications
239240
A,
241+
/// Legacy
242+
Legacy,
240243
}
241244

242245
impl Profile {
@@ -248,7 +251,7 @@ impl Profile {
248251

249252
/// Get a comma-separated list of values, suitable for cfg-check
250253
pub fn values() -> String {
251-
let string_versions: Vec<String> = [Profile::A, Profile::R, Profile::M]
254+
let string_versions: Vec<String> = [Profile::A, Profile::R, Profile::M, Profile::Legacy]
252255
.iter()
253256
.map(|i| format!(r#""{i}""#))
254257
.collect();
@@ -265,6 +268,7 @@ impl core::fmt::Display for Profile {
265268
Profile::M => "m",
266269
Profile::R => "r",
267270
Profile::A => "a",
271+
Profile::Legacy => "legacy", // <-- Added
268272
}
269273
)
270274
}

0 commit comments

Comments
 (0)