Skip to content

Add ppc64le power9, power10, and power11 optimized build targets - #1220

Open
veenious wants to merge 1 commit into
astral-sh:mainfrom
veenious:ppc64le-power9-power10-power11
Open

Add ppc64le power9, power10, and power11 optimized build targets#1220
veenious wants to merge 1 commit into
astral-sh:mainfrom
veenious:ppc64le-power9-power10-power11

Conversation

@veenious

@veenious veenious commented Aug 18, 2026

Copy link
Copy Markdown

Adds three new ppc64le architecture variant targets, mirroring the existing
x86_64_v2/v3/v4 pattern:

  • ppc64le_power9-unknown-linux-gnu — compiled with -mcpu=power9 -mtune=power9
  • ppc64le_power10-unknown-linux-gnu — compiled with -mcpu=power10 -mtune=power10
  • ppc64le_power11-unknown-linux-gnu — compiled with -mcpu=power11 -mtune=power11

The existing generic ppc64le-unknown-linux-gnu artifact is untouched.

Power9 support is based on Christy Norman's work (clnperez#1).
Power10 uses Debian Bookworm's GCC 12. Power11 uses GCC 14 from Debian Trixie because
GCC 12 does not support -mcpu=power11.

Note: ppc64le_power10 and ppc64le_power11 require glibc ≥ 2.36 at runtime
(enforced in validation.rs). This is a consequence of using Debian Bookworm as the
build base. The existing ppc64le-unknown-linux-gnu and ppc64le_power9 targets
retain glibc 2.17 compatibility.

Closes #1215

@jjhelmus

Copy link
Copy Markdown
Contributor

As mentioned in #1215 before considering adding these targets I would like to see benchmarks which should that there is a benefit to building this microarchitecture specific distributions.

Additional the change to bookworm likely raises the minimum glibc version required to consume these distributions from 2.24 (Debian 9 Stretch) to 2.36 (Debian 12 Bookworm).

A better approach that is more maintainable in the long term to to use the LLVM toolchain to cross-compile these targets using a sysroot. This was mentioned in #1215.

Comment thread src/validation.rs
@veenious
veenious marked this pull request as draft August 27, 2026 13:48
@veenious
veenious marked this pull request as draft August 27, 2026 13:48
@veenious

veenious commented Sep 4, 2026

Copy link
Copy Markdown
Author

Validation update (UBI 10):

I built CPython 3.13.15 artifacts for the POWER9, POWER10, and POWER11 targets and tested each artifact on matching ppc64le hardware using registry.access.redhat.com/ubi10/ubi (glibc 2.39).

All three passed:

  • python --version reported 3.13.15
  • imports: ssl, sqlite3, zlib, json, math, hashlib, and ctypes
  • bundled pip (26.2.1)

The artifacts require glibc >= 2.36 and therefore were tested in UBI 10

@veenious
veenious marked this pull request as ready for review September 4, 2026 08:56
@veenious
veenious marked this pull request as draft September 4, 2026 09:07
@veenious
veenious force-pushed the ppc64le-power9-power10-power11 branch from ec991c1 to a61a7be Compare September 7, 2026 09:39
Adds three new ppc64le architecture variant targets, mirroring the
existing x86_64_v2/v3/v4 pattern:

- ppc64le_power9-unknown-linux-gnu  — compiled with -mcpu=power9 -mtune=power9
- ppc64le_power10-unknown-linux-gnu — compiled with -mcpu=power10 -mtune=power10
- ppc64le_power11-unknown-linux-gnu — compiled with -mcpu=power11 -mtune=power11

The existing generic ppc64le-unknown-linux-gnu artifact is untouched.

Changes:
- ci-targets.yaml: add all three power variant CI targets
- cpython-unix/targets.yml: add build definitions with correct compiler
  paths; power9 reuses build.cross.Dockerfile (Debian Stretch + GCC 6),
  power10 uses new Bookworm + GCC 12 image, power11 uses new
  Bookworm + GCC 14 from Trixie image (GCC 12 does not support -mcpu=power11)
- cpython-unix/build.cross.Dockerfile: switch apt sources to
  archive.debian.org over HTTPS (port 80 blocked in build containers)
- cpython-unix/build.cross-ppc64le_power10.Dockerfile: new image
- cpython-unix/build.cross-ppc64le_power11.Dockerfile: new image
- cpython-unix/build.py: strip ppc64le_powerN- variant prefix in triple
  normalization, matching the x86_64_vN pattern
- pythonbuild/downloads.json: fix x.org and sourceforge download URLs
  that were unreachable (redirect to blocked port 80)
- src/release.rs: register all three triples in RELEASE_TRIPLES
- src/validation.rs: add RECOGNIZED_TRIPLES, GLIBC_MAX_VERSION,
  ELF_ALLOWED_LIBRARIES, PLATFORM_TAG, and ELF machine entries

Power9 support is based on Christy Norman's work (clnperez/ppc64le-currency).
Power11 requires GCC 14 because GCC 12 does not support -mcpu=power11.

Tested by cross-compiling on x86 and running on physical POWER9, POWER10,
and POWER11 hardware (RHEL 9.8, glibc 2.34, UBI 10 container glibc 2.39).

Closes astral-sh#1215
@veenious
veenious force-pushed the ppc64le-power9-power10-power11 branch from a61a7be to cbcc593 Compare September 8, 2026 06:37
@veenious

veenious commented Sep 8, 2026

Copy link
Copy Markdown
Author

Hardware test results — Python 3.13.15 on real P9/P10/P11 hardware

All three binaries were cross-compiled from x86 (commit cbcc593) and tested inside
registry.access.redhat.com/ubi10/ubi (glibc 2.39) containers on RHEL 9.8 hosts.

Environment

Machine CPU Kernel Host glibc
P9 POWER9 (architected), altivec supported 5.14.0-687.38.1.el9_8.ppc64le 2.34
P10 POWER10 (architected), altivec supported 5.14.0-687.38.1.el9_8.ppc64le 2.34
P11 Power11 (architected), altivec supported 5.14.0-687.12.1.el9_8.ppc64le 2.34

Smoke tests (all passed)

All three binaries passed: Python version check, ssl, sqlite3, zlib, json,
math, hashlib, ctypes imports, and pip invocation.

Performance — Pi to 10,000 decimal digits

Binary Time vs Power9
ppc64le_power9-unknown-linux-gnu 37.4 s baseline
ppc64le_power10-unknown-linux-gnu 31.4 s +16% faster
ppc64le_power11-unknown-linux-gnu 29.7 s +21% faster

glibc requirement

Power9 requires glibc ≥ 2.17 (same as the generic baseline). Power10 and Power11
require glibc ≥ 2.36 due to the Bookworm build base. This is enforced in
validation.rs.

@veenious
veenious marked this pull request as ready for review September 8, 2026 06:55
@veenious
veenious requested a review from jjhelmus September 8, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Additional arch binaries for ppc64le

2 participants