Skip to content

Commit 9f8ec72

Browse files
authored
Auto merge of rust-lang#369 - alexcrichton:musl-mips, r=alexcrichton
Add CI for mipsel-unknown-linux-musl Download a trunk OpenWRT toolchain and verify bindings against that. Also fixup a few stray errors today
2 parents a94097d + ed32e3f commit 9f8ec72

File tree

9 files changed

+87
-13
lines changed

9 files changed

+87
-13
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ matrix:
7979
- os: linux
8080
env: TARGET=powerpc64-unknown-linux-gnu
8181
rust: stable
82+
- os: linux
83+
env: TARGET=mipsel-unknown-linux-musl
84+
rust: stable
8285

8386
# beta
8487
- os: linux
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update
4+
RUN apt-get install -y --no-install-recommends \
5+
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
6+
bzip2
7+
8+
RUN mkdir /toolchain
9+
RUN curl -L https://downloads.openwrt.org/snapshots/trunk/malta/generic/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
10+
tar xjf - -C /toolchain --strip-components=2
11+
12+
ENV PATH=$PATH:/rust/bin:/toolchain/bin \
13+
CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
14+
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_LINKER=mipsel-openwrt-linux-gcc

ci/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ case "$TARGET" in
117117
qemu-mips -L /usr/mips-linux-gnu $CARGO_TARGET_DIR/$TARGET/debug/libc-test
118118
;;
119119

120+
mipsel-unknown-linux-musl)
121+
qemu-mipsel -L /toolchain $CARGO_TARGET_DIR/$TARGET/debug/libc-test
122+
;;
123+
120124
powerpc-unknown-linux-gnu)
121125
qemu-ppc -L /usr/powerpc-linux-gnu $CARGO_TARGET_DIR/$TARGET/debug/libc-test
122126
;;

src/unix/notbsd/linux/musl/b32/arm.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ s! {
8282
pub f_flags: ::c_ulong,
8383
pub f_spare: [::c_ulong; 4],
8484
}
85+
86+
pub struct siginfo_t {
87+
pub si_signo: ::c_int,
88+
pub si_errno: ::c_int,
89+
pub si_code: ::c_int,
90+
pub _pad: [::c_int; 29],
91+
_align: [usize; 0],
92+
}
8593
}
8694

8795
pub const O_DIRECT: ::c_int = 0x4000;
@@ -306,3 +314,8 @@ pub const TIOCCONS: ::c_int = 0x541D;
306314

307315
pub const SYS_gettid: ::c_long = 224;
308316
pub const SYS_perf_event_open: ::c_long = 364;
317+
318+
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
319+
pub const RUSAGE_CHILDREN: ::c_int = 1;
320+
pub const POLLWRNORM: ::c_short = 0x100;
321+
pub const POLLWRBAND: ::c_short = 0x200;

src/unix/notbsd/linux/musl/b32/asmjs.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ s! {
8282
pub f_flags: ::c_ulong,
8383
pub f_spare: [::c_ulong; 4],
8484
}
85+
86+
pub struct siginfo_t {
87+
pub si_signo: ::c_int,
88+
pub si_errno: ::c_int,
89+
pub si_code: ::c_int,
90+
pub _pad: [::c_int; 29],
91+
_align: [usize; 0],
92+
}
8593
}
8694

8795
pub const O_DIRECT: ::c_int = 0x4000;
@@ -305,3 +313,8 @@ pub const FIONREAD: ::c_int = 0x541B;
305313
pub const TIOCCONS: ::c_int = 0x541D;
306314

307315
pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
316+
317+
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
318+
pub const RUSAGE_CHILDREN: ::c_int = 1;
319+
pub const POLLWRNORM: ::c_short = 0x100;
320+
pub const POLLWRBAND: ::c_short = 0x200;

src/unix/notbsd/linux/musl/b32/mips.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ s! {
8181
pub f_flags: ::c_ulong,
8282
pub f_spare: [::c_ulong; 5],
8383
}
84+
85+
pub struct siginfo_t {
86+
pub si_signo: ::c_int,
87+
pub si_code: ::c_int,
88+
pub si_errno: ::c_int,
89+
pub _pad: [::c_int; 29],
90+
_align: [usize; 0],
91+
}
8492
}
8593

