Add new target armv7-unknown-linux-uclibceabihf
Co-authored-by: Jonah Petri <jonah@petri.us>
This commit is contained in:
parent
d7539a6af0
commit
11381a5a3a
9 changed files with 37 additions and 6 deletions
|
@ -176,6 +176,7 @@ pub fn get_fn(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) -> &'ll Value
|
||||||
if cx.use_dll_storage_attrs
|
if cx.use_dll_storage_attrs
|
||||||
&& tcx.is_dllimport_foreign_item(instance_def_id)
|
&& tcx.is_dllimport_foreign_item(instance_def_id)
|
||||||
&& tcx.sess.target.env != "gnu"
|
&& tcx.sess.target.env != "gnu"
|
||||||
|
&& tcx.sess.target.env != "uclibc"
|
||||||
{
|
{
|
||||||
llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport);
|
llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3009,7 +3009,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let target = &self.tcx.sess.target;
|
let target = &self.tcx.sess.target;
|
||||||
let target_env_gnu_like = matches!(&target.env[..], "gnu" | "musl");
|
let target_env_gnu_like = matches!(&target.env[..], "gnu" | "musl" | "uclibc");
|
||||||
let win_x64_gnu = target.os == "windows" && target.arch == "x86_64" && target.env == "gnu";
|
let win_x64_gnu = target.os == "windows" && target.arch == "x86_64" && target.env == "gnu";
|
||||||
let linux_s390x_gnu_like =
|
let linux_s390x_gnu_like =
|
||||||
target.os == "linux" && target.arch == "s390x" && target_env_gnu_like;
|
target.os == "linux" && target.arch == "s390x" && target_env_gnu_like;
|
||||||
|
@ -3107,7 +3107,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
|
||||||
if arg.layout.is_zst() {
|
if arg.layout.is_zst() {
|
||||||
// For some forsaken reason, x86_64-pc-windows-gnu
|
// For some forsaken reason, x86_64-pc-windows-gnu
|
||||||
// doesn't ignore zero-sized struct arguments.
|
// doesn't ignore zero-sized struct arguments.
|
||||||
// The same is true for {s390x,sparc64,powerpc}-unknown-linux-{gnu,musl}.
|
// The same is true for {s390x,sparc64,powerpc}-unknown-linux-{gnu,musl,uclibc}.
|
||||||
if is_return
|
if is_return
|
||||||
|| rust_abi
|
|| rust_abi
|
||||||
|| (!win_x64_gnu
|
|| (!win_x64_gnu
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
use crate::spec::{Target, TargetOptions};
|
||||||
|
|
||||||
|
// This target is for uclibc Linux on ARMv7 without NEON or
|
||||||
|
// thumb-mode. See the thumbv7neon variant for enabling both.
|
||||||
|
|
||||||
|
pub fn target() -> Target {
|
||||||
|
let base = super::linux_uclibc_base::opts();
|
||||||
|
Target {
|
||||||
|
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(),
|
||||||
|
pointer_width: 32,
|
||||||
|
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
|
||||||
|
arch: "arm".to_string(),
|
||||||
|
|
||||||
|
options: TargetOptions {
|
||||||
|
// Info about features at https://wiki.debian.org/ArmHardFloatPort
|
||||||
|
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||||
|
cpu: "generic".to_string(),
|
||||||
|
max_atomic_width: Some(64),
|
||||||
|
mcount: "_mcount".to_string(),
|
||||||
|
..base
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
|
@ -952,6 +952,8 @@ supported_targets! {
|
||||||
("bpfel-unknown-none", bpfel_unknown_none),
|
("bpfel-unknown-none", bpfel_unknown_none),
|
||||||
|
|
||||||
("armv6k-nintendo-3ds", armv6k_nintendo_3ds),
|
("armv6k-nintendo-3ds", armv6k_nintendo_3ds),
|
||||||
|
|
||||||
|
("armv7-unknown-linux-uclibceabihf", armv7_unknown_linux_uclibceabihf),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Warnings encountered when parsing the target `json`.
|
/// Warnings encountered when parsing the target `json`.
|
||||||
|
|
|
@ -307,6 +307,9 @@ cfg_if::cfg_if! {
|
||||||
#[link(name = "zircon")]
|
#[link(name = "zircon")]
|
||||||
#[link(name = "fdio")]
|
#[link(name = "fdio")]
|
||||||
extern "C" {}
|
extern "C" {}
|
||||||
|
} else if #[cfg(all(target_os = "linux", target_env = "uclibc"))] {
|
||||||
|
#[link(name = "dl")]
|
||||||
|
extern "C" {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -419,7 +419,7 @@ impl Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only glibc 2.24+ posix_spawn() supports returning ENOENT directly.
|
// Only glibc 2.24+ posix_spawn() supports returning ENOENT directly.
|
||||||
#[cfg(all(target_os = "linux", target_env = "gnu"))]
|
#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]
|
||||||
{
|
{
|
||||||
if let Some(version) = sys::os::glibc_version() {
|
if let Some(version) = sys::os::glibc_version() {
|
||||||
if version < (2, 24) {
|
if version < (2, 24) {
|
||||||
|
|
|
@ -594,7 +594,8 @@ pub mod guard {
|
||||||
Some(stackaddr - guardsize..stackaddr)
|
Some(stackaddr - guardsize..stackaddr)
|
||||||
} else if cfg!(all(target_os = "linux", target_env = "musl")) {
|
} else if cfg!(all(target_os = "linux", target_env = "musl")) {
|
||||||
Some(stackaddr - guardsize..stackaddr)
|
Some(stackaddr - guardsize..stackaddr)
|
||||||
} else if cfg!(all(target_os = "linux", target_env = "gnu")) {
|
} else if cfg!(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))
|
||||||
|
{
|
||||||
// glibc used to include the guard area within the stack, as noted in the BUGS
|
// glibc used to include the guard area within the stack, as noted in the BUGS
|
||||||
// section of `man pthread_attr_getguardsize`. This has been corrected starting
|
// section of `man pthread_attr_getguardsize`. This has been corrected starting
|
||||||
// with glibc 2.27, and in some distro backports, so the guard is now placed at the
|
// with glibc 2.27, and in some distro backports, so the guard is now placed at the
|
||||||
|
|
|
@ -63,7 +63,7 @@ cfg_if::cfg_if! {
|
||||||
// don't want to duplicate it here.
|
// don't want to duplicate it here.
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
target_os = "linux",
|
target_os = "linux",
|
||||||
target_env = "gnu",
|
any(target_env = "gnu", target_env = "uclibc"),
|
||||||
not(feature = "llvm-libunwind"),
|
not(feature = "llvm-libunwind"),
|
||||||
not(feature = "system-llvm-libunwind")
|
not(feature = "system-llvm-libunwind")
|
||||||
))]
|
))]
|
||||||
|
@ -72,7 +72,7 @@ extern "C" {}
|
||||||
|
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
target_os = "linux",
|
target_os = "linux",
|
||||||
target_env = "gnu",
|
any(target_env = "gnu", target_env = "uclibc"),
|
||||||
not(feature = "llvm-libunwind"),
|
not(feature = "llvm-libunwind"),
|
||||||
feature = "system-llvm-libunwind"
|
feature = "system-llvm-libunwind"
|
||||||
))]
|
))]
|
||||||
|
|
|
@ -220,6 +220,7 @@ target | std | host | notes
|
||||||
`armv6-unknown-netbsd-eabihf` | ? | |
|
`armv6-unknown-netbsd-eabihf` | ? | |
|
||||||
`armv6k-nintendo-3ds` | * | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
|
`armv6k-nintendo-3ds` | * | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
|
||||||
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
|
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
|
||||||
|
`armv7-unknown-linux-uclibceabihf` | ✓ | ? | ARMv7 Linux uClibc
|
||||||
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
|
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
|
||||||
`armv7-unknown-netbsd-eabihf` | ✓ | ✓ |
|
`armv7-unknown-netbsd-eabihf` | ✓ | ✓ |
|
||||||
`armv7-wrs-vxworks-eabihf` | ? | |
|
`armv7-wrs-vxworks-eabihf` | ? | |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue