Skip to content

Commit a6b1c2d

Browse files
committed
Fix and add testing for powerpc64
1 parent 64595ef commit a6b1c2d

File tree

7 files changed

+310
-98
lines changed

7 files changed

+310
-98
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ matrix:
7676
- os: linux
7777
env: TARGET=powerpc-unknown-linux-gnu
7878
rust: stable
79+
- os: linux
80+
env: TARGET=powerpc64-unknown-linux-gnu
81+
rust: stable
7982

8083
# beta
8184
- os: linux
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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 \
6+
gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \
7+
qemu-system-ppc
8+
9+
ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \
10+
PATH=$PATH:/rust/bin

ci/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ case "$TARGET" in
121121
qemu-ppc -L /usr/powerpc-linux-gnu $CARGO_TARGET_DIR/$TARGET/debug/libc-test
122122
;;
123123

124+
powerpc64-unknown-linux-gnu)
125+
qemu-ppc64 -L /usr/powerpc64-linux-gnu $CARGO_TARGET_DIR/$TARGET/debug/libc-test
126+
;;
127+
124128
aarch64-unknown-linux-gnu)
125129
qemu-aarch64 -L /usr/aarch64-linux-gnu/ $CARGO_TARGET_DIR/$TARGET/debug/libc-test
126130
;;

src/unix/notbsd/linux/other/b64/aarch64.rs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,33 @@ s! {
5353
pub struct pthread_attr_t {
5454
__size: [u64; 8]
5555
}
56+
57+
pub struct ipc_perm {
58+
pub __key: ::key_t,
59+
pub uid: ::uid_t,
60+
pub gid: ::gid_t,
61+
pub cuid: ::uid_t,
62+
pub cgid: ::gid_t,
63+
pub mode: ::c_ushort,
64+
__pad1: ::c_ushort,
65+
pub __seq: ::c_ushort,
66+
__pad2: ::c_ushort,
67+
__unused1: ::c_ulong,
68+
__unused2: ::c_ulong
69+
}
70+
71+
pub struct shmid_ds {
72+
pub shm_perm: ::ipc_perm,
73+
pub shm_segsz: ::size_t,
74+
pub shm_atime: ::time_t,
75+
pub shm_dtime: ::time_t,
76+
pub shm_ctime: ::time_t,
77+
pub shm_cpid: ::pid_t,
78+
pub shm_lpid: ::pid_t,
79+
pub shm_nattch: ::shmatt_t,
80+
__unused4: ::c_ulong,
81+
__unused5: ::c_ulong
82+
}
5683
}
5784

5885
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8;
@@ -79,3 +106,74 @@ pub const FIONBIO: ::c_ulong = 0x5421;
79106

