Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ jobs:
env: { TEST_MUSL_V1_2_3: 1 }
artifact-tag: new-musl
- target: powerpc64-unknown-linux-gnu
- target: powerpc64-unknown-linux-musl
- target: powerpc64-unknown-linux-musl
env: { RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 }
artifact-tag: new-musl
- target: powerpc64le-unknown-linux-gnu
- target: powerpc64le-unknown-linux-musl
- target: powerpc64le-unknown-linux-musl
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ targets = [
"loongarch64-unknown-linux-musl",
"powerpc-unknown-linux-gnu",
"powerpc64-unknown-linux-gnu",
"powerpc64-unknown-linux-musl",
"powerpc64le-unknown-linux-gnu",
"powerpc64le-unknown-linux-musl",
"riscv64gc-unknown-linux-gnu",
Expand Down Expand Up @@ -126,7 +127,6 @@ targets = [
"powerpc64-ibm-aix",
"powerpc64-unknown-freebsd",
"powerpc64-unknown-linux-gnu",
"powerpc64-unknown-linux-musl",
"powerpc64-wrs-vxworks",
"riscv32-wrs-vxworks",
"riscv32gc-unknown-linux-musl",
Expand Down
34 changes: 34 additions & 0 deletions ci/docker/powerpc64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
gcc-powerpc64-linux-gnu \
git \
libc6-dev \
make \
patch \
qemu-user \
rsync \
xz-utils

RUN curl -O https://static.rust-lang.org/dist/2026-06-26/rust-std-nightly-powerpc64-unknown-linux-musl.tar.xz && \
tar xf rust-std-nightly-powerpc64-unknown-linux-musl.tar.xz && \
find rust-std-nightly-powerpc64-unknown-linux-musl/ -name libcompiler_builtins*.rlib -exec sh -c "cp {} /compiler_builtins.rlib" \;

ARG MUSL_VERSION
COPY install-musl.sh /
RUN /install-musl.sh powerpc64 "$MUSL_VERSION"

# Rust's unwind unconditionally links to libgcc_s.so.1
# We instead get the unwinding symbols from the self-contained libunwind.a
# since that's included in the toolchain
RUN touch /musl-powerpc64/lib/libgcc_s.so.1
Comment thread
Gelbpunkt marked this conversation as resolved.

ENV PATH=$PATH:/musl-powerpc64/bin:/rust/bin \
CC_powerpc64_unknown_linux_musl=musl-gcc \
CFLAGS_powerpc64_unknown_linux_musl="-mabi=elfv2" \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-ppc64 -L /musl-powerpc64" \
EXTRA_RUSTFLAGS="-Clink-args=-lunwind -Clink-self-contained=yes -L /musl-powerpc64/lib"
15 changes: 13 additions & 2 deletions ci/install-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,21 @@ case ${1} in
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
make install -j4
;;
powerpc64*)
powerpc64le)
musl_arch=powerpc64
kernel_arch=powerpc
CC="${1}-linux-gnu-gcc" CFLAGS="-mlong-double-64" \
CC=powerpc64le-linux-gnu-gcc CFLAGS="-mlong-double-64" \
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
make install -j4
;;
powerpc64)
musl_arch=powerpc64
kernel_arch=powerpc
# Ubuntu's powerpc64 cross toolchain is for ELFv1, but we need a
# libgcc that's for ELFv2, which we can't trivially get.
# Luckily, compiler-builtins provides all the necessary symbols,
# so we resort to using that instead
CC=powerpc64-linux-gnu-gcc CFLAGS="-mlong-double-64 -mabi=elfv2" LIBCC="/compiler_builtins.rlib" \
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
make install -j4
;;
Expand Down
2 changes: 1 addition & 1 deletion ci/verify-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class TargetResult:
Target("loongarch64-unknown-linux-musl", min_toolchain=Toolchain.STABLE),
Target("powerpc-unknown-linux-gnu"),
Target("powerpc64-unknown-linux-gnu"),
Target("powerpc64-unknown-linux-musl", min_toolchain=Toolchain.STABLE),
Target("powerpc64le-unknown-linux-gnu"),
Target("powerpc64le-unknown-linux-musl", min_toolchain=Toolchain.STABLE),
Target("riscv64gc-unknown-linux-gnu"),
Expand Down Expand Up @@ -188,7 +189,6 @@ class TargetResult:
Target("powerpc-wrs-vxworks-spe", dist=False),
Target("powerpc64-ibm-aix", dist=False),
Target("powerpc64-unknown-freebsd", dist=False),
Target("powerpc64-unknown-linux-musl", dist=False),
Target("powerpc64-wrs-vxworks", dist=False),
Target("riscv32-wrs-vxworks", dist=False),
Target("riscv32gc-unknown-linux-gnu", dist=False),
Expand Down