Skip to content

Commit 21303f5

Browse files
committed
Auto merge of rust-lang#88952 - skrap:add-armv7-uclibc, r=nagisa
Add new tier-3 target: armv7-unknown-linux-uclibceabihf This change adds a new tier-3 target: armv7-unknown-linux-uclibceabihf This target is primarily used in embedded linux devices where system resources are slim and glibc is deemed too heavyweight. Cross compilation C toolchains are available [here](https://toolchains.bootlin.com/) or via [buildroot](https://buildroot.org). The change is based largely on a previous PR rust-lang#79380 with a few minor modifications. The author of that PR was unable to push the PR forward, and graciously allowed me to take it over. Per the [target tier 3 policy](https://github.com/rust-lang/rfcs/blob/master/text/2803-target-tier-policy.md), I volunteer to be the "target maintainer". This is my first PR to Rust itself, so I apologize if I've missed things!
2 parents b426a13 + 7af425f commit 21303f5

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

std/src/sys/unix/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ cfg_if::cfg_if! {
307307
#[link(name = "zircon")]
308308
#[link(name = "fdio")]
309309
extern "C" {}
310+
} else if #[cfg(all(target_os = "linux", target_env = "uclibc"))] {
311+
#[link(name = "dl")]
312+
extern "C" {}
310313
}
311314
}
312315

std/src/sys/unix/thread.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ pub mod guard {
594594
Some(stackaddr - guardsize..stackaddr)
595595
} else if cfg!(all(target_os = "linux", target_env = "musl")) {
596596
Some(stackaddr - guardsize..stackaddr)
597-
} else if cfg!(all(target_os = "linux", target_env = "gnu")) {
597+
} else if cfg!(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))
598+
{
598599
// glibc used to include the guard area within the stack, as noted in the BUGS
599600
// section of `man pthread_attr_getguardsize`. This has been corrected starting
600601
// with glibc 2.27, and in some distro backports, so the guard is now placed at the

unwind/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cfg_if::cfg_if! {
6363
// don't want to duplicate it here.
6464
#[cfg(all(
6565
target_os = "linux",
66-
target_env = "gnu",
66+
any(target_env = "gnu", target_env = "uclibc"),
6767
not(feature = "llvm-libunwind"),
6868
not(feature = "system-llvm-libunwind")
6969
))]
@@ -72,7 +72,7 @@ extern "C" {}
7272

7373
#[cfg(all(
7474
target_os = "linux",
75-
target_env = "gnu",
75+
any(target_env = "gnu", target_env = "uclibc"),
7676
not(feature = "llvm-libunwind"),
7777
feature = "system-llvm-libunwind"
7878
))]

0 commit comments

Comments
 (0)