Skip to content
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

add definitions for s390x musl targets #2071

Merged
merged 8 commits into from
Feb 28, 2021
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
2 changes: 2 additions & 0 deletions .github/workflows/bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ jobs:
# FIXME: It seems some items in `src/unix/mod.rs`
# aren't defined on redox actually.
# x86_64-unknown-redox,
# FIXME: Enable when CI is building a toolchain for this target
# 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