diff --git a/metadata.xml b/metadata.xml index 98fa548..6f87742 100644 --- a/metadata.xml +++ b/metadata.xml @@ -7,6 +7,8 @@ Build Bluetooth protocol support in socket module + Build with link-time optimizations. + Add support for profile-guided optimizations. Enable threading support. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING) Enable wide Unicode implementation which uses 4-byte Unicode characters. Switching of this USE flag changes ABI of Python and requires reinstallation of many Python modules. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING) Install Windows executables required to create an executable installer for MS Windows. diff --git a/python-3.7.7-r2.ebuild b/python-3.7.7-r2.ebuild index ce301b6..4cafd17 100644 --- a/python-3.7.7-r2.ebuild +++ b/python-3.7.7-r2.ebuild @@ -19,7 +19,7 @@ S="${WORKDIR}/${MY_P}" LICENSE="PSF-2" SLOT="${PYVER}/${PYVER}m" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl lto +ncurses pgo +readline sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" # Do not add a dependency on dev-lang/python to this ebuild. @@ -144,7 +144,11 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + $(use_wth lto) ) + if use pgo; then + myeconfarg+=("--enable-optimizations") + fi OPT="" econf "${myeconfargs[@]}" } @@ -154,7 +158,11 @@ src_compile() { # https://bugs.gentoo.org/594768 local -x LC_ALL=C - emake CPPFLAGS= CFLAGS= LDFLAGS= + if use pgo; then + emake profile-opt PROFILE_TASK="-m test.regrtest --pgo -uall,-audio -x test_gdb test_multiprocessing test_subprocess test_tokenize test_signal test_faulthandler test_sundry test_curses test_distutils test_imaplib test_import test_asyncio test_compileall test_pyexpat test_runpy test_support test_threaded_import test_xmlrpc_net test___all__ test_argparse test_asyncore test_contextlib_async test_devpoll test_httplib test_kqueue test_msilib test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_main_handling test_multiprocessing_spawn test_nis test_nntplib test_normalization test_ntpath test_os test_ossaudiodev test_robotparser test_shutil test_site test_smtpnet test_socket test_ssl test_startfile test_timeout test_tix test_tk test_tools test_ttk_guionly test_ttk_textonly test_urllib2 test_urllib2net test_urllibnet test_winconsoleio test_winreg test_winsound test_zipfile64 test_zipimport" + else + emake CPPFLAGS= CFLAGS= LDFLAGS= + fi # Work around bug 329499. See also bug 413751 and 457194. if has_version dev-libs/libffi[pax_kernel]; then diff --git a/python-3.8.3.ebuild b/python-3.8.3.ebuild index c1cb51a..3d57cf3 100644 --- a/python-3.8.3.ebuild +++ b/python-3.8.3.ebuild @@ -19,7 +19,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 ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl lto +ncurses pgo +readline sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" # Do not add a dependency on dev-lang/python to this ebuild. @@ -111,11 +111,6 @@ src_configure() { use hardened && replace-flags -O3 -O2 fi - # https://bugs.gentoo.org/700012 - if is-flagq -flto || is-flagq '-flto=*'; then - append-cflags $(test-flags-CC -ffat-lto-objects) - fi - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. tc-export CXX @@ -149,8 +144,11 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + $(use_with lto) ) - + if use pgo; then + myeconfarg+=("enable-optimizations") + fi OPT="" econf "${myeconfargs[@]}" } @@ -159,8 +157,11 @@ src_compile() { # https://bugs.gentoo.org/594768 local -x LC_ALL=C - emake CPPFLAGS= CFLAGS= LDFLAGS= - + if use pgo; then + emake profile-opt PROFILE_TASK="-m test.regrtest --pgo -uall,-audio -x test_gdb test_multiprocessing test_subprocess test_tokenize test_signal test_faulthandler test_sundry test_curses test_distutils test_imaplib test_import test_asyncio test_compileall test_pyexpat test_runpy test_support test_threaded_import test_xmlrpc_net test___all__ test_argparse test_asyncore test_contextlib_async test_devpoll test_httplib test_kqueue test_msilib test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_main_handling test_multiprocessing_spawn test_nis test_nntplib test_normalization test_ntpath test_os test_ossaudiodev test_robotparser test_shutil test_site test_smtpnet test_socket test_ssl test_startfile test_timeout test_tix test_tk test_tools test_ttk_guionly test_ttk_textonly test_urllib2 test_urllib2net test_urllibnet test_winconsoleio test_winreg test_winsound test_zipfile64 test_zipimport" + else + emake CPPFLAGS= CFLAGS= LDFLAGS= + fi # Work around bug 329499. See also bug 413751 and 457194. if has_version dev-libs/libffi[pax_kernel]; then pax-mark E python diff --git a/python-3.9.0_beta1.ebuild b/python-3.9.0_beta1.ebuild index b1c8280..ec1f6c9 100644 --- a/python-3.9.0_beta1.ebuild +++ b/python-3.9.0_beta1.ebuild @@ -20,7 +20,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 ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl lto +ncurses pgo +readline sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" # Do not add a dependency on dev-lang/python to this ebuild. @@ -123,11 +123,6 @@ src_configure() { use hardened && replace-flags -O3 -O2 fi - # https://bugs.gentoo.org/700012 - if is-flagq -flto || is-flagq '-flto=*'; then - append-cflags $(test-flags-CC -ffat-lto-objects) - fi - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. tc-export CXX @@ -161,7 +156,11 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + $(use_with lto) ) + if use pgo; then + myeconfarg+=("--enable-optimizations") + fi OPT="" econf "${myeconfargs[@]}" } @@ -170,9 +169,12 @@ src_compile() { # Ensure sed works as expected # https://bugs.gentoo.org/594768 local -x LC_ALL=C - - emake CPPFLAGS= CFLAGS= LDFLAGS= - + + if use pgo; then + emake profile-opt PROFILE_TASK="-m test.regrtest --pgo -uall,-audio -x test_gdb test_multiprocessing test_subprocess test_tokenize test_signal test_faulthandler test_sundry test_curses test_distutils test_imaplib test_import test_asyncio test_compileall test_pyexpat test_runpy test_support test_threaded_import test_xmlrpc_net test___all__ test_argparse test_asyncore test_contextlib_async test_devpoll test_httplib test_kqueue test_msilib test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_main_handling test_multiprocessing_spawn test_nis test_nntplib test_normalization test_ntpath test_os test_ossaudiodev test_robotparser test_shutil test_site test_smtpnet test_socket test_ssl test_startfile test_timeout test_tix test_tk test_tools test_ttk_guionly test_ttk_textonly test_unicodedata test_urllib2 test_urllib2net test_urllibnet test_winconsoleio test_winreg test_winsound test_zipfile64 test_zipimport" + else + emake CPPFLAGS= CFLAGS= LDFLAGS= + fi # Work around bug 329499. See also bug 413751 and 457194. if has_version dev-libs/libffi[pax_kernel]; then pax-mark E python