Skip to content

Commit 09a62ec

Browse files
committed
use aapcs as system abi
1 parent f9eefea commit 09a62ec

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,6 +2262,8 @@ pub struct TargetOptions {
22622262
pub is_like_wasm: bool,
22632263
/// Whether a target toolchain is like Android, implying a Linux kernel and a Bionic libc
22642264
pub is_like_android: bool,
2265+
/// Whether a target toolchain is like VEXos.
2266+
pub is_like_vexos: bool,
22652267
/// Default supported version of DWARF on this platform.
22662268
/// Useful because some platforms (osx, bsd) only want up to DWARF2.
22672269
pub default_dwarf_version: u32,
@@ -2617,6 +2619,7 @@ impl Default for TargetOptions {
26172619
is_like_msvc: false,
26182620
is_like_wasm: false,
26192621
is_like_android: false,
2622+
is_like_vexos: false,
26202623
default_dwarf_version: 4,
26212624
allows_weak_linkage: true,
26222625
has_rpath: false,
@@ -2724,6 +2727,7 @@ impl Target {
27242727
Abi::System { unwind } if self.is_like_windows && self.arch == "x86" && !c_variadic => {
27252728
Abi::Stdcall { unwind }
27262729
}
2730+
Abi::System { unwind } if self.is_like_vexos && !c_variadic => Abi::Aapcs { unwind },
27272731
Abi::System { unwind } => Abi::C { unwind },
27282732
Abi::EfiApi if self.arch == "arm" => Abi::Aapcs { unwind: false },
27292733
Abi::EfiApi if self.arch == "x86_64" => Abi::Win64 { unwind: false },
@@ -3377,6 +3381,7 @@ impl Target {
33773381
key!(is_like_msvc, bool);
33783382
key!(is_like_wasm, bool);
33793383
key!(is_like_android, bool);
3384+
key!(is_like_vexos, bool);
33803385
key!(default_dwarf_version, u32);
33813386
key!(allows_weak_linkage, bool);
33823387
key!(has_rpath, bool);
@@ -3657,6 +3662,7 @@ impl ToJson for Target {
36573662
target_option_val!(is_like_msvc);
36583663
target_option_val!(is_like_wasm);
36593664
target_option_val!(is_like_android);
3665+
target_option_val!(is_like_vexos);
36603666
target_option_val!(default_dwarf_version);
36613667
target_option_val!(allows_weak_linkage);
36623668
target_option_val!(has_rpath);

compiler/rustc_target/src/spec/targets/armv7a_vex_v5.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub(crate) fn target() -> Target {
1616
arch: "arm".into(),
1717
options: TargetOptions {
1818
os: "vexos".into(),
19+
is_like_vexos: true,
1920
vendor: "vex".into(),
2021
cpu: "cortex-a9".into(),
2122
abi: "eabihf".into(),

library/Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ dependencies = [
418418

419419
[[package]]
420420
name = "vex-sdk"
421-
version = "0.17.0"
421+
version = "0.21.0"
422422
source = "registry+https://github.com/rust-lang/crates.io-index"
423-
checksum = "f285bbc2b96fc4c7fae42ebe365dd2e9121e7002a58b1a9e0e4b1d14dba4d6d0"
423+
checksum = "79ec210898aed247c0fb1ae4834b4648669050ae8275423a1ce5cc3d6f07649a"
424424
dependencies = [
425425
"compiler_builtins",
426426
"rustc-std-workspace-core",

library/std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ r-efi = { version = "4.5.0", features = ['rustc-dep-of-std'] }
9191
r-efi-alloc = { version = "1.0.0", features = ['rustc-dep-of-std'] }
9292

9393
[target.'cfg(target_os = "vexos")'.dependencies]
94-
vex-sdk = { version = "0.17.0", features = ['rustc-dep-of-std'] }
94+
vex-sdk = { version = "0.21.0", features = ['rustc-dep-of-std'] }
9595

9696
[features]
9797
backtrace = [

library/std/src/sys/pal/vexos/alloc.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
use crate::{
2-
alloc::{GlobalAlloc, Layout, System},
3-
ptr,
4-
sync::atomic::{AtomicBool, Ordering},
5-
};
1+
use crate::alloc::{GlobalAlloc, Layout, System};
2+
use crate::ptr;
3+
use crate::sync::atomic::{AtomicBool, Ordering};
64

75
static mut DLMALLOC: dlmalloc::Dlmalloc<Vexos> = dlmalloc::Dlmalloc::new_with_allocator(Vexos);
86

0 commit comments

Comments
 (0)