Skip to content

Enable LTO and PGO for native Linux AArch64 builds on Python 3.10-3.12 #903

Description

@113xiaoji

Summary

Linux AArch64 release builds on the Python 3.10, 3.11, and 3.12
maintenance branches still set _OPTIMIZED=no, disabling the existing
LTO and PGO build path.

That override was introduced in 2019 because optimized builds took too
long in emulated CI. These branches now run their Linux AArch64 jobs on
native ubuntu-24.04-arm runners with AArch64 container images.

Current state

Branch Linux AArch64 release result
3.10 LTO disabled, PGO disabled
3.11 LTO disabled, PGO disabled
3.12 LTO disabled, PGO disabled

The optimized block already present in each branch enables LTO and, when
the build is not cross-compiling, adds --enable-optimizations, runs
profile-opt, and uses PROFILE_TASK="-m test --pgo".

Proposal

Remove only the linux-aarch64 _OPTIMIZED=no override from the 3.10,
3.11, and 3.12 maintenance branches and bump each recipe build number.
Keep the PPC64LE override unchanged because that target is still mapped
to an x86_64 build platform.

This reuses each branch's existing optimization path:

  • 3.10 and 3.11: existing --with-lto plus PGO
  • 3.12: existing --with-lto=full plus PGO

Evidence

Validation

I will open one draft PR per maintenance branch. Native Linux AArch64
GitHub Actions jobs will be used to validate the PGO training and optimized
rebuild. The PRs will be linked here after creation.

Known compatibility concern

Native AArch64 Python rebuilds are currently associated with the downstream
cross-AArch64 C++ extension linking regression tracked in #880. This proposal
does not change the affected sysconfig/linker behavior; the optimization PRs
will remain drafts so that this rebuild risk can be assessed explicitly.

Pull requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions