Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into mips64le
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 committed Dec 10, 2024
2 parents 88e89c0 + 8e95cde commit 54959de
Show file tree
Hide file tree
Showing 9 changed files with 2,192 additions and 8 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
platforms:
required: true
type: string
default: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64"
default: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-powerpc64le,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64"
buildsystem_branch:
required: false
type: string
Expand Down Expand Up @@ -52,8 +52,8 @@ env:
DEBUG_CI: ${{ inputs.debug }}
VERBOSE_CI: ${{ inputs.verbose }}
PORTABLE_PYTHON_BUILDSYSTEM_BRANCH: ${{ inputs.buildsystem_branch || 'portable-python' }}
image_map: '{"x86_64": "amd64/ubuntu:18.04", "i386": "i386/ubuntu:18.04", "aarch64": "arm64v8/ubuntu:18.04", "arm": "arm32v7/debian:bullseye", "riscv64": "riscv64/debian:sid", "loongarch64": "loongarch64/debian:sid", "s390x": "s390x/debian:bullseye", "mips64el": "mips64le/debian:bullseye"}'
platform_map: '{"x86_64": "linux/amd64", "i386": "linux/386", "aarch64": "linux/arm64/v8", "arm": "linux/arm/v7", "riscv64": "linux/riscv64", "loongarch64": "linux/loong64", "s390x": "linux/s390x", "mips64el": "linux/mips64le"}'
image_map: '{"x86_64": "amd64/ubuntu:18.04", "i386": "i386/ubuntu:18.04", "aarch64": "arm64v8/ubuntu:18.04", "arm": "arm32v7/debian:bullseye", "riscv64": "riscv64/debian:sid", "loongarch64": "loongarch64/debian:sid", "s390x": "s390x/debian:bullseye", "powerpc64le": "ppc64le/ubuntu:18.04", "mips64el": "mips64le/debian:bullseye"}}'
platform_map: '{"x86_64": "linux/amd64", "i386": "linux/386", "aarch64": "linux/arm64/v8", "arm": "linux/arm/v7", "riscv64": "linux/riscv64", "loongarch64": "linux/loong64", "s390x": "linux/s390x", "powerpc64le": "linux/ppc64le", "mips64el": "linux/mips64le"}'
freebsd_release_map: '{"15": "15.0", "14": "14.0", "13": "13.2"}'
solaris_release_map: '{"11": "11.4"}'

Expand All @@ -65,7 +65,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [x86_64, i386, aarch64, arm, riscv64, s390x, loongarch64, mips64el]
arch: [x86_64, i386, aarch64, arm, riscv64, s390x, loongarch64, powerpc64le, mips64el]
distribution: [full, headless]
exclude:
- arch: ${{ !contains(inputs.platforms, 'linux-x86_64') && 'x86_64' || '' }}
Expand All @@ -76,6 +76,7 @@ jobs:
- arch: ${{ !contains(inputs.platforms, 'linux-loongarch64') && 'loongarch64' || '' }}
- arch: ${{ !contains(inputs.platforms, 'linux-s390x') && 's390x' || '' }}
- arch: ${{ !contains(inputs.platforms, 'linux-mips64el') && 'mips64el' || '' }}
- arch: ${{ !contains(inputs.platforms, 'linux-powerpc64le') && 'powerpc64le' || '' }}

steps:
- name: Parse image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_python_on_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run_tests: ${{ inputs.run_tests || false }}
debug: ${{ inputs.debug || false }}
verbose: ${{ inputs.verbose || false }}
platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64"
platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-powerpc64le,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64"
buildsystem_branch: ${{ inputs.buildsystem_branch || 'portable-python' }}

graalpy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: ./.github/workflows/build_python.yml
with:
python_version: ${{ inputs.python_version }}
platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-s390x,linux-loongarch64,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64"
platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-powerpc64le,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64"

publish:
name: Publish CPython ${{ inputs.python_version }}
Expand Down
25 changes: 23 additions & 2 deletions scripts/build_linux_zig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ case "$ARCH" in
sudo apt -y install libc6-s390x-cross
sudo ln -s /usr/s390x-linux-gnu/lib/ld64.so.1 /lib/ld64.so.1
;;
powerpc64le)
sudo apt -y install libc6-ppc64el-cross
sudo ln -s /usr/powerpc64le-linux-gnu/lib/ld64.so.2 /lib64/ld64.so.2
;;
mips64el)
sudo apt -y install libc6-mips64el-cross
sudo ln -s /usr/mips64el-linux-gnuabi64/lib64/ld.so.1 /lib64/ld.so.1
Expand Down Expand Up @@ -111,8 +115,8 @@ else
export CFLAGS="-Wl,--undefined-version ${CFLAGS}"
elif [[ "${ARCH}" == "loongarch64" ]]; then
export ZIG_FLAGS="-target loongarch64-linux-gnu.2.36"
elif [[ "${ARCH}" == "s390x" ]]; then
export ZIG_FLAGS="-target s390x-linux-gnu.2.19"
elif [[ "${ARCH}" == "s390x" || "${ARCH}" == "powerpc64le" ]]; then
export ZIG_FLAGS="-target ${ARCH}-linux-gnu.2.19"
else
export ZIG_FLAGS="-target ${ARCH}-linux-gnu.2.17"
fi
Expand All @@ -125,6 +129,21 @@ fi

cd ${WORKDIR}

if [[ "${ARCH}" == "powerpc64le" ]]; then
# Compile the following manually and bundle them as libzigshim.a
# This is needed because the Zig compiler does not yet support powerpc64le's double double
# floating point format. https://github.com/ziglang/zig/issues/22081
cd ${BUILDDIR}
${CC} -c -o gcc_qadd.o ${WORKDIR}/zigshim/gcc_qadd.c
${CC} -c -o gcc_qmul.o ${WORKDIR}/zigshim/gcc_qmul.c
${CC} -c -o gcc_qsub.o ${WORKDIR}/zigshim/gcc_qsub.c
${CC} -c -o gcc_qdiv.o ${WORKDIR}/zigshim/gcc_qdiv.c
${AR} rcs libzigshim.a gcc_qadd.o gcc_qmul.o gcc_qsub.o gcc_qdiv.o
mkdir -p ${DEPSDIR}/lib
mv libzigshim.a ${DEPSDIR}/lib
export LDFLAGS="${LDFLAGS} -lzigshim"
fi

echo "::endgroup::"
########
# zlib #
Expand Down Expand Up @@ -162,6 +181,8 @@ elif [[ "${ARCH}" == "loongarch64" ]]; then
./Configure linux64-loongarch64 no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR}
elif [[ "${ARCH}" == "s390x" ]]; then
./Configure linux64-s390x no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR}
elif [[ "${ARCH}" == "powerpc64le" ]]; then
./Configure linux-ppc64le no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR}
else
./Configure linux-${ARCH} no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR}
fi
Expand Down
4 changes: 4 additions & 0 deletions scripts/qemu_powerpc64le_interpreter
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# this interpreter shim is used by cmake to run platform
# detection programs
LD_LIBRARY_PATH=/usr/powerpc64le-linux-gnu/lib qemu-ppc64le-static "$@"
Loading

0 comments on commit 54959de

Please sign in to comment.