Skip to content

Commit dcff154

Browse files
committed
libc: changes to ppc64le musl branch to support building of rust on Alpine
amend to add style changes amend to add style changes
1 parent 8a85d66 commit dcff154

File tree

5 files changed

+353
-148
lines changed

5 files changed

+353
-148
lines changed

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

+74
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,80 @@ pub const MINSIGSTKSZ: ::size_t = 2048;
5252
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
5353
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
5454

55+
pub const RLIMIT_NLIMITS: ::c_int = 16;
56+
pub const TIOCINQ: ::c_int = ::FIONREAD;
57+
pub const MCL_CURRENT: ::c_int = 0x0001;
58+
pub const MCL_FUTURE: ::c_int = 0x0002;
59+
pub const CBAUD: ::tcflag_t = 0o0010017;
60+
pub const TAB1: ::c_int = 0x00000800;
61+
pub const TAB2: ::c_int = 0x00001000;
62+
pub const TAB3: ::c_int = 0x00001800;
63+
pub const CR1: ::c_int = 0x00000200;
64+
pub const CR2: ::c_int = 0x00000400;
65+
pub const CR3: ::c_int = 0x00000600;
66+
pub const FF1: ::c_int = 0x00008000;
67+
pub const BS1: ::c_int = 0x00002000;
68+
pub const VT1: ::c_int = 0x00004000;
69+
pub const VWERASE: usize = 14;
70+
pub const VREPRINT: usize = 12;
71+
pub const VSUSP: usize = 10;
72+
pub const VSTART: usize = 8;
73+
pub const VSTOP: usize = 9;
74+
pub const VDISCARD: usize = 13;
75+
pub const VTIME: usize = 5;
76+
pub const IXON: ::tcflag_t = 0x00000400;
77+
pub const IXOFF: ::tcflag_t = 0x00001000;
78+
pub const ONLCR: ::tcflag_t = 0x4;
79+
pub const CSIZE: ::tcflag_t = 0x00000030;
80+
pub const CS6: ::tcflag_t = 0x00000010;
81+
pub const CS7: ::tcflag_t = 0x00000020;
82+
pub const CS8: ::tcflag_t = 0x00000030;
83+
pub const CSTOPB: ::tcflag_t = 0x00000040;
84+
pub const CREAD: ::tcflag_t = 0x00000080;
85+
pub const PARENB: ::tcflag_t = 0x00000100;
86+
pub const PARODD: ::tcflag_t = 0x00000200;
87+
pub const HUPCL: ::tcflag_t = 0x00000400;
88+
pub const CLOCAL: ::tcflag_t = 0x00000800;
89+
pub const ECHOKE: ::tcflag_t = 0x00000800;
90+
pub const ECHOE: ::tcflag_t = 0x00000010;
91+
pub const ECHOK: ::tcflag_t = 0x00000020;
92+
pub const ECHONL: ::tcflag_t = 0x00000040;
93+
pub const ECHOPRT: ::tcflag_t = 0x00000400;
94+
pub const ECHOCTL: ::tcflag_t = 0x00000200;
95+
pub const ISIG: ::tcflag_t = 0x00000001;
96+
pub const ICANON: ::tcflag_t = 0x00000002;
97+
pub const PENDIN: ::tcflag_t = 0x00004000;
98+
pub const NOFLSH: ::tcflag_t = 0x00000080;
99+
pub const CIBAUD: ::tcflag_t = 0o02003600000;
100+
pub const CBAUDEX: ::tcflag_t = 0o010000;
101+
pub const VSWTC: usize = 7;
102+
pub const OLCUC: ::tcflag_t = 0o000002;
103+
pub const NLDLY: ::tcflag_t = 0o000400;
104+
pub const CRDLY: ::tcflag_t = 0o003000;
105+
pub const TABDLY: ::tcflag_t = 0o014000;
106+
pub const BSDLY: ::tcflag_t = 0o020000;
107+
pub const FFDLY: ::tcflag_t = 0o100000;
108+
pub const VTDLY: ::tcflag_t = 0o040000;
109+
pub const XTABS: ::tcflag_t = 0o014000;
110+
pub const B57600: ::speed_t = 0o010001;
111+
pub const B115200: ::speed_t = 0o010002;
112+
pub const B230400: ::speed_t = 0o010003;
113+
pub const B460800: ::speed_t = 0o010004;
114+
pub const B500000: ::speed_t = 0o010005;
115+
pub const B576000: ::speed_t = 0o010006;
116+
pub const B921600: ::speed_t = 0o010007;
117+
pub const B1000000: ::speed_t = 0o010010;
118+
pub const B1152000: ::speed_t = 0o010011;
119+
pub const B1500000: ::speed_t = 0o010012;
120+
pub const B2000000: ::speed_t = 0o010013;
121+
pub const B2500000: ::speed_t = 0o010014;
122+
pub const B3000000: ::speed_t = 0o010015;
123+
pub const B3500000: ::speed_t = 0o010016;
124+
pub const B4000000: ::speed_t = 0o010017;
125+
extern {
126+
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
127+
}
128+
55129
cfg_if! {
56130
if #[cfg(any(target_arch = "x86"))] {
57131
mod x86;

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

-62
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
136136

137137
pub const O_ASYNC: ::c_int = 0x2000;
138138

139-
pub const FIOCLEX: ::c_int = 0x5451;
140-
pub const FIONBIO: ::c_int = 0x5421;
141-
142139
pub const RLIMIT_RSS: ::c_int = 5;
143140
pub const RLIMIT_NOFILE: ::c_int = 7;
144141
pub const RLIMIT_AS: ::c_int = 9;
@@ -172,7 +169,6 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
172169

173170
pub const SOL_SOCKET: ::c_int = 1;
174171

175-
pub const EDEADLK: ::c_int = 35;
176172
pub const ENAMETOOLONG: ::c_int = 36;
177173
pub const ENOLCK: ::c_int = 37;
178174
pub const ENOSYS: ::c_int = 38;
@@ -194,7 +190,6 @@ pub const EXFULL: ::c_int = 54;
194190
pub const ENOANO: ::c_int = 55;
195191
pub const EBADRQC: ::c_int = 56;
196192
pub const EBADSLT: ::c_int = 57;
197-
pub const EDEADLOCK: ::c_int = EDEADLK;
198193
pub const EMULTIHOP: ::c_int = 72;
199194
pub const EBADMSG: ::c_int = 74;
200195
pub const EOVERFLOW: ::c_int = 75;
@@ -272,12 +267,6 @@ pub const SO_PRIORITY: ::c_int = 12;
272267
pub const SO_LINGER: ::c_int = 13;
273268
pub const SO_BSDCOMPAT: ::c_int = 14;
274269
pub const SO_REUSEPORT: ::c_int = 15;
275-
pub const SO_PASSCRED: ::c_int = 16;
276-
pub const SO_PEERCRED: ::c_int = 17;
277-
pub const SO_RCVLOWAT: ::c_int = 18;
278-
pub const SO_SNDLOWAT: ::c_int = 19;
279-
pub const SO_RCVTIMEO: ::c_int = 20;
280-
pub const SO_SNDTIMEO: ::c_int = 21;
281270
pub const SO_ACCEPTCONN: ::c_int = 30;
282271
pub const SO_SNDBUFFORCE: ::c_int = 32;
283272
pub const SO_RCVBUFFORCE: ::c_int = 33;
@@ -312,8 +301,6 @@ pub const SIG_SETMASK: ::c_int = 2;
312301
pub const SIG_BLOCK: ::c_int = 0x000000;
313302
pub const SIG_UNBLOCK: ::c_int = 0x01;
314303

315-
pub const EXTPROC: ::tcflag_t = 0x00010000;
316-
317304
pub const MAP_HUGETLB: ::c_int = 0x040000;
318305

319306
pub const F_GETLK: ::c_int = 5;
@@ -323,59 +310,10 @@ pub const F_SETLKW: ::c_int = 7;
323310
pub const F_SETOWN: ::c_int = 8;
324311

325312
pub const VEOF: usize = 4;
326-
pub const VEOL: usize = 11;
327-
pub const VEOL2: usize = 16;
328-
pub const VMIN: usize = 6;
329-
pub const IEXTEN: ::tcflag_t = 0x00008000;
330-
pub const TOSTOP: ::tcflag_t = 0x00000100;
331-
pub const FLUSHO: ::tcflag_t = 0x00001000;
332-
333-
pub const TCGETS: ::c_int = 0x5401;
334-
pub const TCSETS: ::c_int = 0x5402;
335-
pub const TCSETSW: ::c_int = 0x5403;
336-
pub const TCSETSF: ::c_int = 0x5404;
337-
pub const TCGETA: ::c_int = 0x5405;
338-
pub const TCSETA: ::c_int = 0x5406;
339-
pub const TCSETAW: ::c_int = 0x5407;
340-
pub const TCSETAF: ::c_int = 0x5408;
341-
pub const TCSBRK: ::c_int = 0x5409;
342-
pub const TCXONC: ::c_int = 0x540A;
343-
pub const TCFLSH: ::c_int = 0x540B;
344-
pub const TIOCGSOFTCAR: ::c_int = 0x5419;
345-
pub const TIOCSSOFTCAR: ::c_int = 0x541A;
346-
pub const TIOCLINUX: ::c_int = 0x541C;
347-
pub const TIOCGSERIAL: ::c_int = 0x541E;
348-
pub const TIOCEXCL: ::c_int = 0x540C;
349-
pub const TIOCNXCL: ::c_int = 0x540D;
350-
pub const TIOCSCTTY: ::c_int = 0x540E;
351-
pub const TIOCGPGRP: ::c_int = 0x540F;
352-
pub const TIOCSPGRP: ::c_int = 0x5410;
353-
pub const TIOCOUTQ: ::c_int = 0x5411;
354-
pub const TIOCSTI: ::c_int = 0x5412;
355-
pub const TIOCGWINSZ: ::c_int = 0x5413;
356-
pub const TIOCSWINSZ: ::c_int = 0x5414;
357-
pub const TIOCMGET: ::c_int = 0x5415;
358-
pub const TIOCMBIS: ::c_int = 0x5416;
359-
pub const TIOCMBIC: ::c_int = 0x5417;
360-
pub const TIOCMSET: ::c_int = 0x5418;
361-
pub const FIONREAD: ::c_int = 0x541B;
362-
pub const TIOCCONS: ::c_int = 0x541D;
363313

364314
pub const POLLWRNORM: ::c_short = 0x100;
365315
pub const POLLWRBAND: ::c_short = 0x200;
366316

367-
pub const TIOCM_LE: ::c_int = 0x001;
368-
pub const TIOCM_DTR: ::c_int = 0x002;
369-
pub const TIOCM_RTS: ::c_int = 0x004;
370-
pub const TIOCM_ST: ::c_int = 0x008;
371-
pub const TIOCM_SR: ::c_int = 0x010;
372-
pub const TIOCM_CTS: ::c_int = 0x020;
373-
pub const TIOCM_CAR: ::c_int = 0x040;
374-
pub const TIOCM_RNG: ::c_int = 0x080;
375-
pub const TIOCM_DSR: ::c_int = 0x100;
376-
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
377-
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
378-
379317
cfg_if! {
380318
if #[cfg(target_arch = "aarch64")] {
381319
mod aarch64;

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

+143-12
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,17 @@ s! {
6060
}
6161
}
6262

63-
pub const SYS_pivot_root: ::c_long = 203;
64-
pub const SYS_gettid: ::c_long = 207;
65-
pub const SYS_perf_event_open: ::c_long = 319;
66-
pub const SYS_memfd_create: ::c_long = 360;
67-
6863
pub const MAP_32BIT: ::c_int = 0x0040;
69-
pub const O_DIRECT: ::c_int = 0x4000;
70-
pub const O_DIRECTORY: ::c_int = 0x10000;
71-
pub const O_LARGEFILE: ::c_int = 0;
72-
pub const O_NOFOLLOW: ::c_int = 0x20000;
64+
pub const O_DIRECT: ::c_int = 0x20000;
65+
pub const O_DIRECTORY: ::c_int = 0x4000;
66+
pub const O_LARGEFILE: ::c_int = 0x10000;
67+
pub const O_NOFOLLOW: ::c_int = 0x8000;
7368

74-
pub const SIGSTKSZ: ::size_t = 8192;
75-
pub const MINSIGSTKSZ: ::size_t = 2048;
69+
pub const SIGSTKSZ: ::size_t = 10240;
70+
pub const MINSIGSTKSZ: ::size_t = 4096;
7671

7772
#[doc(hidden)]
78-
pub const AF_MAX: ::c_int = 42;
73+
pub const AF_MAX: ::c_int = 43;
7974
#[doc(hidden)]
8075
pub const PF_MAX: ::c_int = AF_MAX;
8176

@@ -439,3 +434,139 @@ pub const SYS_copy_file_range: ::c_long = 379;
439434
pub const SYS_preadv2: ::c_long = 380;
440435
pub const SYS_pwritev2: ::c_long = 381;
441436
pub const SYS_kexec_file_load: ::c_long = 382;
437+
438+
pub const FIOCLEX: ::c_ulong = 0x20006601;
439+
pub const FIONBIO: ::c_ulong = 0x8004667e;
440+
pub const EDEADLK: ::c_int = 58;
441+
pub const EDEADLOCK: ::c_int = EDEADLK;
442+
pub const SO_PASSCRED: ::c_int = 20;
443+
pub const SO_PEERCRED: ::c_int = 21;
444+
pub const SO_RCVLOWAT: ::c_int = 16;
445+
pub const SO_SNDLOWAT: ::c_int = 17;
446+
pub const SO_RCVTIMEO: ::c_int = 18;
447+
pub const SO_SNDTIMEO: ::c_int = 19;
448+
pub const EXTPROC: ::tcflag_t = 0x10000000;
449+
pub const VEOL: usize = 6;
450+
pub const VEOL2: usize = 8;
451+
pub const VMIN: usize = 5;
452+
pub const IEXTEN: ::tcflag_t = 0x00000400;
453+
pub const TOSTOP: ::tcflag_t = 0x00400000;
454+
pub const FLUSHO: ::tcflag_t = 0x00800000;
455+
pub const TCGETS: ::c_ulong = 0x403c7413;
456+
pub const TCSETS: ::c_ulong = 0x803c7414;
457+
pub const TCSETSW: ::c_ulong = 0x803c7415;
458+
pub const TCSETSF: ::c_ulong = 0x803c7416;
459+
pub const TCGETA: ::c_ulong = 0x40147417;
460+
pub const TCSETA: ::c_ulong = 0x80147418;
461+
pub const TCSETAW: ::c_ulong = 0x80147419;
462+
pub const TCSETAF: ::c_ulong = 0x8014741c;
463+
pub const TCSBRK: ::c_ulong = 0x2000741d;
464+
pub const TCXONC: ::c_ulong = 0x2000741e;
465+
pub const TCFLSH: ::c_ulong = 0x2000741f;
466+
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
467+
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
468+
pub const TIOCLINUX: ::c_ulong = 0x541C;
469+
pub const TIOCGSERIAL: ::c_ulong = 0x541E;
470+
pub const TIOCEXCL: ::c_ulong = 0x540C;
471+
pub const TIOCNXCL: ::c_ulong = 0x540D;
472+
pub const TIOCSCTTY: ::c_ulong = 0x540E;
473+
pub const TIOCGPGRP: ::c_ulong = 0x40047477;
474+
pub const TIOCSPGRP: ::c_ulong = 0x80047476;
475+
pub const TIOCOUTQ: ::c_ulong = 0x40047473;
476+
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
477+
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
478+
pub const TIOCMGET: ::c_ulong = 0x5415;
479+
pub const TIOCMBIS: ::c_ulong = 0x5416;
480+
pub const TIOCMBIC: ::c_ulong = 0x5417;
481+
pub const TIOCMSET: ::c_ulong = 0x5418;
482+
pub const FIONREAD: ::c_ulong = 0x4004667f;
483+
pub const TIOCCONS: ::c_ulong = 0x541D;
484+
pub const TIOCM_LE: ::c_ulong = 0x001;
485+
pub const TIOCM_DTR: ::c_ulong = 0x002;
486+
pub const TIOCM_RTS: ::c_ulong = 0x004;
487+
pub const TIOCM_ST: ::c_ulong = 0x008;
488+
pub const TIOCM_SR: ::c_ulong = 0x010;
489+
pub const TIOCM_CTS: ::c_ulong = 0x020;
490+
pub const TIOCM_CAR: ::c_ulong = 0x040;
491+
pub const TIOCM_RNG: ::c_ulong = 0x080;
492+
pub const TIOCM_DSR: ::c_ulong = 0x100;
493+
pub const TIOCM_CD: ::c_ulong = TIOCM_CAR;
494+
pub const TIOCM_RI: ::c_ulong = TIOCM_RNG;
495+
496+
pub const RLIMIT_NLIMITS: ::c_int = 15;
497+
pub const TIOCINQ: ::c_ulong = ::FIONREAD;
498+
pub const MCL_CURRENT: ::c_int = 0x2000;
499+
pub const MCL_FUTURE: ::c_int = 0x4000;
500+
pub const CBAUD: ::tcflag_t = 0xff;
501+
pub const TAB1: ::c_int = 0x400;
502+
pub const TAB2: ::c_int = 0x800;
503+
pub const TAB3: ::c_int = 0xc00;
504+
pub const CR1: ::c_int = 0x1000;
505+
pub const CR2: ::c_int = 0x2000;
506+
pub const CR3: ::c_int = 0x3000;
507+
pub const FF1: ::c_int = 0x4000;
508+
pub const BS1: ::c_int = 0x8000;
509+
pub const VT1: ::c_int = 0x10000;
510+
pub const VWERASE: usize = 10;
511+
pub const VREPRINT: usize = 11;
512+
pub const VSUSP: usize = 12;
513+
pub const VSTART: usize = 13;
514+
pub const VSTOP: usize = 14;
515+
pub const VDISCARD: usize = 16;
516+
pub const VTIME: usize = 7;
517+
pub const IXON: ::tcflag_t = 0x00000200;
518+
pub const IXOFF: ::tcflag_t = 0x00000400;
519+
pub const ONLCR: ::tcflag_t = 0x2;
520+
pub const CSIZE: ::tcflag_t = 0x00000300;
521+
522+
pub const CS6: ::tcflag_t = 0x00000100;
523+
pub const CS7: ::tcflag_t = 0x00000200;
524+
pub const CS8: ::tcflag_t = 0x00000300;
525+
pub const CSTOPB: ::tcflag_t = 0x00000400;
526+
pub const CREAD: ::tcflag_t = 0x00000800;
527+
pub const PARENB: ::tcflag_t = 0x00001000;
528+
pub const PARODD: ::tcflag_t = 0x00002000;
529+
pub const HUPCL: ::tcflag_t = 0x00004000;
530+
pub const CLOCAL: ::tcflag_t = 0x00008000;
531+
pub const ECHOKE: ::tcflag_t = 0x00000001;
532+
pub const ECHOE: ::tcflag_t = 0x00000002;
533+
pub const ECHOK: ::tcflag_t = 0x00000004;
534+
pub const ECHONL: ::tcflag_t = 0x00000010;
535+
pub const ECHOPRT: ::tcflag_t = 0x00000020;
536+
pub const ECHOCTL: ::tcflag_t = 0x00000040;
537+
pub const ISIG: ::tcflag_t = 0x00000080;
538+
pub const ICANON: ::tcflag_t = 0x00000100;
539+
pub const PENDIN: ::tcflag_t = 0x20000000;
540+
pub const NOFLSH: ::tcflag_t = 0x80000000;
541+
542+
pub const CIBAUD: ::tcflag_t = 0o77600000;
543+
pub const CBAUDEX: ::tcflag_t = 0o0000020;
544+
pub const VSWTC: usize = 9;
545+
pub const OLCUC: ::tcflag_t = 0o000004;
546+
pub const NLDLY: ::tcflag_t = 0o0001400;
547+
pub const CRDLY: ::tcflag_t = 0o0030000;
548+
pub const TABDLY: ::tcflag_t = 0o0006000;
549+
pub const BSDLY: ::tcflag_t = 0o0100000;
550+
pub const FFDLY: ::tcflag_t = 0o0040000;
551+
pub const VTDLY: ::tcflag_t = 0o0200000;
552+
pub const XTABS: ::tcflag_t = 0o00006000;
553+
554+
pub const B57600: ::speed_t = 0o00020;
555+
pub const B115200: ::speed_t = 0o00021;
556+
pub const B230400: ::speed_t = 0o00022;
557+
pub const B460800: ::speed_t = 0o00023;
558+
pub const B500000: ::speed_t = 0o00024;
559+
pub const B576000: ::speed_t = 0o00025;
560+
pub const B921600: ::speed_t = 0o00026;
561+
pub const B1000000: ::speed_t = 0o00027;
562+
pub const B1152000: ::speed_t = 0o00030;
563+
pub const B1500000: ::speed_t = 0o00031;
564+
pub const B2000000: ::speed_t = 0o00032;
565+
pub const B2500000: ::speed_t = 0o00033;
566+
pub const B3000000: ::speed_t = 0o00034;
567+
pub const B3500000: ::speed_t = 0o00035;
568+
pub const B4000000: ::speed_t = 0o00036;
569+
570+
extern {
571+
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
572+
}

0 commit comments

Comments
 (0)