Skip to content

Commit 48cc0c9

Browse files
committed
Auto merge of rust-lang#828 - malbarbo:sparc64-fix-test, r=alexcrichton
Fix sparc64-unknown-linux-gnu tests Run sparc64 test in qemu system like s390x. Fix O_TMPFILE const. Fixes rust-lang/libc#822
2 parents f150863 + 8fe5875 commit 48cc0c9

File tree

11 files changed

+36
-7
lines changed

11 files changed

+36
-7
lines changed

ci/docker/sparc64-unknown-linux-gnu/Dockerfile

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
FROM ubuntu:17.04
33

44
RUN apt-get update && apt-get install -y --no-install-recommends \
5-
gcc libc6-dev qemu-user ca-certificates \
6-
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross
5+
curl ca-certificates \
6+
gcc libc6-dev \
7+
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \
8+
qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \
9+
p7zip-full cpio
10+
11+
COPY linux-sparc64.sh /
12+
RUN bash /linux-sparc64.sh
13+
14+
COPY test-runner-linux /
715

816
ENV CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc \
9-
# TODO: in theory we should execute this, but qemu segfaults immediately
10-
# see https://github.com/rust-lang/libc/issues/822
11-
# CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-sparc64 -L /usr/sparc64-linux-gnu" \
12-
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER=true \
17+
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux sparc64" \
1318
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
1419
PATH=$PATH:/rust/bin

ci/linux-sparc64.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set -ex
2+
3+
mkdir -m 777 /qemu
4+
cd /qemu
5+
6+
curl -LO https://cdimage.debian.org/cdimage/ports/debian-9.0-sparc64-NETINST-1.iso
7+
7z e debian-9.0-sparc64-NETINST-1.iso boot/initrd.gz
8+
7z e debian-9.0-sparc64-NETINST-1.iso boot/sparc64
9+
mv sparc64 kernel
10+
rm debian-9.0-sparc64-NETINST-1.iso
11+
12+
mkdir init
13+
cd init
14+
gunzip -c ../initrd.gz | cpio -id
15+
rm ../initrd.gz
16+
cp /usr/sparc64-linux-gnu/lib/libgcc_s.so.1 usr/lib/
17+
chmod a+w .

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

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub const O_TRUNC: ::c_int = 512;
5050
pub const O_NOATIME: ::c_int = 0o1000000;
5151
pub const O_CLOEXEC: ::c_int = 0x80000;
5252
pub const O_PATH: ::c_int = 0o10000000;
53+
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
5354

5455
pub const EBFONT: ::c_int = 59;
5556
pub const ENOSTR: ::c_int = 60;

src/unix/notbsd/linux/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,6 @@ pub const ENOATTR: ::c_int = ::ENODATA;
10241024
pub const SO_ORIGINAL_DST: ::c_int = 80;
10251025
pub const IUTF8: ::tcflag_t = 0x00004000;
10261026
pub const CMSPAR: ::tcflag_t = 0o10000000000;
1027-
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
10281027

10291028
f! {
10301029
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {

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

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ pub const NCCS: usize = 32;
9090
pub const O_TRUNC: ::c_int = 512;
9191
pub const O_NOATIME: ::c_int = 0o1000000;
9292
pub const O_CLOEXEC: ::c_int = 0x80000;
93+
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
9394

9495
pub const EBFONT: ::c_int = 59;
9596
pub const ENOSTR: ::c_int = 60;

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

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub const O_DSYNC: ::c_int = 4096;
8787
pub const O_FSYNC: ::c_int = 0x101000;
8888
pub const O_NOATIME: ::c_int = 0o1000000;
8989
pub const O_PATH: ::c_int = 0o10000000;
90+
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
9091

9192
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
9293

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

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ pub const O_DSYNC: ::c_int = 4096;
145145
pub const O_FSYNC: ::c_int = 0x101000;
146146
pub const O_NOATIME: ::c_int = 0o1000000;
147147
pub const O_PATH: ::c_int = 0o10000000;
148+
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
148149

149150
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
150151

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

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ pub const O_DSYNC: ::c_int = 4096;
132132
pub const O_FSYNC: ::c_int = 0x101000;
133133
pub const O_NOATIME: ::c_int = 0o1000000;
134134
pub const O_PATH: ::c_int = 0o10000000;
135+
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
135136

136137
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
137138

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

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ pub const O_DSYNC: ::c_int = 0x2000;
145145
pub const O_FSYNC: ::c_int = 0x802000;
146146
pub const O_NOATIME: ::c_int = 0x200000;
147147
pub const O_PATH: ::c_int = 0x1000000;
148+
pub const O_TMPFILE: ::c_int = 0o200000000 | O_DIRECTORY;
148149

149150
pub const MAP_GROWSDOWN: ::c_int = 0x0200;
150151

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

+1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ pub const O_DSYNC: ::c_int = 4096;
249249
pub const O_FSYNC: ::c_int = 0x101000;
250250
pub const O_NOATIME: ::c_int = 0o1000000;
251251
pub const O_PATH: ::c_int = 0o10000000;
252+
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
252253

253254
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
254255

src/unix/notbsd/linux/s390x.rs

+1
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ pub const O_LARGEFILE: ::c_int = 0;
327327
pub const O_NOATIME: ::c_int = 0o1000000;
328328
pub const O_CLOEXEC: ::c_int = 0x80000;
329329
pub const O_PATH: ::c_int = 0o10000000;
330+
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
330331

331332
pub const EBFONT: ::c_int = 59;
332333
pub const ENOSTR: ::c_int = 60;

0 commit comments

Comments
 (0)