Skip to content
Draft
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
65 changes: 65 additions & 0 deletions ci-targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,71 @@ linux:
- freethreaded+lto
minimum-python-version: "3.13"

ppc64le_power9-unknown-linux-gnu:
arch: ppc64le
arch_variant: power9
libc: gnu
python_versions:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.15"
build_options:
- debug
- noopt
- lto
build_options_conditional:
- options:
- freethreaded+debug
- freethreaded+noopt
- freethreaded+lto
minimum-python-version: "3.13"
ppc64le_power10-unknown-linux-gnu:
arch: ppc64le
arch_variant: power10
libc: gnu
python_versions:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.15"
build_options:
- debug
- noopt
- lto
build_options_conditional:
- options:
- freethreaded+debug
- freethreaded+noopt
- freethreaded+lto
minimum-python-version: "3.13"

ppc64le_power11-unknown-linux-gnu:
arch: ppc64le
arch_variant: power11
libc: gnu
python_versions:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.15"
build_options:
- debug
- noopt
- lto
build_options_conditional:
- options:
- freethreaded+debug
- freethreaded+noopt
- freethreaded+lto
minimum-python-version: "3.13"

riscv64-unknown-linux-gnu:
arch: riscv64
libc: gnu
Expand Down
55 changes: 55 additions & 0 deletions cpython-unix/build.cross-ppc64le_power10.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Debian Bookworm (ships GCC 12, which supports -mcpu=power10).
FROM debian@sha256:6bc30d909583f38600edd6609e29eb3fb284ab8affce8d0389f332fc91c2dd91
LABEL org.opencontainers.image.authors="Gregory Szorc <gregory.szorc@gmail.com>"

RUN groupadd -g 1000 build && \
useradd -u 1000 -g 1000 -d /build -s /bin/bash -m build && \
mkdir /tools && \
chown -R build:build /build /tools

ENV HOME=/build \
SHELL=/bin/bash \
USER=build \
LOGNAME=build \
HOSTNAME=builder \
DEBIAN_FRONTEND=noninteractive

CMD ["/bin/bash", "--login"]
WORKDIR '/build'

