Skip to content

Commit ace69e6

Browse files
max-niedermanTropix126
authored andcommitted
use aapcs as system abi
1 parent 3d0f59f commit ace69e6

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,8 @@ pub struct TargetOptions {
23382338
pub is_like_wasm: bool,
23392339
/// Whether a target toolchain is like Android, implying a Linux kernel and a Bionic libc
23402340
pub is_like_android: bool,
2341+
/// Whether a target toolchain is like VEXos.
2342+
pub is_like_vexos: bool,
23412343
/// Default supported version of DWARF on this platform.
23422344
/// Useful because some platforms (osx, bsd) only want up to DWARF2.
23432345
pub default_dwarf_version: u32,
@@ -2710,6 +2712,7 @@ impl Default for TargetOptions {
27102712
is_like_msvc: false,
27112713
is_like_wasm: false,
27122714
is_like_android: false,
2715+
is_like_vexos: false,
27132716
default_dwarf_version: 4,
27142717
allows_weak_linkage: true,
27152718
has_rpath: false,
@@ -2817,6 +2820,7 @@ impl Target {
28172820
Abi::System { unwind } if self.is_like_windows && self.arch == "x86" && !c_variadic => {
28182821
Abi::Stdcall { unwind }
28192822
}
2823+
Abi::System { unwind } if self.is_like_vexos && !c_variadic => Abi::Aapcs { unwind },
28202824
Abi::System { unwind } => Abi::C { unwind },
28212825
Abi::EfiApi if self.arch == "arm" => Abi::Aapcs { unwind: false },
28222826
Abi::EfiApi if self.arch == "x86_64" => Abi::Win64 { unwind: false },

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
@@ -404,9 +404,9 @@ dependencies = [
404404

405405
[[package]]
406406
name = "vex-sdk"
407-
version = "0.17.0"
407+
version = "0.21.0"
408408
source = "registry+https://github.com/rust-lang/crates.io-index"
409-
checksum = "f285bbc2b96fc4c7fae42ebe365dd2e9121e7002a58b1a9e0e4b1d14dba4d6d0"
409+
checksum = "79ec210898aed247c0fb1ae4834b4648669050ae8275423a1ce5cc3d6f07649a"
410410
dependencies = [
411411
"compiler_builtins",
412412
"rustc-std-workspace-core",

library/std/Cargo.toml

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

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

9191
[features]
9292
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)