80107
pub const SYS_gettid: ::c_long = 178;
81108
pub const SYS_perf_event_open: ::c_long = 241;
109+
110+
pub const MCL_CURRENT: ::c_int = 0x0001;
111+
pub const MCL_FUTURE: ::c_int = 0x0002;
112+
113+
pub const SIGSTKSZ: ::size_t = 8192;
114+
pub const CBAUD: ::tcflag_t = 0o0010017;
115+
pub const TAB1: ::c_int = 0x00000800;
116+
pub const TAB2: ::c_int = 0x00001000;
117+
pub const TAB3: ::c_int = 0x00001800;
118+
pub const CR1: ::c_int = 0x00000200;
119+
pub const CR2: ::c_int = 0x00000400;
120+
pub const CR3: ::c_int = 0x00000600;
121+
pub const FF1: ::c_int = 0x00008000;
122+
pub const BS1: ::c_int = 0x00002000;
123+
pub const VT1: ::c_int = 0x00004000;
124+
pub const VWERASE: usize = 14;
125+
pub const VREPRINT: usize = 12;
126+
pub const VSUSP: usize = 10;
127+
pub const VSTART: usize = 8;
128+
pub const VSTOP: usize = 9;
129+
pub const VDISCARD: usize = 13;
130+
pub const VTIME: usize = 5;
131+
pub const IXON: ::tcflag_t = 0x00000400;
132+
pub const IXOFF: ::tcflag_t = 0x00001000;
133+
pub const ONLCR: ::tcflag_t = 0x4;
134+
pub const CSIZE: ::tcflag_t = 0x00000030;
135+
pub const CS6: ::tcflag_t = 0x00000010;
136+
pub const CS7: ::tcflag_t = 0x00000020;
137+
pub const CS8: ::tcflag_t = 0x00000030;
138+
pub const CSTOPB: ::tcflag_t = 0x00000040;
139+
pub const CREAD: ::tcflag_t = 0x00000080;
140+
pub const PARENB: ::tcflag_t = 0x00000100;
141+
pub const PARODD: ::tcflag_t = 0x00000200;
142+
pub const HUPCL: ::tcflag_t = 0x00000400;
143+
pub const CLOCAL: ::tcflag_t = 0x00000800;
144+
pub const ECHOKE: ::tcflag_t = 0x00000800;
145+
pub const ECHOE: ::tcflag_t = 0x00000010;
146+
pub const ECHOK: ::tcflag_t = 0x00000020;
147+
pub const ECHONL: ::tcflag_t = 0x00000040;
148+
pub const ECHOPRT: ::tcflag_t = 0x00000400;
149+
pub const ECHOCTL: ::tcflag_t = 0x00000200;
150+
pub const ISIG: ::tcflag_t = 0x00000001;
151+
pub const ICANON: ::tcflag_t = 0x00000002;
152+
pub const PENDIN: ::tcflag_t = 0x00004000;
153+
pub const NOFLSH: ::tcflag_t = 0x00000080;
154+
155+
pub const VEOL: usize = 11;
156+
pub const VEOL2: usize = 16;
157+
pub const VMIN: usize = 6;
158+
pub const IEXTEN: ::tcflag_t = 0x00008000;
159+
pub const TOSTOP: ::tcflag_t = 0x00000100;
160+
pub const FLUSHO: ::tcflag_t = 0x00001000;
161+
pub const EXTPROC: ::tcflag_t = 0x00010000;
162+
pub const TCGETS: ::c_ulong = 0x5401;
163+
pub const TCSETS: ::c_ulong = 0x5402;
164+
pub const TCSETSW: ::c_ulong = 0x5403;
165+
pub const TCSETSF: ::c_ulong = 0x5404;
166+
pub const TCGETA: ::c_ulong = 0x5405;
167+
pub const TCSETA: ::c_ulong = 0x5406;
168+
pub const TCSETAW: ::c_ulong = 0x5407;
169+
pub const TCSETAF: ::c_ulong = 0x5408;
170+
pub const TCSBRK: ::c_ulong = 0x5409;
171+
pub const TCXONC: ::c_ulong = 0x540A;
172+
pub const TCFLSH: ::c_ulong = 0x540B;
173+
pub const TIOCINQ: ::c_ulong = 0x541B;
174+
pub const TIOCGPGRP: ::c_ulong = 0x540F;
175+
pub const TIOCSPGRP: ::c_ulong = 0x5410;
176+
pub const TIOCOUTQ: ::c_ulong = 0x5411;
177+
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
178+
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
179+
pub const FIONREAD: ::c_ulong = 0x541B;

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

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -31,108 +31,10 @@ s! {
3131
pub mem_unit: ::c_uint,
3232
pub _f: [::c_char; 0],
3333
}
34-
35-
pub struct ipc_perm {
36-
pub __key: ::key_t,
37-
pub uid: ::uid_t,
38-
pub gid: ::gid_t,
39-
pub cuid: ::uid_t,
40-
pub cgid: ::gid_t,
41-
pub mode: ::c_ushort,
42-
__pad1: ::c_ushort,
43-
pub __seq: ::c_ushort,
44-
__pad2: ::c_ushort,
45-
__unused1: ::c_ulong,
46-
__unused2: ::c_ulong
47-
}
48-
49-
pub struct shmid_ds {
50-
pub shm_perm: ::ipc_perm,
51-
pub shm_segsz: ::size_t,
52-
pub shm_atime: ::time_t,
53-
pub shm_dtime: ::time_t,
54-
pub shm_ctime: ::time_t,
55-
pub shm_cpid: ::pid_t,
56-
pub shm_lpid: ::pid_t,
57-
pub shm_nattch: ::shmatt_t,
58-
__unused4: ::c_ulong,
59-
__unused5: ::c_ulong
60-
}
6134
}
6235

6336
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
6437

