Rollup merge of #149962 - Gelbpunkt:powerpc64-musl-tier-2, r=Mark-Simulacrum

Promote powerpc64-unknown-linux-musl to tier 2 with host tools

MCP: https://github.com/rust-lang/compiler-team/issues/946

Tested by compiling on an x86_64 host via `DEPLOY=1 ./src/ci/docker/run.sh dist-powerpc64-linux-musl` and running on Alpine Linux ppc64:

```
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# bash install.sh
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'rust-std-powerpc64-unknown-linux-musl'
install: installing component 'cargo'
install: installing component 'rustfmt-preview'
install: installing component 'rust-analyzer-preview'
install: installing component 'llvm-tools-preview'
install: installing component 'clippy-preview'
install: installing component 'miri-preview'
install: installing component 'rust-analysis-powerpc64-unknown-linux-musl'
install: installing component 'llvm-bitcode-linker-preview'

    rust installed.

root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# echo 'fn main() { println!("hello world"); }' > test.rs
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# which rustc
/usr/local/bin/rustc
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# rustc test.rs
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# ./test
hello world
root@algol /t/rust-nightly-powerpc64-unknown-linux-musl# file test
test: ELF 64-bit MSB pie executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-powerpc64.so.1, BuildID[sha1]=90a0fa543b3d42588ad32c5b858e56ac9c56faed, with debug_info, not stripped
```

I renamed the glibc job and created a new one for musl since the same is done for the little-endian targets.

Implements rust-lang/rust#149938

try-job: dist-powerpc64-linux-gnu
try-job: dist-powerpc64-linux-musl
This commit is contained in:
Matthias Krüger 2026-01-24 21:04:13 +01:00 committed by GitHub
commit df4fe869ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 70 additions and 9 deletions

View file

