Skip to content

Commit 1e6a354

Browse files
committed
Auto merge of #264 - timonvo:armmusleabi, r=alexcrichton
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.
2 parents 779cde8 + ad72859 commit 1e6a354

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

src/unix/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ 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",
59+
target_env = "musleabi",
60+
target_env = "musleabihf"))]
5961
__reserved: [c_long; 16],
6062
}
6163

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

src/unix/notbsd/linux/mod.rs

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

9595
pub struct pthread_cond_t {
96-
#[cfg(target_env = "musl")]
96+
#[cfg(any(target_env = "musl",
97+
target_env = "musleabi",
98+
target_env = "musleabihf"))]
9799
__align: [*const ::c_void; 0],
98-
#[cfg(not(target_env = "musl"))]
100+
#[cfg(not(any(target_env = "musl",
101+
target_env = "musleabi",
102+
target_env = "musleabihf")))]
99103
__align: [::c_longlong; 0],
100104
size: [u8; __SIZEOF_PTHREAD_COND_T],
101105
}
@@ -615,6 +619,8 @@ extern {
615619

616620
cfg_if! {
617621
if #[cfg(any(target_env = "musl",
622+
target_env = "musleabi",
623+
target_env = "musleabihf",
618624
target_os = "emscripten"))] {
619625
mod musl;
620626
pub use self::musl::*;

src/unix/notbsd/mod.rs

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

100100
pub struct sched_param {
101101
pub sched_priority: ::c_int,
102-
#[cfg(target_env = "musl")]
102+
#[cfg(any(target_env = "musl",
103+
target_env = "musleabi",
104+
target_env = "musleabihf"))]
103105
pub sched_ss_low_priority: ::c_int,
104-
#[cfg(target_env = "musl")]
106+
#[cfg(any(target_env = "musl",
107+
target_env = "musleabi",
108+
target_env = "musleabihf"))]
105109
pub sched_ss_repl_period: ::timespec,
106-
#[cfg(target_env = "musl")]
110+
#[cfg(any(target_env = "musl",
111+
target_env = "musleabi",
112+
target_env = "musleabihf"))]
107113
pub sched_ss_init_budget: ::timespec,
108-
#[cfg(target_env = "musl")]
114+
#[cfg(any(target_env = "musl",
115+
target_env = "musleabi",
116+
target_env = "musleabihf"))]
109117
pub sched_ss_max_repl: ::c_int,
110118
}
111119

0 commit comments

Comments
 (0)