commit:     bc56495544b69df93fd54ea44c5f03841bae027f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 28 22:07:15 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 28 22:07:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc564955

sys-devel/binutils: really fix PGO for cross (disable it)

Closes: https://bugs.gentoo.org/832174
Fixes: 57737c9f2a9ce3e1b2492760e98932b7b9f9eea2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/binutils/binutils-2.37_p1-r2.ebuild | 11 +++++++++--
 sys-devel/binutils/binutils-9999.ebuild       | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/sys-devel/binutils/binutils-2.37_p1-r2.ebuild 
b/sys-devel/binutils/binutils-2.37_p1-r2.ebuild
index bea3128e217f..5a182867fab3 100644
--- a/sys-devel/binutils/binutils-2.37_p1-r2.ebuild
+++ b/sys-devel/binutils/binutils-2.37_p1-r2.ebuild
@@ -272,10 +272,17 @@ src_configure() {
                # Ideally we would like automagic-or-disabled here.
                # But the check does not quite work on i686: bug #760926.
                $(use_enable cet)
-
-               $(use_enable pgo pgo-build lto)
        )
 
+       if ! is_cross ; then
+               myconf+=( $(use_enable pgo pgo-build lto) )
+
+               if use pgo ; then
+                       export BUILD_CFLAGS="${CFLAGS}"
+               fi
+       fi
+
+
        if use pgo && ! is_cross ; then
                export BUILD_CFLAGS="${CFLAGS}"
        fi

diff --git a/sys-devel/binutils/binutils-9999.ebuild 
b/sys-devel/binutils/binutils-9999.ebuild
index b7af0845fd0a..3fdfdf479f26 100644
--- a/sys-devel/binutils/binutils-9999.ebuild
+++ b/sys-devel/binutils/binutils-9999.ebuild
@@ -273,10 +273,17 @@ src_configure() {
                # Ideally we would like automagic-or-disabled here.
                # But the check does not quite work on i686: bug #760926.
                $(use_enable cet)
-
-               $(use_enable pgo pgo-build lto)
        )
 
+       if ! is_cross ; then
+               myconf+=( $(use_enable pgo pgo-build lto) )
+
+               if use pgo ; then
+                       export BUILD_CFLAGS="${CFLAGS}"
+               fi
+       fi
+
+
        if use pgo && ! is_cross ; then
                export BUILD_CFLAGS="${CFLAGS}"
        fi

Reply via email to