@ -17,8 +17,8 @@ pub(crate) fn target() -> Target {
llvm_target: "powerpc64-unknown-linux-musl".into(),
metadata: TargetMetadata {
description: Some("64-bit PowerPC Linux with musl 1.2.5".into()),
tier: Some(3),
host_tools: Some(false),
tier: Some(2),
host_tools: Some(true),
std: Some(true),
},
pointer_width: 64,

View file

@ -244,6 +244,7 @@ pub(crate) fn is_ci_llvm_available_for_target(
("loongarch64-unknown-linux-musl", false),
("powerpc-unknown-linux-gnu", false),
("powerpc64-unknown-linux-gnu", false),
("powerpc64-unknown-linux-musl", false),
("powerpc64le-unknown-linux-gnu", false),
("powerpc64le-unknown-linux-musl", false),
("riscv64gc-unknown-linux-gnu", false),

View file

@ -460,6 +460,7 @@ pub(crate) fn is_download_ci_available(target_triple: &str, llvm_assertions: boo
"loongarch64-unknown-linux-gnu",
"powerpc-unknown-linux-gnu",
"powerpc64-unknown-linux-gnu",
"powerpc64-unknown-linux-musl",
"powerpc64le-unknown-linux-gnu",
"powerpc64le-unknown-linux-musl",
"riscv64gc-unknown-linux-gnu",

View file

@ -11,7 +11,7 @@ RUN sh /scripts/rustbuild-setup.sh
WORKDIR /tmp
COPY scripts/crosstool-ng-build.sh /scripts/
COPY host-x86_64/dist-powerpc64-linux/powerpc64-linux-gnu.defconfig /tmp/crosstool.defconfig
COPY host-x86_64/dist-powerpc64-linux-gnu/powerpc64-linux-gnu.defconfig /tmp/crosstool.defconfig
RUN /scripts/crosstool-ng-build.sh
COPY scripts/sccache.sh /scripts/

View file

@ -0,0 +1,39 @@
FROM ubuntu:22.04
COPY scripts/cross-apt-packages.sh /scripts/
RUN sh /scripts/cross-apt-packages.sh
COPY scripts/crosstool-ng.sh /scripts/
RUN sh /scripts/crosstool-ng.sh
COPY scripts/rustbuild-setup.sh /scripts/
RUN sh /scripts/rustbuild-setup.sh
WORKDIR /tmp
COPY scripts/crosstool-ng-build.sh /scripts/
COPY host-x86_64/dist-powerpc64-linux-musl/powerpc64-unknown-linux-musl.defconfig /tmp/crosstool.defconfig
RUN /scripts/crosstool-ng-build.sh
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
ENV PATH=$PATH:/x-tools/powerpc64-unknown-linux-musl/bin
ENV \
AR_powerpc64_unknown_linux_musl=powerpc64-unknown-linux-musl-ar \
CC_powerpc64_unknown_linux_musl=powerpc64-unknown-linux-musl-gcc \
CXX_powerpc64_unknown_linux_musl=powerpc64-unknown-linux-musl-g++
ENV HOSTS=powerpc64-unknown-linux-musl
ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-full-tools \
--enable-profiler \
--enable-sanitizers \
--disable-docs \
--set target.powerpc64-unknown-linux-musl.crt-static=false \
--musl-root-powerpc64=/x-tools/powerpc64-unknown-linux-musl/powerpc64-unknown-linux-musl/sysroot/usr
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS

View file

@ -0,0 +1,15 @@
CT_CONFIG_VERSION="4"
CT_EXPERIMENTAL=y
CT_PREFIX_DIR="/x-tools/${CT_TARGET}"
CT_USE_MIRROR=y
CT_MIRROR_BASE_URL="https://ci-mirrors.rust-lang.org/rustc"
CT_ARCH_POWERPC=y
CT_ARCH_64=y
CT_ARCH_ABI="elfv2"
# CT_DEMULTILIB is not set
CT_KERNEL_LINUX=y
CT_LINUX_V_4_19=y
CT_LIBC_MUSL=y
CT_MUSL_V_1_2_5=y
CT_CC_LANG_CXX=y
CT_GETTEXT_NEEDED=y

View file

@ -232,7 +232,10 @@ auto:
- name: dist-powerpc-linux
<<: *job-linux-4c
- name: dist-powerpc64-linux
- name: dist-powerpc64-linux-gnu
<<: *job-linux-4c
- name: dist-powerpc64-linux-musl
<<: *job-linux-4c
- name: dist-powerpc64le-linux-gnu

View file

@ -100,6 +100,7 @@ target | notes
[`i686-pc-windows-gnu`](platform-support/windows-gnu.md) | 32-bit MinGW (Windows 10+, Windows Server 2016+, Pentium 4) [^x86_32-floats-return-ABI] [^win32-msvc-alignment]
`powerpc-unknown-linux-gnu` | PowerPC Linux (kernel 3.2+, glibc 2.17)
`powerpc64-unknown-linux-gnu` | PPC64 Linux (kernel 3.2+, glibc 2.17)
[`powerpc64-unknown-linux-musl`](platform-support/powerpc64-unknown-linux-musl.md) | PPC64 Linux (kernel 4.19+, musl 1.2.5)
[`powerpc64le-unknown-linux-gnu`](platform-support/powerpc64le-unknown-linux-gnu.md) | PPC64LE Linux (kernel 3.10+, glibc 2.17)
[`powerpc64le-unknown-linux-musl`](platform-support/powerpc64le-unknown-linux-musl.md) | PPC64LE Linux (kernel 4.19+, musl 1.2.5)
[`riscv64gc-unknown-linux-gnu`](platform-support/riscv64gc-unknown-linux-gnu.md) | RISC-V Linux (kernel 4.20+, glibc 2.29)
@ -371,7 +372,6 @@ target | std | host | notes
[`powerpc-wrs-vxworks-spe`](platform-support/vxworks.md) | ✓ | |
[`powerpc64-ibm-aix`](platform-support/aix.md) | ? | | 64-bit AIX (7.2 and newer)
[`powerpc64-unknown-freebsd`](platform-support/freebsd.md) | ✓ | ✓ | PPC64 FreeBSD (ELFv2)
[`powerpc64-unknown-linux-musl`](platform-support/powerpc64-unknown-linux-musl.md) | ✓ | ✓ | PPC64 Linux (kernel 4.19, musl 1.2.5)
[`powerpc64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/powerpc64
[`powerpc64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
[`powerpc64le-unknown-freebsd`](platform-support/freebsd.md) | ✓ | ✓ | PPC64LE FreeBSD

View file

@ -1,10 +1,13 @@
# powerpc64-unknown-linux-musl
**Tier: 3**
**Tier: 2**
Target for 64-bit big endian PowerPC Linux programs using musl libc.
This target uses the ELF v2 ABI.
The baseline CPU required is a PowerPC 970, which means AltiVec is required and
the oldest IBM server CPU supported is therefore POWER6.
## Target maintainers
[@Gelbpunkt](https://github.com/Gelbpunkt)
@ -38,9 +41,8 @@ linker = "powerpc64-linux-musl-gcc"
## Building Rust programs
Rust does not yet ship pre-compiled artifacts for this target. To compile for
this target, you will first need to build Rust with the target enabled (see
"Building the target" above).
This target is distributed through `rustup`, and otherwise requires no
special configuration.
## Cross-compilation