65-
pub const MCL_CURRENT: ::c_int = 0x0001;
66-
pub const MCL_FUTURE: ::c_int = 0x0002;
67-
68-
pub const SIGSTKSZ: ::size_t = 8192;
69-
pub const CBAUD: ::tcflag_t = 0o0010017;
70-
pub const TAB1: ::c_int = 0x00000800;
71-
pub const TAB2: ::c_int = 0x00001000;
72-
pub const TAB3: ::c_int = 0x00001800;
73-
pub const CR1: ::c_int = 0x00000200;
74-
pub const CR2: ::c_int = 0x00000400;
75-
pub const CR3: ::c_int = 0x00000600;
76-
pub const FF1: ::c_int = 0x00008000;
77-
pub const BS1: ::c_int = 0x00002000;
78-
pub const VT1: ::c_int = 0x00004000;
79-
pub const VWERASE: usize = 14;
80-
pub const VREPRINT: usize = 12;
81-
pub const VSUSP: usize = 10;
82-
pub const VSTART: usize = 8;
83-
pub const VSTOP: usize = 9;
84-
pub const VDISCARD: usize = 13;
85-
pub const VTIME: usize = 5;
86-
pub const IXON: ::tcflag_t = 0x00000400;
87-
pub const IXOFF: ::tcflag_t = 0x00001000;
88-
pub const ONLCR: ::tcflag_t = 0x4;
89-
pub const CSIZE: ::tcflag_t = 0x00000030;
90-
pub const CS6: ::tcflag_t = 0x00000010;
91-
pub const CS7: ::tcflag_t = 0x00000020;
92-
pub const CS8: ::tcflag_t = 0x00000030;
93-
pub const CSTOPB: ::tcflag_t = 0x00000040;
94-
pub const CREAD: ::tcflag_t = 0x00000080;
95-
pub const PARENB: ::tcflag_t = 0x00000100;
96-
pub const PARODD: ::tcflag_t = 0x00000200;
97-
pub const HUPCL: ::tcflag_t = 0x00000400;
98-
pub const CLOCAL: ::tcflag_t = 0x00000800;
99-
pub const ECHOKE: ::tcflag_t = 0x00000800;
100-
pub const ECHOE: ::tcflag_t = 0x00000010;
101-
pub const ECHOK: ::tcflag_t = 0x00000020;
102-
pub const ECHONL: ::tcflag_t = 0x00000040;
103-
pub const ECHOPRT: ::tcflag_t = 0x00000400;
104-
pub const ECHOCTL: ::tcflag_t = 0x00000200;
105-
pub const ISIG: ::tcflag_t = 0x00000001;
106-
pub const ICANON: ::tcflag_t = 0x00000002;
107-
pub const PENDIN: ::tcflag_t = 0x00004000;
108-
pub const NOFLSH: ::tcflag_t = 0x00000080;
109-
110-
pub const VEOL: usize = 11;
111-
pub const VEOL2: usize = 16;
112-
pub const VMIN: usize = 6;
113-
pub const IEXTEN: ::tcflag_t = 0x00008000;
114-
pub const TOSTOP: ::tcflag_t = 0x00000100;
115-
pub const FLUSHO: ::tcflag_t = 0x00001000;
116-
pub const EXTPROC: ::tcflag_t = 0x00010000;
117-
pub const TCGETS: ::c_ulong = 0x5401;
118-
pub const TCSETS: ::c_ulong = 0x5402;
119-
pub const TCSETSW: ::c_ulong = 0x5403;
120-
pub const TCSETSF: ::c_ulong = 0x5404;
121-
pub const TCGETA: ::c_ulong = 0x5405;
122-
pub const TCSETA: ::c_ulong = 0x5406;
123-
pub const TCSETAW: ::c_ulong = 0x5407;
124-
pub const TCSETAF: ::c_ulong = 0x5408;
125-
pub const TCSBRK: ::c_ulong = 0x5409;
126-
pub const TCXONC: ::c_ulong = 0x540A;
127-
pub const TCFLSH: ::c_ulong = 0x540B;
128-
pub const TIOCINQ: ::c_ulong = 0x541B;
129-
pub const TIOCGPGRP: ::c_ulong = 0x540F;
130-
pub const TIOCSPGRP: ::c_ulong = 0x5410;
131-
pub const TIOCOUTQ: ::c_ulong = 0x5411;
132-
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
133-
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
134-
pub const FIONREAD: ::c_ulong = 0x541B;
135-
13638
cfg_if! {
13739
if #[cfg(target_arch = "aarch64")] {
13840
mod aarch64;

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

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,32 @@ s! {
5151
pub struct pthread_attr_t {
5252
__size: [u64; 7]
5353
}
54+
55+
pub struct ipc_perm {
56+
pub __key: ::key_t,
57+
pub uid: ::uid_t,
58+
pub gid: ::gid_t,
59+
pub cuid: ::uid_t,
60+
pub cgid: ::gid_t,
61+
pub mode: ::mode_t,
62+
pub __seq: ::uint32_t,
63+
__pad1: ::uint32_t,
64+
__unused1: ::uint64_t,
65+
__unused2: ::c_ulong,
66+
}
67+
68+
pub struct shmid_ds {
69+
pub shm_perm: ::ipc_perm,
70+
pub shm_atime: ::time_t,
71+
pub shm_dtime: ::time_t,
72+
pub shm_ctime: ::time_t,
73+
pub shm_segsz: ::size_t,
74+
pub shm_cpid: ::pid_t,
75+
pub shm_lpid: ::pid_t,
76+
pub shm_nattch: ::shmatt_t,
77+
__unused4: ::c_ulong,
78+
__unused5: ::c_ulong
79+
}
5480
}
5581

5682
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
@@ -77,3 +103,74 @@ pub const FIONBIO: ::c_ulong = 0x8004667e;
77103

78104
pub const SYS_gettid: ::c_long = 207;
79105
pub const SYS_perf_event_open: ::c_long = 319;
106+
107+
pub const MCL_CURRENT: ::c_int = 0x2000;
108+
pub const MCL_FUTURE: ::c_int = 0x4000;
109+
110+
pub const SIGSTKSZ: ::size_t = 0x4000;
111+
pub const CBAUD: ::tcflag_t = 0xff;
112+
pub const TAB1: ::c_int = 0x400;
113+
pub const TAB2: ::c_int = 0x800;
114+
pub const TAB3: ::c_int = 0xc00;
115+
pub const CR1: ::c_int = 0x1000;
116+
pub const CR2: ::c_int = 0x2000;
117+
pub const CR3: ::c_int = 0x3000;
118+
pub const FF1: ::c_int = 0x4000;
119+
pub const BS1: ::c_int = 0x8000;
120+
pub const VT1: ::c_int = 0x10000;
121+
pub const VWERASE: usize = 0xa;
122+
pub const VREPRINT: usize = 0xb;
123+
pub const VSUSP: usize = 0xc;
124+
pub const VSTART: usize = 0xd;
125+
pub const VSTOP: usize = 0xe;
126+
pub const VDISCARD: usize = 0x10;
127+
pub const VTIME: usize = 0x7;
128+
pub const IXON: ::tcflag_t = 0x200;
129+
pub const IXOFF: ::tcflag_t = 0x400;
130+
pub const ONLCR: ::tcflag_t = 0x2;
131+
pub const CSIZE: ::tcflag_t = 0x300;
132+
pub const CS6: ::tcflag_t = 0x100;
133+
pub const CS7: ::tcflag_t = 0x200;
134+
pub const CS8: ::tcflag_t = 0x300;
135+
pub const CSTOPB: ::tcflag_t = 0x400;
136+
pub const CREAD: ::tcflag_t = 0x800;
137+
pub const PARENB: ::tcflag_t = 0x1000;
138+
pub const PARODD: ::tcflag_t = 0x2000;
139+
pub const HUPCL: ::tcflag_t = 0x4000;
140+
pub const CLOCAL: ::tcflag_t = 0x8000;
141+
pub const ECHOKE: ::tcflag_t = 0x1;
142+
pub const ECHOE: ::tcflag_t = 0x2;
143+
pub const ECHOK: ::tcflag_t = 0x4;
144+
pub const ECHONL: ::tcflag_t = 0x10;
145+
pub const ECHOPRT: ::tcflag_t = 0x20;
146+
pub const ECHOCTL: ::tcflag_t = 0x40;
147+
pub const ISIG: ::tcflag_t = 0x80;
148+
pub const ICANON: ::tcflag_t = 0x100;
149+
pub const PENDIN: ::tcflag_t = 0x20000000;
150+
pub const NOFLSH: ::tcflag_t = 0x80000000;
151+
152+
pub const VEOL: usize = 6;
153+
pub const VEOL2: usize = 8;
154+
pub const VMIN: usize = 5;
155+
pub const IEXTEN: ::tcflag_t = 0x400;
156+
pub const TOSTOP: ::tcflag_t = 0x400000;
157+
pub const FLUSHO: ::tcflag_t = 0x800000;
158+
pub const EXTPROC: ::tcflag_t = 0x10000000;
159+
pub const TCGETS: ::c_ulong = 0x403c7413;
160+
pub const TCSETS: ::c_ulong = 0x803c7414;
161+
pub const TCSETSW: ::c_ulong = 0x803c7415;
162+
pub const TCSETSF: ::c_ulong = 0x803c7416;
163+
pub const TCGETA: ::c_ulong = 0x40147417;
164+
pub const TCSETA: ::c_ulong = 0x80147418;
165+
pub const TCSETAW: ::c_ulong = 0x80147419;
166+
pub const TCSETAF: ::c_ulong = 0x8014741c;
167+
pub const TCSBRK: ::c_ulong = 0x2000741d;
168+
pub const TCXONC: ::c_ulong = 0x2000741e;
169+
pub const TCFLSH: ::c_ulong = 0x2000741f;
170+
pub const TIOCINQ: ::c_ulong = 0x4004667f;
171+
pub const TIOCGPGRP: ::c_ulong = 0x40047477;
172+
pub const TIOCSPGRP: ::c_ulong = 0x80047476;
173+
pub const TIOCOUTQ: ::c_ulong = 0x40047473;
174+
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
175+
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
176+
pub const FIONREAD: ::c_ulong = 0x4004667f;

0 commit comments

Comments
 (0)