Skip to content

Commit 344b409

Browse files
committed
ci: add support for s390x-unknown-linux-musl
1 parent dbb0e6c commit 344b409

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:20.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
curl ca-certificates \
5+
gcc \
6+
gcc-s390x-linux-gnu \
7+
qemu-user
8+
9+
COPY install-musl.sh /
10+
RUN sh /install-musl.sh s390x
11+
12+
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
13+
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
14+
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /musl-s390x" \
15+
CC_s390x_unknown_linux_gnu=musl-gcc \
16+
RUSTFLAGS='-Clink-args=-lgcc' \
17+
PATH=$PATH:/musl-s390x/bin:/rust/bin

ci/install-musl.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ case ${1} in
6060
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
6161
make install -j4
6262
;;
63+
s390x)
64+
musl_arch=s390x
65+
kernel_arch=s390
66+
CC=s390x-linux-gnu-gcc \
67+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
68+
make install -j4
6369
*)
6470
echo "Unknown target arch: \"${1}\""
6571
exit 1

ci/s390x-linux-musl.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"arch": "s390x",
3+
"cpu": "z10",
4+
"crt-static-respected": true,
5+
"data-layout": "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64",
6+
"dynamic-linking": true,
7+
"env": "musl",
8+
"executables": true,
9+
"features": "-vector",
10+
"has-elf-tls": true,
11+
"has-rpath": true,
12+
"is-builtin": true,
13+
"linker-is-gnu": true,
14+
"llvm-target": "s390x-unknown-linux-musl",
15+
"max-atomic-width": 64,
16+
"min-global-align": 16,
17+
"os": "linux",
18+
"position-independent-executables": true,
19+
"pre-link-args": {
20+
"gcc": [
21+
"-Wl,--as-needed",
22+
"-Wl,-z,noexecstack"
23+
]
24+
},
25+
"relro-level": "full",
26+
"static-position-independent-executables": true,
27+
"target-endian": "big",
28+
"target-family": "unix",
29+
"target-pointer-width": "64"
30+
}

0 commit comments

Comments
 (0)