Skip to content

Fix sparc64-unknown-linux-gnu tests #828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions ci/docker/s390x-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM ubuntu:17.10

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-s390x-linux-gnu libc6-dev-s390x-cross
curl ca-certificates \
gcc libc6-dev \
gcc-s390x-linux-gnu libc6-dev-s390x-cross \
qemu-system-s390x \
cpio

COPY linux-s390x.sh /
RUN bash /linux-s390x.sh

COPY test-runner-linux /

ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
# TODO: in theory we should execute this, but qemu segfaults immediately :(
# CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu" \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER=true \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux s390x" \
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
PATH=$PATH:/rust/bin
17 changes: 11 additions & 6 deletions ci/docker/sparc64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
FROM ubuntu:17.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross
curl ca-certificates \
gcc libc6-dev \
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \
qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \
p7zip-full cpio

COPY linux-sparc64.sh /
RUN bash /linux-sparc64.sh

COPY test-runner-linux /

ENV CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc \
# TODO: in theory we should execute this, but qemu segfaults immediately
# see https://github.com/rust-lang/libc/issues/822
# CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-sparc64 -L /usr/sparc64-linux-gnu" \
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER=true \
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux sparc64" \
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
PATH=$PATH:/rust/bin
18 changes: 18 additions & 0 deletions ci/linux-s390x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set -ex

mkdir -m 777 /qemu
cd /qemu

curl -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/kernel.debian
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/initrd.debian

mv kernel.debian kernel
mv initrd.debian initrd.gz

mkdir init
cd init
gunzip -c ../initrd.gz | cpio -id
rm ../initrd.gz
cp /usr/s390x-linux-gnu/lib/libgcc_s.so.1 usr/lib/
chmod a+w .
17 changes: 17 additions & 0 deletions ci/linux-sparc64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set -ex

mkdir -m 777 /qemu
cd /qemu

curl -LO https://cdimage.debian.org/cdimage/ports/debian-9.0-sparc64-NETINST-1.iso
7z e debian-9.0-sparc64-NETINST-1.iso boot/initrd.gz
7z e debian-9.0-sparc64-NETINST-1.iso boot/sparc64
mv sparc64 kernel
rm debian-9.0-sparc64-NETINST-1.iso

mkdir init
cd init
gunzip -c ../initrd.gz | cpio -id
rm ../initrd.gz
cp /usr/sparc64-linux-gnu/lib/libgcc_s.so.1 usr/lib/
chmod a+w .
23 changes: 23 additions & 0 deletions ci/test-runner-linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e

arch=$1
prog=$2

cd /qemu/init
cp -f $2 prog
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
cd ..

timeout 30s qemu-system-$arch \
-m 1024 \
-nographic \
-kernel kernel \
-initrd initrd.gz \
-append init=/prog > output || true

# remove kernel messages
tr -d '\r' < output | egrep -v '^\['

grep PASSED output > /dev/null
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub const O_TRUNC: ::c_int = 512;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const O_PATH: ::c_int = 0o10000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
Expand Down
1 change: 0 additions & 1 deletion src/unix/notbsd/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,6 @@ pub const ENOATTR: ::c_int = ::ENODATA;
pub const SO_ORIGINAL_DST: ::c_int = 80;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

f! {
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pub const NCCS: usize = 32;
pub const O_TRUNC: ::c_int = 512;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

pub const MAP_GROWSDOWN: ::c_int = 0x0100;

Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b64/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

pub const MAP_GROWSDOWN: ::c_int = 0x0100;

Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b64/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

pub const MAP_GROWSDOWN: ::c_int = 0x0100;

Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b64/sparc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ pub const O_DSYNC: ::c_int = 0x2000;
pub const O_FSYNC: ::c_int = 0x802000;
pub const O_NOATIME: ::c_int = 0x200000;
pub const O_PATH: ::c_int = 0x1000000;
pub const O_TMPFILE: ::c_int = 0o200000000 | O_DIRECTORY;

pub const MAP_GROWSDOWN: ::c_int = 0x0200;

Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b64/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

pub const MAP_GROWSDOWN: ::c_int = 0x0100;

Expand Down
35 changes: 18 additions & 17 deletions src/unix/notbsd/linux/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,11 @@ pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;

pub const O_TRUNC: ::c_int = 512;
pub const O_LARGEFILE: ::c_int = 0o0100000;
pub const O_LARGEFILE: ::c_int = 0;
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const O_PATH: ::c_int = 0o10000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;

pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
Expand Down Expand Up @@ -913,8 +914,8 @@ pub const ECHOPRT: ::tcflag_t = 0o002000;
pub const ECHOKE: ::tcflag_t = 0o004000;
pub const PENDIN: ::tcflag_t = 0o040000;

pub const POLLWRNORM: ::c_short = 0x004;
pub const POLLWRBAND: ::c_short = 0x100;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;

pub const IXON: ::tcflag_t = 0o002000;
pub const IXOFF: ::tcflag_t = 0o010000;
Expand Down Expand Up @@ -1219,20 +1220,20 @@ pub const SYS_mlock2: ::c_long = 374;
pub const SYS_copy_file_range: ::c_long = 375;
pub const SYS_preadv2: ::c_long = 376;
pub const SYS_pwritev2: ::c_long = 377;
pub const SYS_lchown: ::c_long = 16;
pub const SYS_setuid: ::c_long = 23;
pub const SYS_getuid: ::c_long = 24;
pub const SYS_setgid: ::c_long = 46;
pub const SYS_getgid: ::c_long = 47;
pub const SYS_geteuid: ::c_long = 49;
pub const SYS_setreuid: ::c_long = 70;
pub const SYS_setregid: ::c_long = 71;
pub const SYS_getrlimit: ::c_long = 76;
pub const SYS_getgroups: ::c_long = 80;
pub const SYS_fchown: ::c_long = 95;
pub const SYS_setresuid: ::c_long = 164;
pub const SYS_setresgid: ::c_long = 170;
pub const SYS_getresgid: ::c_long = 171;
pub const SYS_lchown: ::c_long = 198;
pub const SYS_setuid: ::c_long = 213;
pub const SYS_getuid: ::c_long = 199;
pub const SYS_setgid: ::c_long = 214;
pub const SYS_getgid: ::c_long = 200;
pub const SYS_geteuid: ::c_long = 201;
pub const SYS_setreuid: ::c_long = 203;
pub const SYS_setregid: ::c_long = 204;
pub const SYS_getrlimit: ::c_long = 191;
pub const SYS_getgroups: ::c_long = 205;
pub const SYS_fchown: ::c_long = 207;
pub const SYS_setresuid: ::c_long = 208;
pub const SYS_setresgid: ::c_long = 210;
pub const SYS_getresgid: ::c_long = 211;
pub const SYS_select: ::c_long = 142;
pub const SYS_getegid: ::c_long = 202;
pub const SYS_setgroups: ::c_long = 206;
Expand Down