diff options
| author | bors <bors@rust-lang.org> | 2020-12-01 04:53:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-12-01 04:53:38 +0000 |
| commit | 29c4358c189fbb3bd3fd7ac3d7a95fac7b97814c (patch) | |
| tree | 002ec044f02ef56bbf5c736d4c5b828038b87add | |
| parent | becec6d01e22e28137019b4cd7f142cb76ec39af (diff) | |
| parent | b2ad73e8a4c373593ae3b54e1b61d35c35dc214a (diff) | |
| download | rust-29c4358c189fbb3bd3fd7ac3d7a95fac7b97814c.tar.gz rust-29c4358c189fbb3bd3fd7ac3d7a95fac7b97814c.zip | |
Auto merge of #78142 - operutka:armv5te-unknown-linux-uclibcgnueabi-target, r=petrochenkov
Add built-in support for the armv5te-unknown-linux-uclibcgnueabi target Hi! I'd like to add built-in support for the `armv5te-unknown-linux-uclibcgnueabi` target. It's a pretty common target used by many devices like routers and IP cameras. It's mostly a copy-paste of `armv5te-unknown-linux-gnueabi`. I've tested it on a quite complex application that uses tokio, openssl and a lot of other stuff and everything seems to be working fine. I'm not sure about the `post_link_args` but the point is that my linker fails when `-ldl` isn't specified. Maybe there is a better place where to put this option... It's my first contribution to Rust itself, so feel free to wash my head :smile: _Note: The app mentioned above was built with this in my `.cargo/config`:_ ``` [unstable] build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] build-std-features = ["panic_immediate_abort"] ```
| -rw-r--r-- | compiler/rustc_target/src/spec/armv5te_unknown_linux_uclibceabi.rs | 20 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 1 | ||||
| -rw-r--r-- | src/doc/rustc/src/platform-support.md | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/armv5te_unknown_linux_uclibceabi.rs b/compiler/rustc_target/src/spec/armv5te_unknown_linux_uclibceabi.rs new file mode 100644 index 00000000000..3eb0f4db833 --- /dev/null +++ b/compiler/rustc_target/src/spec/armv5te_unknown_linux_uclibceabi.rs @@ -0,0 +1,20 @@ +use crate::spec::{Target, TargetOptions}; + +pub fn target() -> Target { + Target { + llvm_target: "armv5te-unknown-linux-uclibcgnueabi".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 { + features: "+soft-float,+strict-align".to_string(), + // Atomic operations provided by compiler-builtins + max_atomic_width: Some(32), + unsupported_abis: super::arm_base::unsupported_abis(), + mcount: "\u{1}__gnu_mcount_nc".to_string(), + has_thumb_interworking: true, + + ..super::linux_uclibc_base::opts() + }, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index b4414e53331..8d749493d0a 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -504,6 +504,7 @@ supported_targets! { ("armv4t-unknown-linux-gnueabi", armv4t_unknown_linux_gnueabi), ("armv5te-unknown-linux-gnueabi", armv5te_unknown_linux_gnueabi), ("armv5te-unknown-linux-musleabi", armv5te_unknown_linux_musleabi), + ("armv5te-unknown-linux-uclibceabi", armv5te_unknown_linux_uclibceabi), ("armv7-unknown-linux-gnueabi", armv7_unknown_linux_gnueabi), ("armv7-unknown-linux-gnueabihf", armv7_unknown_linux_gnueabihf), ("thumbv7neon-unknown-linux-gnueabihf", thumbv7neon_unknown_linux_gnueabihf), diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index 99e0a2b177f..52cfb08cdc9 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -162,6 +162,7 @@ target | std | host | notes `aarch64-uwp-windows-msvc` | ? | | `aarch64-wrs-vxworks` | ? | | `armv4t-unknown-linux-gnueabi` | ? | | +`armv5te-unknown-linux-uclibceabi` | ? | | ARMv5TE Linux with uClibc `armv6-unknown-freebsd` | ✓ | ✓ | ARMv6 FreeBSD `armv6-unknown-netbsd-eabihf` | ? | | `armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8 |
