Skip to content

Commit

Permalink
python: enable LTO for CLANG* envs
Browse files Browse the repository at this point in the history
Using toy script from msys2#22917
this reduces the time it takes from 723.7 ms to 670.4 ms on my PC.
  • Loading branch information
mati865 committed Jan 9, 2025
1 parent 3d45e55 commit 88703f2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mingw-w64-python/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}")
fi
pkgver=${_pybasever}.8
pkgrel=1
pkgrel=2
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand Down Expand Up @@ -310,7 +310,7 @@ prepare() {
0119-mingw_smoketests-build-extension-in-a-venv.patch \
0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch \
0121-fixup-CI-test-the-build-and-add-some-mingw-specific-.patch

autoreconf -vfi
}

Expand All @@ -321,7 +321,9 @@ build() {
# Upstream defaults to -O3, so we can do too
CFLAGS+=" -O3"
# FIXME: https://github.com/msys2-contrib/cpython-mingw/issues/10
# _extra_config+=("--with-lto")
if [[ $MINGW_PACKAGE_PREFIX == *-clang-* ]]; then
_extra_config+=("--with-lto")
fi
else
CFLAGS+=" -O0 -ggdb"
CXXFLAGS+=" -O0 -ggdb"
Expand Down

0 comments on commit 88703f2

Please sign in to comment.