Get rid of build-powerpc64le-toolchain.sh

The dist-powerpc64le-linux-musl runner never actually used the toolchain
that the script produced, it instead used the one from crosstool-ng.

The dist-powerpc64le-linux-gnu runner did use it, from what I can tell
mainly to get a glibc 2.17 version with ppc64le support backported.
Since crosstool-ng has the necessary patches, we can just use
crosstool-ng to get an appropriate toolchain. While at it, use kernel
3.10 headers since that's the version documented in platform support for
this target.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This commit is contained in:
Jens Reidel 2025-07-04 10:46:05 +02:00
parent 837c5dd7de
commit 12bc4096dc
No known key found for this signature in database
GPG key ID: 23C1E5F512C12303
4 changed files with 7 additions and 90 deletions

View file

@ -15,19 +15,15 @@ COPY scripts/crosstool-ng-build.sh /scripts/
COPY host-x86_64/dist-powerpc64le-linux-gnu/powerpc64le-unknown-linux-gnu.defconfig /tmp/crosstool.defconfig
RUN /scripts/crosstool-ng-build.sh
WORKDIR /build
RUN apt-get install -y --no-install-recommends rpm2cpio cpio
COPY scripts/shared.sh scripts/build-powerpc64le-toolchain.sh /build/
RUN ./build-powerpc64le-toolchain.sh
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
ENV PATH=$PATH:/x-tools/powerpc64le-unknown-linux-gnu/bin
ENV \
AR_powerpc64le_unknown_linux_gnu=powerpc64le-linux-gnu-ar \
CC_powerpc64le_unknown_linux_gnu=powerpc64le-linux-gnu-gcc \
CXX_powerpc64le_unknown_linux_gnu=powerpc64le-linux-gnu-g++
AR_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-ar \
CC_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-gcc \
CXX_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-g++
ENV HOSTS=powerpc64le-unknown-linux-gnu

View file

@ -9,6 +9,7 @@ CT_ARCH_64=y
# CT_DEMULTILIB is not set
CT_ARCH_ARCH="powerpc64le"
CT_KERNEL_LINUX=y
CT_LINUX_V_4_19=y
CT_LINUX_V_3_10=y
CT_GLIBC_V_2_17=y
CT_CC_LANG_CXX=y
CT_GETTEXT_NEEDED=y

View file

@ -15,12 +15,6 @@ COPY scripts/crosstool-ng-build.sh /scripts/
COPY host-x86_64/dist-powerpc64le-linux-musl/powerpc64le-unknown-linux-musl.defconfig /tmp/crosstool.defconfig
RUN /scripts/crosstool-ng-build.sh
WORKDIR /build
RUN apt-get install -y --no-install-recommends rpm2cpio cpio
COPY scripts/shared.sh scripts/build-powerpc64le-toolchain.sh /build/
RUN ./build-powerpc64le-toolchain.sh
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

View file

@ -1,74 +0,0 @@
#!/usr/bin/env bash
set -ex
source shared.sh
BINUTILS=2.32
GCC=8.3.0
TARGET=powerpc64le-linux-gnu
SYSROOT=/usr/local/$TARGET/sysroot
# First, download the CentOS7 glibc.ppc64le and relevant header files.
# (upstream ppc64le support wasn't added until 2.19, which el7 backported.)
mkdir -p $SYSROOT
pushd $SYSROOT
# centos_base=http://vault.centos.org/altarch/7.3.1611/os/ppc64le/Packages/
# Mirrored from centos_base above
centos_base=https://ci-mirrors.rust-lang.org/rustc
glibc_v=2.17-157-2020-11-25.el7
kernel_v=3.10.0-514-2020-11-25.el7
for package in glibc{,-devel,-headers}-$glibc_v kernel-headers-$kernel_v; do
curl $centos_base/$package.ppc64le.rpm | \
rpm2cpio - | cpio -idm
done
ln -sT lib64 lib
ln -sT lib64 usr/lib
popd
# Next, download and build binutils.
mkdir binutils-$TARGET
pushd binutils-$TARGET
curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.xz | tar xJf -
mkdir binutils-build
cd binutils-build
hide_output ../binutils-$BINUTILS/configure --target=$TARGET --with-sysroot=$SYSROOT
hide_output make -j10
hide_output make install
popd
rm -rf binutils-$TARGET
# Finally, download and build gcc.
mkdir gcc-$TARGET
pushd gcc-$TARGET
curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | tar xJf -
cd gcc-$GCC
hide_output ./contrib/download_prerequisites
mkdir ../gcc-build
cd ../gcc-build
hide_output ../gcc-$GCC/configure \
--enable-languages=c,c++ \
--target=$TARGET \
--with-cpu=power8 \
--with-sysroot=$SYSROOT \
--disable-libcilkrts \
--disable-multilib \
--disable-nls \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libcilkrt \
--disable-libada \
--disable-libsanitizer \
--disable-libquadmath-support \
--disable-lto
hide_output hide_output make -j10
hide_output make install
popd
rm -rf gcc-$TARGET