mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
Add aarch64_be-unknown-linux-musl target
This commit is contained in:
parent
b779120cad
commit
199e54c9d6
@ -1954,6 +1954,7 @@ supported_targets! {
|
||||
("armv7-unknown-linux-musleabihf", armv7_unknown_linux_musleabihf),
|
||||
("aarch64-unknown-linux-gnu", aarch64_unknown_linux_gnu),
|
||||
("aarch64-unknown-linux-musl", aarch64_unknown_linux_musl),
|
||||
("aarch64_be-unknown-linux-musl", aarch64_be_unknown_linux_musl),
|
||||
("x86_64-unknown-linux-musl", x86_64_unknown_linux_musl),
|
||||
("i686-unknown-linux-musl", i686_unknown_linux_musl),
|
||||
("i586-unknown-linux-musl", i586_unknown_linux_musl),
|
||||
|
@ -0,0 +1,40 @@
|
||||
use rustc_abi::Endian;
|
||||
|
||||
use crate::spec::{
|
||||
FramePointer, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base,
|
||||
};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_musl::opts();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.supports_xray = true;
|
||||
base.features = "+v8a,+outline-atomics".into();
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
base.supported_sanitizers = SanitizerSet::ADDRESS
|
||||
| SanitizerSet::CFI
|
||||
| SanitizerSet::LEAK
|
||||
| SanitizerSet::MEMORY
|
||||
| SanitizerSet::THREAD;
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64_be-unknown-linux-musl".into(),
|
||||
metadata: TargetMetadata {
|
||||
description: Some("ARM64 Linux (big-endian) with musl-libc 1.2.5".into()),
|
||||
tier: Some(3),
|
||||
host_tools: Some(false),
|
||||
std: Some(true),
|
||||
},
|
||||
pointer_width: 64,
|
||||
data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
|
||||
arch: "aarch64".into(),
|
||||
options: TargetOptions {
|
||||
// the AAPCS64 expects use of non-leaf frame pointers per
|
||||
// https://github.com/ARM-software/abi-aa/blob/4492d1570eb70c8fd146623e0db65b2d241f12e7/aapcs64/aapcs64.rst#the-frame-pointer
|
||||
// and we tend to encounter interesting bugs in AArch64 unwinding code if we do not
|
||||
frame_pointer: FramePointer::NonLeaf,
|
||||
mcount: "\u{1}_mcount".into(),
|
||||
endian: Endian::Big,
|
||||
..base
|
||||
},
|
||||
}
|
||||
}
|
@ -49,6 +49,7 @@
|
||||
- [aarch64-nintendo-switch-freestanding](platform-support/aarch64-nintendo-switch-freestanding.md)
|
||||
- [aarch64-unknown-linux-musl](platform-support/aarch64-unknown-linux-musl.md)
|
||||
- [aarch64_be-unknown-none-softfloat](platform-support/aarch64_be-unknown-none-softfloat.md)
|
||||
- [aarch64_be-unknown-linux-musl](platform-support/aarch64_be-unknown-linux-musl.md)
|
||||
- [amdgcn-amd-amdhsa](platform-support/amdgcn-amd-amdhsa.md)
|
||||
- [armeb-unknown-linux-gnueabi](platform-support/armeb-unknown-linux-gnueabi.md)
|
||||
- [arm-none-eabi](platform-support/arm-none-eabi.md)
|
||||
|
@ -273,6 +273,7 @@ target | std | host | notes
|
||||
[`aarch64_be-unknown-hermit`](platform-support/hermit.md) | ✓ | | ARM64 Hermit (big-endian)
|
||||
`aarch64_be-unknown-linux-gnu` | ✓ | ✓ | ARM64 Linux (big-endian)
|
||||
`aarch64_be-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (big-endian, ILP32 ABI)
|
||||
[`aarch64_be-unknown-linux-musl`](platform-support/aarch64_be-unknown-linux-musl.md) | ✓ | ✓ | ARM64 Linux (big-endian) with musl-libc 1.2.5
|
||||
[`aarch64_be-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | ARM64 NetBSD (big-endian)
|
||||
[`aarch64_be-unknown-none-softfloat`](platform-support/aarch64_be-unknown-none-softfloat.md) | * | | Bare big-endian ARM64, softfloat
|
||||
[`amdgcn-amd-amdhsa`](platform-support/amdgcn-amd-amdhsa.md) | * | | `-Ctarget-cpu=gfx...` to specify [the AMD GPU] to compile for
|
||||
|
@ -0,0 +1,49 @@
|
||||
# aarch64_be-unknown-linux-musl
|
||||
|
||||
**Tier: 3**
|
||||
|
||||
ARM64 Linux (big-endian) with musl-libc.
|
||||
|
||||
## Target maintainers
|
||||
|
||||
[@neuschaefer](https://github.com/neuschaefer)
|
||||
[@Gelbpunkt](https://github.com/Gelbpunkt)
|
||||
|
||||
## Requirements
|
||||
|
||||
The target requires a `aarch64_be-*-linux-musl` toolchain, which likely has to
|
||||
be built from source because this is a rare combination. [Buildroot] provides
|
||||
a way of doing so:
|
||||
|
||||
- select _Target options_ → _Target Architecture_ → _AArch64 (big endian)_
|
||||
- select _Toolchain_ → _C library_ → _musl_
|
||||
- select _Toolchain_ → _Enable C++ support_
|
||||
|
||||
Host tools are supported.
|
||||
|
||||
[Buildroot]: https://buildroot.org/
|
||||
|
||||
|
||||
## Building the target
|
||||
|
||||
The target can be enabled in bootstrap.toml:
|
||||
|
||||
```toml
|
||||
[build]
|
||||
target = ["aarch64_be-unknown-linux-musl"]
|
||||
|
||||
[target.aarch64_be-unknown-linux-musl]
|
||||
cc = "/path/to/buildroot/host/bin/aarch64_be-buildroot-linux-musl-cc"
|
||||
cxx = "/path/to/buildroot/host/bin/aarch64_be-buildroot-linux-musl-c++"
|
||||
linker = "/path/to/buildroot/host/bin/aarch64_be-buildroot-linux-musl-cc"
|
||||
ar = "/path/to/buildroot/host/bin/aarch64_be-buildroot-linux-musl-ar"
|
||||
ranlib = "/path/to/buildroot/host/bin/aarch64_be-buildroot-linux-musl-ranlib"
|
||||
musl-root = "/path/to/buildroot/staging"
|
||||
runner = "qemu-aarch64_be -L /path/to/buildroot/target"
|
||||
crt-static = "/path/to/buildroot/target"
|
||||
```
|
||||
|
||||
|
||||
## Testing
|
||||
|
||||
Binaries can be run under `qemu-aarch64_be` or under a big-endian Linux kernel.
|
@ -10,6 +10,9 @@
|
||||
//@ revisions: aarch64_be_unknown_linux_gnu_ilp32
|
||||
//@ [aarch64_be_unknown_linux_gnu_ilp32] compile-flags: --target aarch64_be-unknown-linux-gnu_ilp32
|
||||
//@ [aarch64_be_unknown_linux_gnu_ilp32] needs-llvm-components: aarch64
|
||||
//@ revisions: aarch64_be_unknown_linux_musl
|
||||
//@ [aarch64_be_unknown_linux_musl] compile-flags: --target aarch64_be-unknown-linux-musl
|
||||
//@ [aarch64_be_unknown_linux_musl] needs-llvm-components: aarch64
|
||||
//@ revisions: aarch64_be_unknown_netbsd
|
||||
//@ [aarch64_be_unknown_netbsd] compile-flags: --target aarch64_be-unknown-netbsd
|
||||
//@ [aarch64_be_unknown_netbsd] needs-llvm-components: aarch64
|
||||
|
Loading…
x
Reference in New Issue
Block a user