Skip to content

Commit 08998e9

Browse files
committed
use aapcs as system abi
1 parent 3a23f09 commit 08998e9

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
@@ -2267,6 +2267,8 @@ pub struct TargetOptions {
22672267
pub is_like_wasm: bool,
22682268
/// Whether a target toolchain is like Android, implying a Linux kernel and a Bionic libc
22692269
pub is_like_android: bool,
2270+
/// Whether a target toolchain is like VEXos.
2271+
pub is_like_vexos: bool,
22702272
/// Default supported version of DWARF on this platform.
22712273
/// Useful because some platforms (osx, bsd) only want up to DWARF2.
22722274
pub default_dwarf_version: u32,
@@ -2622,6 +2624,7 @@ impl Default for TargetOptions {
26222624
is_like_msvc: false,
26232625
is_like_wasm: false,
26242626
is_like_android: false,
2627+
is_like_vexos: false,
26252628
default_dwarf_version: 4,
26262629
allows_weak_linkage: true,
26272630
has_rpath: false,
@@ -2729,6 +2732,7 @@ impl Target {
27292732
Abi::System { unwind } if self.is_like_windows && self.arch == "x86" && !c_variadic => {
27302733
Abi::Stdcall { unwind }
27312734
}
2735+
Abi::System { unwind } if self.is_like_vexos && !c_variadic => Abi::Aapcs { unwind },
27322736
Abi::System { unwind } => Abi::C { unwind },
27332737
Abi::EfiApi if self.arch == "arm" => Abi::Aapcs { unwind: false },
27342738
Abi::EfiApi if self.arch == "x86_64" => Abi::Win64 { unwind: false },
@@ -3382,6 +3386,7 @@ impl Target {
33823386
key!(is_like_msvc, bool);
33833387
key!(is_like_wasm, bool);
33843388
key!(is_like_android, bool);
3389+
key!(is_like_vexos, bool);
33853390
key!(default_dwarf_version, u32);
33863391
key!(allows_weak_linkage, bool);
33873392
key!(has_rpath, bool);
@@ -3662,6 +3667,7 @@ impl ToJson for Target {
36623667
target_option_val!(is_like_msvc);
36633668
target_option_val!(is_like_wasm);
36643669
target_option_val!(is_like_android);
3670+
target_option_val!(is_like_vexos);
36653671
target_option_val!(default_dwarf_version);
36663672
target_option_val!(allows_weak_linkage);
36673673
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)