Skip to content

Commit

Permalink
Enable full LTO on Python 3.12 and 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Feb 13, 2025
1 parent aa430e2 commit 61fcdd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ if [ -n "${CPYTHON_OPTIMIZED}" ]; then
fi

if [ -n "${CPYTHON_LTO}" ]; then
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-lto"
# On Python 3.12 and 3.13, `--with-lto` enables thinLTO by default, while on other versions it
# enables full LTO. We prefer runtime performance over build time, so force full on all versions.
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-lto=full"
fi

# Python 3.11 introduces a --with-build-python to denote the host Python.
Expand Down

0 comments on commit 61fcdd7

Please sign in to comment.