Skip to content

Commit 88703f2

Browse files
committed
python: enable LTO for CLANG* envs
Using toy script from msys2#22917 this reduces the time it takes from 723.7 ms to 670.4 ms on my PC.
1 parent 3d45e55 commit 88703f2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mingw-w64-python/PKGBUILD

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ else
2323
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}")
2424
fi
2525
pkgver=${_pybasever}.8
26-
pkgrel=1
26+
pkgrel=2
2727
pkgdesc="A high-level scripting language (mingw-w64)"
2828
arch=('any')
2929
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
@@ -310,7 +310,7 @@ prepare() {
310310
0119-mingw_smoketests-build-extension-in-a-venv.patch \
311311
0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch \
312312
0121-fixup-CI-test-the-build-and-add-some-mingw-specific-.patch
313-
313+
314314
autoreconf -vfi
315315
}
316316

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

0 commit comments

Comments
 (0)