From d0e5752cd65c497e312fee74d8dbcc18f13af8d6 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 16 Oct 2023 07:10:36 +0000 Subject: [PATCH] app-shells/bash: Sync with Gentoo It's from Gentoo commit 31d30791ea6ace369259757da891a56ed1267a9c. --- ...2_p15-r5.ebuild => bash-5.2_p15-r7.ebuild} | 26 ++++++++++--------- .../app-shells/bash/bash-9999.ebuild | 25 +++++++++--------- 2 files changed, 27 insertions(+), 24 deletions(-) rename sdk_container/src/third_party/portage-stable/app-shells/bash/{bash-5.2_p15-r5.ebuild => bash-5.2_p15-r7.ebuild} (91%) diff --git a/sdk_container/src/third_party/portage-stable/app-shells/bash/bash-5.2_p15-r5.ebuild b/sdk_container/src/third_party/portage-stable/app-shells/bash/bash-5.2_p15-r7.ebuild similarity index 91% rename from sdk_container/src/third_party/portage-stable/app-shells/bash/bash-5.2_p15-r5.ebuild rename to sdk_container/src/third_party/portage-stable/app-shells/bash/bash-5.2_p15-r7.ebuild index a107c639ef..a80bdd6357 100644 --- a/sdk_container/src/third_party/portage-stable/app-shells/bash/bash-5.2_p15-r5.ebuild +++ b/sdk_container/src/third_party/portage-stable/app-shells/bash/bash-5.2_p15-r7.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 @@ -117,6 +117,7 @@ PATCHES=( "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch "${FILESDIR}"/${PN}-5.2_p15-random-ub.patch "${FILESDIR}"/${PN}-5.2_p15-configure-clang16.patch + "${FILESDIR}"/${PN}-5.2_p15-shell-parser-reset-issue.patch ) pkg_setup() { @@ -256,14 +257,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 $(test-flags-CC -fprofile-partial-training)") + 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 @@ -271,13 +278,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 } diff --git a/sdk_container/src/third_party/portage-stable/app-shells/bash/bash-9999.ebuild b/sdk_container/src/third_party/portage-stable/app-shells/bash/bash-9999.ebuild index eeff3e0b30..6e86e0d185 100644 --- a/sdk_container/src/third_party/portage-stable/app-shells/bash/bash-9999.ebuild +++ b/sdk_container/src/third_party/portage-stable/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 $(test-flags-CC -fprofile-partial-training)") + 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 }