Skip to content

Commit

Permalink
Auto merge of #2071 - kaniini:s390x-musl, r=Amanieu
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Feb 28, 2021
2 parents 1524495 + f230862 commit 3c2e292
Show file tree
Hide file tree
Showing 6 changed files with 871 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
# FIXME: It seems some items in `src/unix/mod.rs`
# aren't defined on redox actually.
# x86_64-unknown-redox,
s390x-unknown-linux-musl,
]
steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
Expand Down
17 changes: 17 additions & 0 deletions ci/docker/s390x-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:20.04

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

COPY install-musl.sh /
RUN sh /install-musl.sh s390x

# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /musl-s390x" \
CC_s390x_unknown_linux_gnu=musl-gcc \
RUSTFLAGS='-Clink-args=-lgcc' \
PATH=$PATH:/musl-s390x/bin:/rust/bin
7 changes: 7 additions & 0 deletions ci/install-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ case ${1} in
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
make install -j4
;;
s390x)
musl_arch=s390x
kernel_arch=s390
CC=s390x-linux-gnu-gcc \
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
make install -j4
;;
*)
echo "Unknown target arch: \"${1}\""
exit 1
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/musl/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ cfg_if! {
} else if #[cfg(any(target_arch = "powerpc64"))] {
mod powerpc64;
pub use self::powerpc64::*;
} else if #[cfg(any(target_arch = "s390x"))] {
mod s390x;
pub use self::s390x::*;
} else if #[cfg(any(target_arch = "x86_64"))] {
mod x86_64;
pub use self::x86_64::*;
Expand Down
Loading

0 comments on commit 3c2e292

Please sign in to comment.