mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-24 11:37:20 -08:00
dev-lang/python: add PGO
Closes: https://bugs.gentoo.org/615412 Closes: https://github.com/gentoo/gentoo/pull/20077 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="bluetooth">Build Bluetooth protocol support in socket module</flag>
|
||||
<flag name="pgo">Optimize the build using Profile Guided Optimization (PGO)</flag>
|
||||
<flag name="wininst">Install Windows executables required to create an executable installer for MS Windows.</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
|
||||
@@ -25,7 +25,7 @@ S="${WORKDIR}/${MY_P}"
|
||||
LICENSE="PSF-2"
|
||||
SLOT="${PYVER}"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||
IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
|
||||
IUSE="bluetooth build examples gdbm hardened +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
# Do not add a dependency on dev-lang/python to this ebuild.
|
||||
@@ -161,6 +161,11 @@ src_configure() {
|
||||
dbmliborder+="${dbmliborder:+:}gdbm"
|
||||
fi
|
||||
|
||||
if use pgo; then
|
||||
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
|
||||
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb"
|
||||
fi
|
||||
|
||||
local myeconfargs=(
|
||||
# glibc-2.30 removes it; since we can't cleanly force-rebuild
|
||||
# Python on glibc upgrade, remove it proactively to give
|
||||
@@ -179,6 +184,8 @@ src_configure() {
|
||||
--without-ensurepip
|
||||
--with-system-expat
|
||||
--with-system-ffi
|
||||
|
||||
$(use_enable pgo optimizations)
|
||||
)
|
||||
|
||||
OPT="" econf "${myeconfargs[@]}"
|
||||
@@ -198,6 +205,14 @@ src_compile() {
|
||||
# https://bugs.gentoo.org/823728
|
||||
export SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
|
||||
if use pgo ; then
|
||||
# bug 660358
|
||||
local -x COLUMNS=80
|
||||
local -x PYTHONDONTWRITEBYTECODE=
|
||||
|
||||
addpredict /usr/lib/python3.11/site-packages
|
||||
fi
|
||||
|
||||
emake CPPFLAGS= CFLAGS= LDFLAGS=
|
||||
|
||||
# Work around bug 329499. See also bug 413751 and 457194.
|
||||
|
||||
Reference in New Issue
Block a user