Skip to content

Commit 5fd6540

Browse files
committed
Auto merge of #2071 - kaniini:s390x-musl, r=Amanieu
add definitions for s390x musl targets Add support for s390x musl targets to libc. I haven't added CI because I am not familiar with the pipelines, but would be glad to do so if somebody outlines what needs to be done.
2 parents 1524495 + 41cda2a commit 5fd6540

File tree

6 files changed

+872
-1
lines changed

6 files changed

+872
-1
lines changed

.github/workflows/bors.yml

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ jobs:
136136
# FIXME: It seems some items in `src/unix/mod.rs`
137137
# aren't defined on redox actually.
138138
# x86_64-unknown-redox,
139+
# FIXME: Enable when CI is building a toolchain for this target
140+
# s390x-unknown-linux-musl,
139141
]
140142
steps:
141143
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
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

+7
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ 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
69+
;;
6370
*)
6471
echo "Unknown target arch: \"${1}\""
6572
exit 1

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

+3
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ cfg_if! {
161161
} else if #[cfg(any(target_arch = "powerpc64"))] {
162162
mod powerpc64;
163163
pub use self::powerpc64::*;
164+
} else if #[cfg(any(target_arch = "s390x"))] {
165+
mod s390x;
166+
pub use self::s390x::*;
164167
} else if #[cfg(any(target_arch = "x86_64"))] {
165168
mod x86_64;
166169
pub use self::x86_64::*;

0 commit comments

Comments
 (0)