Skip to content

Commit 6a6040f

Browse files
fix: replace unsupported Armv4 with Armv5TE and update Isa mapping
- Removed Arch::Armv4 as Rust does not support it - Added Arch::Armv5TE for relevant target triples - Updated Isa::get() to map Armv4T and Armv5TE to A32
1 parent 8235a09 commit 6a6040f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

arm-targets/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Isa {
7777
pub fn get(target: &str) -> Option<Isa> {
7878
let arch = Arch::get(target)?;
7979
Some(match arch {
80-
Arch::Armv4 | Arch::Armv4T => Isa::A32,
80+
Arch::Armv4T | Arch::Armv5TE => Isa::A32,
8181
Arch::Armv6M => Isa::T32,
8282
Arch::Armv7M => Isa::T32,
8383
Arch::Armv7EM => Isa::T32,
@@ -119,10 +119,10 @@ impl core::fmt::Display for Isa {
119119
/// As defined by a particular revision of the Arm Architecture Reference Manual (ARM).
120120
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
121121
pub enum Arch {
122-
/// Armv4 (legacy, also known as ARMv4)
123-
Armv4,
124122
/// Armv4T (legacy, also known as ARMv4T)
125123
Armv4T,
124+
/// Armv5TE (also known as ARMv5TE)
125+
Armv5TE,
126126
/// Armv6-M (also known as ARMv6-M)
127127
Armv6M,
128128
/// Armv7-M (also known as ARMv7-M)
@@ -146,10 +146,10 @@ pub enum Arch {
146146
impl Arch {
147147
/// Decode a target string
148148
pub fn get(target: &str) -> Option<Arch> {
149-
if target.starts_with("armv4-") {
150-
Some(Arch::Armv4)
151-
} else if target.starts_with("armv4t-") {
149+
if target.starts_with("armv4t-") {
152150
Some(Arch::Armv4T)
151+
} else if target.starts_with("armv5te-") {
152+
Some(Arch::Armv5TE)
153153
} else if target.starts_with("thumbv6m-") {
154154
Some(Arch::Armv6M)
155155
} else if target.starts_with("thumbv7m-") {
@@ -179,16 +179,16 @@ impl Arch {
179179
Arch::Armv6M | Arch::Armv7M | Arch::Armv7EM | Arch::Armv8MBase | Arch::Armv8MMain => {
180180
Profile::M
181181
}
182-
Arch::Armv4 | Arch::Armv4T | Arch::Armv7R | Arch::Armv8R => Profile::R,
182+
Arch::Armv4T | Arch::Armv5TE | Arch::Armv7R | Arch::Armv8R => Profile::R,
183183
Arch::Armv7A | Arch::Armv8A => Profile::A,
184184
}
185185
}
186186

187187
/// Get a comma-separated list of values, suitable for cfg-check
188188
pub fn values() -> String {
189189
let string_versions: Vec<String> = [
190-
Arch::Armv4,
191190
Arch::Armv4T,
191+
Arch::Armv5TE,
192192
Arch::Armv6M,
193193
Arch::Armv7M,
194194
Arch::Armv7EM,
@@ -212,8 +212,8 @@ impl core::fmt::Display for Arch {
212212
f,
213213
"{}",
214214
match self {
215-
Arch::Armv4 => "v4",
216215
Arch::Armv4T => "v4t",
216+
Arch::Armv5TE => "v5te",
217217
Arch::Armv6M => "v6-m",
218218
Arch::Armv7M => "v7-m",
219219
Arch::Armv7EM => "v7e-m",

0 commit comments

Comments
 (0)