8694
pub const O_DIRECT: ::c_int = 0o100000;
@@ -299,9 +307,14 @@ pub const TIOCSWINSZ: ::c_int = 0x80087467;
299307
pub const TIOCMGET: ::c_int = 0x741D;
300308
pub const TIOCMBIS: ::c_int = 0x741B;
301309
pub const TIOCMBIC: ::c_int = 0x741C;
302-
pub const TIOCMSET: ::c_int = 0x741D;
310+
pub const TIOCMSET: ::c_int = 0x741A;
303311
pub const FIONREAD: ::c_int = 0x467F;
304312
pub const TIOCCONS: ::c_int = 0x80047478;
305313

306314
pub const SYS_gettid: ::c_long = 4222; // Valid for O32
307315
pub const SYS_perf_event_open: ::c_long = 4333; // Valid for O32
316+
317+
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
318+
pub const RUSAGE_CHILDREN: ::c_int = !0;
319+
pub const POLLWRNORM: ::c_short = 0x4;
320+
pub const POLLWRBAND: ::c_short = 0x100;

src/unix/notbsd/linux/musl/b32/x86.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ s! {
9595
pub uc_sigmask: ::sigset_t,
9696
__private: [u8; 112],
9797
}
98+
99+
pub struct siginfo_t {
100+
pub si_signo: ::c_int,
101+
pub si_errno: ::c_int,
102+
pub si_code: ::c_int,
103+
pub _pad: [::c_int; 29],
104+
_align: [usize; 0],
105+
}
98106
}
99107

100108
pub const O_DIRECT: ::c_int = 0x4000;
@@ -320,3 +328,8 @@ pub const TIOCCONS: ::c_int = 0x541D;
320328

321329
pub const SYS_gettid: ::c_long = 224;
322330
pub const SYS_perf_event_open: ::c_long = 336;
331+
332+
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
333+
pub const RUSAGE_CHILDREN: ::c_int = 1;
334+
pub const POLLWRNORM: ::c_short = 0x100;
335+
pub const POLLWRBAND: ::c_short = 0x200;

src/unix/notbsd/linux/musl/b64/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ s! {
103103
pub struct sem_t {
104104
__val: [::c_int; 8],
105105
}
106+
107+
pub struct siginfo_t {
108+
pub si_signo: ::c_int,
109+
pub si_errno: ::c_int,
110+
pub si_code: ::c_int,
111+
pub _pad: [::c_int; 29],
112+
_align: [usize; 0],
113+
}
106114
}
107115

108116
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
@@ -329,6 +337,11 @@ pub const TIOCMSET: ::c_int = 0x5418;
329337
pub const FIONREAD: ::c_int = 0x541B;
330338
pub const TIOCCONS: ::c_int = 0x541D;
331339

340+
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
341+
pub const RUSAGE_CHILDREN: ::c_int = 1;
342+
pub const POLLWRNORM: ::c_short = 0x100;
343+
pub const POLLWRBAND: ::c_short = 0x200;
344+
332345
cfg_if! {
333346
if #[cfg(target_arch = "aarch64")] {
334347
mod aarch64;

src/unix/notbsd/linux/musl/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ s! {
1818
_restorer: *mut ::c_void,
1919
}
2020

21-
pub struct siginfo_t {
22-
pub si_signo: ::c_int,
23-
pub si_errno: ::c_int,
24-
pub si_code: ::c_int,
25-
pub _pad: [::c_int; 29],
26-
_align: [usize; 0],
27-
}
28-
2921
pub struct ipc_perm {
3022
pub __ipc_perm_key: ::key_t,
3123
pub uid: ::uid_t,
@@ -78,10 +70,8 @@ s! {
7870
pub const BUFSIZ: ::c_uint = 1024;
7971
pub const TMP_MAX: ::c_uint = 10000;
8072
pub const FOPEN_MAX: ::c_uint = 1000;
81-
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
8273
pub const O_ACCMODE: ::c_int = 0o10000003;
8374
pub const O_NDELAY: ::c_int = O_NONBLOCK;
84-
pub const RUSAGE_CHILDREN: ::c_int = 1;
8575
pub const NI_MAXHOST: ::socklen_t = 255;
8676
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
8777

@@ -154,9 +144,7 @@ pub const MADV_DONTDUMP: ::c_int = 16;
154144
pub const EPOLLWAKEUP: ::c_int = 0x20000000;
155145

156146
pub const POLLRDNORM: ::c_short = 0x040;
157-
pub const POLLWRNORM: ::c_short = 0x100;
158147
pub const POLLRDBAND: ::c_short = 0x080;
159-
pub const POLLWRBAND: ::c_short = 0x200;
160148

161149
pub const MADV_HUGEPAGE: ::c_int = 14;
162150
pub const MADV_NOHUGEPAGE: ::c_int = 15;

0 commit comments

Comments
 (0)