Skip to content

Commit 5863d86

Browse files
committed
Merge pull request #163 from japaric/mips-musl
musl: add support for mips/mipsel
2 parents 86cd81d + 751bea3 commit 5863d86

File tree

9 files changed

+1441
-297
lines changed

9 files changed

+1441
-297
lines changed

src/unix/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ cfg_if! {
135135
if #[cfg(not(stdbuild))] {
136136
// cargo build, don't pull in anything extra as the libstd dep
137137
// already pulls in all libs.
138-
} else if #[cfg(target_env = "musl")] {
138+
} else if #[cfg(target_env = "musl", not(target_arch = "mips"))] {
139139
#[link(name = "c", kind = "static")]
140140
extern {}
141141
} else if #[cfg(target_os = "emscripten")] {

src/unix/notbsd/linux/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ s! {
9292
}
9393

9494
pub struct pthread_cond_t {
95+
#[cfg(target_env = "musl")]
96+
__align: [*const ::c_void; 0],
97+
#[cfg(not(target_env = "musl"))]
9598
__align: [::c_longlong; 0],
9699
size: [u8; __SIZEOF_PTHREAD_COND_T],
97100
}

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

+296
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,298 @@
11
pub type c_char = u8;
22
pub type wchar_t = u32;
3+
4+
pub const O_DIRECT: ::c_int = 0x4000;
5+
pub const O_DIRECTORY: ::c_int = 0x10000;
6+
pub const O_NOFOLLOW: ::c_int = 0x20000;
7+
pub const O_ASYNC: ::c_int = 0x2000;
8+
9+
pub const FIOCLEX: ::c_int = 0x5451;
10+
pub const FIONBIO: ::c_int = 0x5421;
11+
12+
pub const RLIMIT_RSS: ::c_int = 5;
13+
pub const RLIMIT_NOFILE: ::c_int = 7;
14+
pub const RLIMIT_AS: ::c_int = 9;
15+
pub const RLIMIT_NPROC: ::c_int = 6;
16+
pub const RLIMIT_MEMLOCK: ::c_int = 8;
17+
18+
pub const O_APPEND: ::c_int = 1024;
19+
pub const O_CREAT: ::c_int = 64;
20+
pub const O_EXCL: ::c_int = 128;
21+
pub const O_NOCTTY: ::c_int = 256;
22+
pub const O_NONBLOCK: ::c_int = 2048;
23+
pub const O_SYNC: ::c_int = 1052672;
24+
pub const O_RSYNC: ::c_int = 1052672;
25+
pub const O_DSYNC: ::c_int = 4096;
26+
27+
pub const SOCK_NONBLOCK: ::c_int = 2048;
28+
29+
pub const MAP_ANON: ::c_int = 0x0020;
30+
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
31+
pub const MAP_DENYWRITE: ::c_int = 0x0800;
32+
pub const MAP_EXECUTABLE: ::c_int = 0x01000;
33+
pub const MAP_LOCKED: ::c_int = 0x02000;
34+
pub const MAP_NORESERVE: ::c_int = 0x04000;
35+
pub const MAP_POPULATE: ::c_int = 0x08000;
36+
pub const MAP_NONBLOCK: ::c_int = 0x010000;
37+
pub const MAP_STACK: ::c_int = 0x020000;
38+
39+
pub const SOCK_STREAM: ::c_int = 1;
40+
pub const SOCK_DGRAM: ::c_int = 2;
41+
42+
pub const SOL_SOCKET: ::c_int = 1;
43+
44+
pub const EDEADLK: ::c_int = 35;
45+
pub const ENAMETOOLONG: ::c_int = 36;
46+
pub const ENOLCK: ::c_int = 37;
47+
pub const ENOSYS: ::c_int = 38;
48+
pub const ENOTEMPTY: ::c_int = 39;
49+
pub const ELOOP: ::c_int = 40;
50+
pub const ENOMSG: ::c_int = 42;
51+
pub const EIDRM: ::c_int = 43;
52+
pub const ECHRNG: ::c_int = 44;
53+
pub const EL2NSYNC: ::c_int = 45;
54+
pub const EL3HLT: ::c_int = 46;
55+
pub const EL3RST: ::c_int = 47;
56+
pub const ELNRNG: ::c_int = 48;
57+
pub const EUNATCH: ::c_int = 49;
58+
pub const ENOCSI: ::c_int = 50;
59+
pub const EL2HLT: ::c_int = 51;
60+
pub const EBADE: ::c_int = 52;
61+
pub const EBADR: ::c_int = 53;
62+
pub const EXFULL: ::c_int = 54;
63+
pub const ENOANO: ::c_int = 55;
64+
pub const EBADRQC: ::c_int = 56;
65+
pub const EBADSLT: ::c_int = 57;
66+
pub const EDEADLOCK: ::c_int = EDEADLK;
67+
pub const EMULTIHOP: ::c_int = 72;
68+
pub const EBADMSG: ::c_int = 74;
69+
pub const EOVERFLOW: ::c_int = 75;
70+
pub const ENOTUNIQ: ::c_int = 76;
71+
pub const EBADFD: ::c_int = 77;
72+
pub const EREMCHG: ::c_int = 78;
73+
pub const ELIBACC: ::c_int = 79;
74+
pub const ELIBBAD: ::c_int = 80;
75+
pub const ELIBSCN: ::c_int = 81;
76+
pub const ELIBMAX: ::c_int = 82;
77+
pub const ELIBEXEC: ::c_int = 83;
78+
pub const EILSEQ: ::c_int = 84;
79+
pub const ERESTART: ::c_int = 85;
80+
pub const ESTRPIPE: ::c_int = 86;
81+
pub const EUSERS: ::c_int = 87;
82+
pub const ENOTSOCK: ::c_int = 88;
83+
pub const EDESTADDRREQ: ::c_int = 89;
84+
pub const EMSGSIZE: ::c_int = 90;
85+
pub const EPROTOTYPE: ::c_int = 91;
86+
pub const ENOPROTOOPT: ::c_int = 92;
87+
pub const EPROTONOSUPPORT: ::c_int = 93;
88+
pub const ESOCKTNOSUPPORT: ::c_int = 94;
89+
pub const EOPNOTSUPP: ::c_int = 95;
90+
pub const EPFNOSUPPORT: ::c_int = 96;
91+
pub const EAFNOSUPPORT: ::c_int = 97;
92+
pub const EADDRINUSE: ::c_int = 98;
93+
pub const EADDRNOTAVAIL: ::c_int = 99;
94+
pub const ENETDOWN: ::c_int = 100;
95+
pub const ENETUNREACH: ::c_int = 101;
96+
pub const ENETRESET: ::c_int = 102;
97+
pub const ECONNABORTED: ::c_int = 103;
98+
pub const ECONNRESET: ::c_int = 104;
99+
pub const ENOBUFS: ::c_int = 105;
100+
pub const EISCONN: ::c_int = 106;
101+
pub const ENOTCONN: ::c_int = 107;
102+
pub const ESHUTDOWN: ::c_int = 108;
103+
pub const ETOOMANYREFS: ::c_int = 109;
104+
pub const ETIMEDOUT: ::c_int = 110;
105+
pub const ECONNREFUSED: ::c_int = 111;
106+
pub const EHOSTDOWN: ::c_int = 112;
107+
pub const EHOSTUNREACH: ::c_int = 113;
108+
pub const EALREADY: ::c_int = 114;
109+
pub const EINPROGRESS: ::c_int = 115;
110+
pub const ESTALE: ::c_int = 116;
111+
pub const EUCLEAN: ::c_int = 117;
112+
pub const ENOTNAM: ::c_int = 118;
113+
pub const ENAVAIL: ::c_int = 119;
114+
pub const EISNAM: ::c_int = 120;
115+
pub const EREMOTEIO: ::c_int = 121;
116+
pub const EDQUOT: ::c_int = 122;
117+
pub const ENOMEDIUM: ::c_int = 123;
118+
pub const EMEDIUMTYPE: ::c_int = 124;
119+
pub const ECANCELED: ::c_int = 125;
120+
pub const ENOKEY: ::c_int = 126;
121+
pub const EKEYEXPIRED: ::c_int = 127;
122+
pub const EKEYREVOKED: ::c_int = 128;
123+
pub const EKEYREJECTED: ::c_int = 129;
124+
pub const EOWNERDEAD: ::c_int = 130;
125+
pub const ENOTRECOVERABLE: ::c_int = 131;
126+
pub const ERFKILL: ::c_int = 132;
127+
pub const EHWPOISON: ::c_int = 133;
128+
129+
pub const SO_REUSEADDR: ::c_int = 2;
130+
pub const SO_TYPE: ::c_int = 3;
131+
pub const SO_ERROR: ::c_int = 4;
132+
pub const SO_DONTROUTE: ::c_int = 5;
133+
pub const SO_BROADCAST: ::c_int = 6;
134+
pub const SO_SNDBUF: ::c_int = 7;
135+
pub const SO_RCVBUF: ::c_int = 8;
136+
pub const SO_KEEPALIVE: ::c_int = 9;
137+
pub const SO_OOBINLINE: ::c_int = 10;
138+
pub const SO_LINGER: ::c_int = 13;
139+
pub const SO_REUSEPORT: ::c_int = 15;
140+
pub const SO_RCVLOWAT: ::c_int = 18;
141+
pub const SO_SNDLOWAT: ::c_int = 19;
142+
pub const SO_RCVTIMEO: ::c_int = 20;
143+
pub const SO_SNDTIMEO: ::c_int = 21;
144+
pub const SO_ACCEPTCONN: ::c_int = 30;
145+
146+
pub const SA_ONSTACK: ::c_int = 0x08000000;
147+
pub const SA_SIGINFO: ::c_int = 0x00000004;
148+
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
149+
150+
pub const SIGCHLD: ::c_int = 17;
151+
pub const SIGBUS: ::c_int = 7;
152+
pub const SIGTTIN: ::c_int = 21;
153+
pub const SIGTTOU: ::c_int = 22;
154+
pub const SIGXCPU: ::c_int = 24;
155+
pub const SIGXFSZ: ::c_int = 25;
156+
pub const SIGVTALRM: ::c_int = 26;
157+
pub const SIGPROF: ::c_int = 27;
158+
pub const SIGWINCH: ::c_int = 28;
159+
pub const SIGUSR1: ::c_int = 10;
160+
pub const SIGUSR2: ::c_int = 12;
161+
pub const SIGCONT: ::c_int = 18;
162+
pub const SIGSTOP: ::c_int = 19;
163+
pub const SIGTSTP: ::c_int = 20;
164+
pub const SIGURG: ::c_int = 23;
165+
pub const SIGIO: ::c_int = 29;
166+
pub const SIGSYS: ::c_int = 31;
167+
pub const SIGSTKFLT: ::c_int = 16;
168+
pub const SIGPOLL: ::c_int = 29;
169+
pub const SIGPWR: ::c_int = 30;
170+
pub const SIG_SETMASK: ::c_int = 2;
171+
pub const SIG_BLOCK: ::c_int = 0x000000;
172+
pub const SIG_UNBLOCK: ::c_int = 0x01;
173+
174+
pub const EXTPROC: ::tcflag_t = 0x00010000;
175+
176+
pub const MAP_HUGETLB: ::c_int = 0x040000;
177+
178+
pub const F_GETLK: ::c_int = 12;
179+
pub const F_GETOWN: ::c_int = 9;
180+
pub const F_SETLK: ::c_int = 13;
181+
pub const F_SETLKW: ::c_int = 14;
182+
pub const F_SETOWN: ::c_int = 8;
183+
184+
pub const VEOF: usize = 4;
185+
pub const VEOL: usize = 11;
186+
pub const VEOL2: usize = 16;
187+
pub const VMIN: usize = 6;
188+
pub const IEXTEN: ::tcflag_t = 0x00008000;
189+
pub const TOSTOP: ::tcflag_t = 0x00000100;
190+
pub const FLUSHO: ::tcflag_t = 0x00001000;
191+
192+
pub const TCGETS: ::c_ulong = 0x5401;
193+
pub const TCSETS: ::c_ulong = 0x5402;
194+
pub const TCSETSW: ::c_ulong = 0x5403;
195+
pub const TCSETSF: ::c_ulong = 0x5404;
196+
pub const TCGETA: ::c_ulong = 0x5405;
197+
pub const TCSETA: ::c_ulong = 0x5406;
198+
pub const TCSETAW: ::c_ulong = 0x5407;
199+
pub const TCSETAF: ::c_ulong = 0x5408;
200+
pub const TCSBRK: ::c_ulong = 0x5409;
201+
pub const TCXONC: ::c_ulong = 0x540A;
202+
pub const TCFLSH: ::c_ulong = 0x540B;
203+
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
204+
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
205+
pub const TIOCLINUX: ::c_ulong = 0x541C;
206+
pub const TIOCGSERIAL: ::c_ulong = 0x541E;
207+
pub const TIOCEXCL: ::c_ulong = 0x540C;
208+
pub const TIOCNXCL: ::c_ulong = 0x540D;
209+
pub const TIOCSCTTY: ::c_ulong = 0x540E;
210+
pub const TIOCGPGRP: ::c_ulong = 0x540F;
211+
pub const TIOCSPGRP: ::c_ulong = 0x5410;
212+
pub const TIOCOUTQ: ::c_ulong = 0x5411;
213+
pub const TIOCSTI: ::c_ulong = 0x5412;
214+
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
215+
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
216+
pub const TIOCMGET: ::c_ulong = 0x5415;
217+
pub const TIOCMBIS: ::c_ulong = 0x5416;
218+
pub const TIOCMBIC: ::c_ulong = 0x5417;
219+
pub const TIOCMSET: ::c_ulong = 0x5418;
220+
pub const FIONREAD: ::c_ulong = 0x541B;
221+
pub const TIOCCONS: ::c_ulong = 0x541D;
222+
223+
s! {
224+
pub struct stat {
225+
pub st_dev: ::dev_t,
226+
__st_dev_padding: ::c_int,
227+
__st_ino_truncated: ::c_long,
228+
pub st_mode: ::mode_t,
229+
pub st_nlink: ::nlink_t,
230+
pub st_uid: ::uid_t,
231+
pub st_gid: ::gid_t,
232+
pub st_rdev: ::dev_t,
233+
__st_rdev_padding: ::c_int,
234+
pub st_size: ::off_t,
235+
pub st_blksize: ::blksize_t,
236+
pub st_blocks: ::blkcnt_t,
237+
pub st_atim: ::timespec,
238+
pub st_mtim: ::timespec,
239+
pub st_ctim: ::timespec,
240+
pub st_ino: ::ino_t,
241+
}
242+
243+
pub struct stat64 {
244+
pub st_dev: ::dev_t,
245+
__st_dev_padding: ::c_int,
246+
__st_ino_truncated: ::c_long,
247+
pub st_mode: ::mode_t,
248+
pub st_nlink: ::nlink_t,
249+
pub st_uid: ::uid_t,
250+
pub st_gid: ::gid_t,
251+
pub st_rdev: ::dev_t,
252+
__st_rdev_padding: ::c_int,
253+
pub st_size: ::off_t,
254+
pub st_blksize: ::blksize_t,
255+
pub st_blocks: ::blkcnt_t,
256+
pub st_atim: ::timespec,
257+
pub st_mtim: ::timespec,
258+
pub st_ctim: ::timespec,
259+
pub st_ino: ::ino_t,
260+
}
261+
262+
pub struct stack_t {
263+
pub ss_sp: *mut ::c_void,
264+
pub ss_flags: ::c_int,
265+
pub ss_size: ::size_t
266+
}
267+
268+
pub struct shmid_ds {
269+
pub shm_perm: ::ipc_perm,
270+
pub shm_segsz: ::size_t,
271+
pub shm_atime: ::time_t,
272+
__unused1: ::c_int,
273+
pub shm_dtime: ::time_t,
274+
__unused2: ::c_int,
275+
pub shm_ctime: ::time_t,
276+
__unused3: ::c_int,
277+
pub shm_cpid: ::pid_t,
278+
pub shm_lpid: ::pid_t,
279+
pub shm_nattch: ::c_ulong,
280+
__pad1: ::c_ulong,
281+
__pad2: ::c_ulong,
282+
}
283+
284+
pub struct statfs {
285+
pub f_type: ::c_ulong,
286+
pub f_bsize: ::c_ulong,
287+
pub f_blocks: ::fsblkcnt_t,
288+
pub f_bfree: ::fsblkcnt_t,
289+
pub f_bavail: ::fsblkcnt_t,
290+
pub f_files: ::fsfilcnt_t,
291+
pub f_ffree: ::fsfilcnt_t,
292+
pub f_fsid: ::fsid_t,
293+
pub f_namelen: ::c_ulong,
294+
pub f_frsize: ::c_ulong,
295+
pub f_flags: ::c_ulong,
296+
pub f_spare: [::c_ulong; 4],
297+
}
298+
}

0 commit comments

Comments
 (0)