Fix parse_abi for gnu_ilp32 and gnuspe

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-07 11:30:00 +10:00
parent 1df135f4c0
commit 11fe943a11
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -120,16 +120,14 @@ mod linux {
}
fn parse_abi() -> &'static str {
if TARGET.ends_with("abi64") {
"abi64"
} else if TARGET.ends_with("eabi") {
"eabi"
} else if TARGET.ends_with("eabihf") {
"eabihf"
} else if TARGET.ends_with("gnu") || TARGET.ends_with("musl") {
""
let last = TARGET.rsplit_once('-').unwrap().1;
if let Some(libc_version) = last.strip_prefix("musl") {
libc_version
} else if let Some(libc_version) = last.strip_prefix("gnu") {
libc_version
} else {
panic!("Unknown abi")
panic!("Unrecognized libc")
}
}