RUN for s in debian_bookworm debian_bookworm-updates debian-security_bookworm-security/updates; do \
echo "deb http://snapshot.debian.org/archive/${s%_*}/20250601T000000Z/ ${s#*_} main"; \
done > /etc/apt/sources.list && \
( echo 'quiet "true";'; \
echo 'APT::Get::Assume-Yes "true";'; \
echo 'APT::Install-Recommends "false";'; \
echo 'Acquire::Check-Valid-Until "false";'; \
echo 'Acquire::Retries "5";'; \
) > /etc/apt/apt.conf.d/99cpython-portable && \
rm -f /etc/apt/sources.list.d/*

RUN apt-get update

# Host building.
RUN apt-get install \
bzip2 \
ca-certificates \
gcc \
g++ \
libc6-dev \
libffi-dev \
make \
patch \
perl \
pkg-config \
tar \
xz-utils \
unzip \
zip \
zlib1g-dev

# Cross-building (powerpc64le only — GCC 12 supports -mcpu=power10).
RUN apt-get install \
g++-powerpc64le-linux-gnu \
gcc-powerpc64le-linux-gnu \
libc6-dev-ppc64el-cross
55 changes: 55 additions & 0 deletions cpython-unix/build.cross-ppc64le_power11.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Debian Bookworm (ships GCC 12, which supports -mcpu=power10 and -mcpu=power11).
FROM debian@sha256:6bc30d909583f38600edd6609e29eb3fb284ab8affce8d0389f332fc91c2dd91
LABEL org.opencontainers.image.authors="Gregory Szorc <gregory.szorc@gmail.com>"

RUN groupadd -g 1000 build && \
useradd -u 1000 -g 1000 -d /build -s /bin/bash -m build && \
mkdir /tools && \
chown -R build:build /build /tools

ENV HOME=/build \
SHELL=/bin/bash \
USER=build \
LOGNAME=build \
HOSTNAME=builder \
DEBIAN_FRONTEND=noninteractive

CMD ["/bin/bash", "--login"]
WORKDIR '/build'

RUN for s in debian_bookworm debian_bookworm-updates debian-security_bookworm-security/updates; do \
echo "deb http://snapshot.debian.org/archive/${s%_*}/20250601T000000Z/ ${s#*_} main"; \
done > /etc/apt/sources.list && \
( echo 'quiet "true";'; \
echo 'APT::Get::Assume-Yes "true";'; \
echo 'APT::Install-Recommends "false";'; \
echo 'Acquire::Check-Valid-Until "false";'; \
echo 'Acquire::Retries "5";'; \
) > /etc/apt/apt.conf.d/99cpython-portable && \
rm -f /etc/apt/sources.list.d/*

RUN apt-get update

# Host building.
RUN apt-get install \
bzip2 \
ca-certificates \
gcc \
g++ \
libc6-dev \
libffi-dev \
make \
patch \
perl \
pkg-config \
tar \
xz-utils \
unzip \
zip \
zlib1g-dev

# Cross-building (powerpc64le only — GCC 12 supports -mcpu=power10 and -mcpu=power11).
RUN apt-get install \
g++-powerpc64le-linux-gnu \
gcc-powerpc64le-linux-gnu \
libc6-dev-ppc64el-cross
3 changes: 3 additions & 0 deletions cpython-unix/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ def add_target_env(env, build_platform, target_triple, build_env, build_options)
target_triple.replace("x86_64_v2-", "x86_64-")
.replace("x86_64_v3-", "x86_64-")
.replace("x86_64_v4-", "x86_64-")
.replace("ppc64le_power9-", "ppc64le-")
.replace("ppc64le_power10-", "ppc64le-")
.replace("ppc64le_power11-", "ppc64le-")
)

# On macOS, we support building Linux in a virtualized container that
Expand Down
166 changes: 166 additions & 0 deletions cpython-unix/targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,172 @@ ppc64le-unknown-linux-gnu:
- zstd
openssl_target: linux-ppc64le

ppc64le_power9-unknown-linux-gnu:
linux_uapi_include_arch: powerpc64le-linux-gnu
host_platforms:
- linux_x86_64
pythons_supported:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
- '3.15'
docker_image_suffix: .cross
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
target_cc: /usr/bin/powerpc64le-linux-gnu-gcc
target_cxx: /usr/bin/powerpc64le-linux-gnu-g++
target_cflags:
# Hardening
- '-fstack-protector'
- '-U_FORTIFY_SOURCE'
- '-D_FORTIFY_SOURCE=2'
- '-mcpu=power9'
- '-mtune=power9'
target_ldflags:
# Hardening
- '-Wl,-z,noexecstack'
- '-Wl,-z,relro'
- '-Wl,-z,now'
needs:
- autoconf
- bdb
- binutils
- bzip2
- expat
- libedit
- libffi
- libX11
- libXau
- libxcb
- linux-uapi
- m4
- mpdecimal
- ncurses
- openssl-3.5
- patchelf
- sqlite
- tcl
- tk
- uuid
- xorgproto
- xz
- zlib
- zstd
openssl_target: linux-ppc64le


ppc64le_power10-unknown-linux-gnu:
linux_uapi_include_arch: powerpc64le-linux-gnu
host_platforms:
- linux_x86_64
pythons_supported:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
- '3.15'
docker_image_suffix: .cross-ppc64le_power10
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
target_cc: /usr/bin/powerpc64le-linux-gnu-gcc
target_cxx: /usr/bin/powerpc64le-linux-gnu-g++
target_cflags:
# Hardening
- '-fstack-protector'
- '-U_FORTIFY_SOURCE'
- '-D_FORTIFY_SOURCE=2'
- '-mcpu=power10'
- '-mtune=power10'
target_ldflags:
# Hardening
- '-Wl,-z,noexecstack'
- '-Wl,-z,relro'
- '-Wl,-z,now'
needs:
- autoconf
- bdb
- binutils
- bzip2
- expat
- libedit
- libffi
- libX11
- libXau
- libxcb
- linux-uapi
- m4
- mpdecimal
- ncurses
- openssl-3.5
- patchelf
- sqlite
- tcl
- tk
- uuid
- xorgproto
- xz
- zlib
- zstd
openssl_target: linux-ppc64le

ppc64le_power11-unknown-linux-gnu:
linux_uapi_include_arch: powerpc64le-linux-gnu
host_platforms:
- linux_x86_64
pythons_supported:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
- '3.15'
docker_image_suffix: .cross-ppc64le_power11
host_cc: /usr/bin/x86_64-linux-gnu-gcc
host_cxx: /usr/bin/x86_64-linux-gnu-g++
target_cc: /usr/bin/powerpc64le-linux-gnu-gcc
target_cxx: /usr/bin/powerpc64le-linux-gnu-g++
target_cflags:
# Hardening
- '-fstack-protector'
- '-U_FORTIFY_SOURCE'
- '-D_FORTIFY_SOURCE=2'
- '-mcpu=power11'
- '-mtune=power11'
target_ldflags:
# Hardening
- '-Wl,-z,noexecstack'
- '-Wl,-z,relro'
- '-Wl,-z,now'
needs:
- autoconf
- bdb
- binutils
- bzip2
- expat
- libedit
- libffi
- libX11
- libXau
- libxcb
- linux-uapi
- m4
- mpdecimal
- ncurses
- openssl-3.5
- patchelf
- sqlite
- tcl
- tk
- uuid
- xorgproto
- xz
- zlib
- zstd
openssl_target: linux-ppc64le

riscv64-unknown-linux-gnu:
linux_uapi_include_arch: riscv64-linux-gnu
host_platforms:
Expand Down
8 changes: 8 additions & 0 deletions docs/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ familiar with LLVM target triples, here is an overview:
``i686-unknown-linux-*``
Linux 32-bit Intel/AMD CPUs.

``ppc64le-unknown-linux-gnu``
Linux on 64-bit little-endian PowerPC (ELFv2 ABI baseline).

``ppc64le_power9-unknown-linux-gnu``
Linux on 64-bit little-endian PowerPC optimized for POWER9.

Compiled with ``-mcpu=power9 -mtune=power9``.

``x86_64_v2-*``
Targets 64-bit Intel/AMD CPUs approximately newer than
`Nehalem <https://en.wikipedia.org/wiki/Nehalem_(microarchitecture)>`_
Expand Down
Loading
Loading