diff options
| author | Sam James <sam@gentoo.org> | 2023-10-12 13:01:54 +0100 |
|---|---|---|
| committer | Sam James <sam@gentoo.org> | 2023-10-12 13:05:00 +0100 |
| commit | 1d98516e65fb3dc0f1e0effc851216e1b827b9d4 (patch) | |
| tree | d048edfbcb8969aab43b632931db9118d16d5735 /app-shells/bash/bash-9999.ebuild | |
| parent | c2846b5abad0679a5e800c48999a78f4bc475648 (diff) | |
| download | gentoo-1d98516e65fb3dc0f1e0effc851216e1b827b9d4.tar.gz gentoo-1d98516e65fb3dc0f1e0effc851216e1b827b9d4.tar.bz2 gentoo-1d98516e65fb3dc0f1e0effc851216e1b827b9d4.zip | |
app-shells/bash: cleanup USE=pgo logic a bit, use -fprofile-partial-training if available
-fprofile-partial-training helps not to pessimise other paths if no data
is available.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-shells/bash/bash-9999.ebuild')
| -rw-r--r-- | app-shells/bash/bash-9999.ebuild | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/app-shells/bash/bash-9999.ebuild b/app-shells/bash/bash-9999.ebuild index eeff3e0b3023..e2a0d09d841b 100644 --- a/app-shells/bash/bash-9999.ebuild +++ b/app-shells/bash/bash-9999.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc inherit flag-o-matic toolchain-funcs prefix verify-sig @@ -254,14 +254,20 @@ src_configure() { } src_compile() { - if use pgo ; then - # Build Bash and run its tests to generate profiles. - emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" + # -fprofile-partial-training because upstream note the test suite isn't super comprehensive + # See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo + local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/pgo -fprofile-generate=${T}/pgo $(test-flags-CC -fprofile-partial-training)") + local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo") + + emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" + use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags}" all others + # Build Bash and run its tests to generate profiles. + if use pgo ; then # Used in test suite. unset A - emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check + emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check if tc-is-clang; then llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die @@ -269,13 +275,8 @@ src_compile() { # Rebuild Bash using the profiling data we just generated. emake clean - emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" - - use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others - else - emake - - use plugins && emake -C examples/loadables all others + emake CFLAGS="${CFLAGS} ${pgo_use_flags}" + use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags}" all others fi } |
