Skip to content

Commit 5611e68

Browse files
committed
Add support for arm-unknown-linux-musleabi{,hf} targets.
These targets will be similar to the x86_64-unknown-linux-musl target, in that they'll use MUSL libc to allow fully static binaries to be generated. To remain consistent with the naming of existing ARM targets, as well as with the standard naming of MUSL toolchains, we'll use `musleabi` and `musleabihf` as the target environment names (analogous to `gnueabi` and `gnueabihf`). Most of these changes just extend the special casing for x86_64 MUSL targets to the ARM ones as well.
1 parent bab6a37 commit 5611e68

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/unix/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ s! {
5555
pub ru_nvcsw: c_long,
5656
pub ru_nivcsw: c_long,
5757

58-
#[cfg(target_env = "musl")]
58+
#[cfg(any(target_env = "musl", target_env = "musleabi", target_env = "musleabihf"))]
5959
__reserved: [c_long; 16],
6060
}
6161

@@ -149,8 +149,9 @@ cfg_if! {
149149
} else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
150150
// cargo build, don't pull in anything extra as the libstd dep
151151
// already pulls in all libs.
152-
} else if #[cfg(all(target_env = "musl", not(any(target_arch = "mips",
153-
target_arch = "arm"))))] {
152+
} else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips")),
153+
target_env = "musleabi",
154+
target_env = "musleabihf"))] {
154155
#[link(name = "c", kind = "static")]
155156
extern {}
156157
} else if #[cfg(target_os = "emscripten")] {

src/unix/notbsd/linux/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ s! {
9393
}
9494

9595
pub struct pthread_cond_t {
96-
#[cfg(target_env = "musl")]
96+
#[cfg(any(target_env = "musl", target_env = "musleabi", target_env = "musleabihf"))]
9797
__align: [*const ::c_void; 0],
98-
#[cfg(not(target_env = "musl"))]
98+
#[cfg(not(any(target_env = "musl", target_env = "musleabi", target_env = "musleabihf")))]
9999
__align: [::c_longlong; 0],
100100
size: [u8; __SIZEOF_PTHREAD_COND_T],
101101
}
@@ -615,6 +615,8 @@ extern {
615615

616616
cfg_if! {
617617
if #[cfg(any(target_env = "musl",
618+
target_env = "musleabi",
619+
target_env = "musleabihf",
618620
target_os = "emscripten"))] {
619621
mod musl;
620622
pub use self::musl::*;

src/unix/notbsd/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ s! {
9999

100100
pub struct sched_param {
101101
pub sched_priority: ::c_int,
102-
#[cfg(target_env = "musl")]
102+
#[cfg(any(target_env = "musl", target_env = "musleabi", target_env = "musleabihf"))]
103103
pub sched_ss_low_priority: ::c_int,
104-
#[cfg(target_env = "musl")]
104+
#[cfg(any(target_env = "musl", target_env = "musleabi", target_env = "musleabihf"))]
105105
pub sched_ss_repl_period: ::timespec,
106-
#[cfg(target_env = "musl")]
106+
#[cfg(any(target_env = "musl", target_env = "musleabi", target_env = "musleabihf"))]
107107
pub sched_ss_init_budget: ::timespec,
108-
#[cfg(target_env = "musl")]
108+
#[cfg(any(target_env = "musl", target_env = "musleabi", target_env = "musleabihf"))]
109109
pub sched_ss_max_repl: ::c_int,
110110
}
111111

0 commit comments

Comments
 (0)