commit:     ff65f5c822417e8347598fcb75a1e575ba35bf58
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 28 22:40:54 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 28 22:40:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff65f5c8

dev-lang/python: avoid confused LTO configure test w/ cross CBUILD Python

No real need to take care here as it gets thrown away, so just bang in
-fno-lto.

Bug: https://bugs.gentoo.org/700012
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/python/python-3.10.13.ebuild         | 8 ++++++--
 dev-lang/python/python-3.11.5.ebuild          | 8 ++++++--
 dev-lang/python/python-3.12.0_beta4_p2.ebuild | 8 ++++++--
 dev-lang/python/python-3.12.0_rc1_p5.ebuild   | 8 ++++++--
 dev-lang/python/python-3.12.0_rc1_p6.ebuild   | 8 ++++++--
 dev-lang/python/python-3.8.18.ebuild          | 8 ++++++--
 dev-lang/python/python-3.9.18.ebuild          | 8 ++++++--
 7 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/dev-lang/python/python-3.10.13.ebuild 
b/dev-lang/python/python-3.10.13.ebuild
index 41648fc12055..e4e3da709eef 100644
--- a/dev-lang/python/python-3.10.13.ebuild
+++ b/dev-lang/python/python-3.10.13.ebuild
@@ -248,9 +248,13 @@ src_configure() {
 
                # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
                # propagated to sysconfig for built extensions
-               local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
-               local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+               #
+               # -fno-lto to avoid bug #700012 (not like it matters for 
mini-CBUILD Python anyway)
+               local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
+               local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
                local -x CFLAGS= LDFLAGS=
+               local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
+               local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
 
                # We need to build our own Python on CBUILD first, and feed it 
in.
                # bug #847910 and bug #864911.

diff --git a/dev-lang/python/python-3.11.5.ebuild 
b/dev-lang/python/python-3.11.5.ebuild
index 6ebc482a9a54..db78c59ef0d7 100644
--- a/dev-lang/python/python-3.11.5.ebuild
+++ b/dev-lang/python/python-3.11.5.ebuild
@@ -237,9 +237,13 @@ src_configure() {
 
                # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
                # propagated to sysconfig for built extensions
-               local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
-               local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+               #
+               # -fno-lto to avoid bug #700012 (not like it matters for 
mini-CBUILD Python anyway)
+               local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
+               local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
                local -x CFLAGS= LDFLAGS=
+               local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
+               local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
 
                # We need to build our own Python on CBUILD first, and feed it 
in.
                # bug #847910

diff --git a/dev-lang/python/python-3.12.0_beta4_p2.ebuild 
b/dev-lang/python/python-3.12.0_beta4_p2.ebuild
index 8c769c87e1b7..bef6d96d3fff 100644
--- a/dev-lang/python/python-3.12.0_beta4_p2.ebuild
+++ b/dev-lang/python/python-3.12.0_beta4_p2.ebuild
@@ -236,9 +236,13 @@ src_configure() {
 
                # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
                # propagated to sysconfig for built extensions
-               local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
-               local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+               #
+               # -fno-lto to avoid bug #700012 (not like it matters for 
mini-CBUILD Python anyway)
+               local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
+               local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
                local -x CFLAGS= LDFLAGS=
+               local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
+               local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
 
                # We need to build our own Python on CBUILD first, and feed it 
in.
                # bug #847910

diff --git a/dev-lang/python/python-3.12.0_rc1_p5.ebuild 
b/dev-lang/python/python-3.12.0_rc1_p5.ebuild
index d3a193505529..417ddacff0f8 100644
--- a/dev-lang/python/python-3.12.0_rc1_p5.ebuild
+++ b/dev-lang/python/python-3.12.0_rc1_p5.ebuild
@@ -236,9 +236,13 @@ src_configure() {
 
                # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
                # propagated to sysconfig for built extensions
-               local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
-               local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+               #
+               # -fno-lto to avoid bug #700012 (not like it matters for 
mini-CBUILD Python anyway)
+               local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
+               local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
                local -x CFLAGS= LDFLAGS=
+               local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
+               local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
 
                # We need to build our own Python on CBUILD first, and feed it 
in.
                # bug #847910

diff --git a/dev-lang/python/python-3.12.0_rc1_p6.ebuild 
b/dev-lang/python/python-3.12.0_rc1_p6.ebuild
index d3a193505529..417ddacff0f8 100644
--- a/dev-lang/python/python-3.12.0_rc1_p6.ebuild
+++ b/dev-lang/python/python-3.12.0_rc1_p6.ebuild
@@ -236,9 +236,13 @@ src_configure() {
 
                # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
                # propagated to sysconfig for built extensions
-               local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
-               local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+               #
+               # -fno-lto to avoid bug #700012 (not like it matters for 
mini-CBUILD Python anyway)
+               local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
+               local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
                local -x CFLAGS= LDFLAGS=
+               local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
+               local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
 
                # We need to build our own Python on CBUILD first, and feed it 
in.
                # bug #847910

diff --git a/dev-lang/python/python-3.8.18.ebuild 
b/dev-lang/python/python-3.8.18.ebuild
index 7be0059133b5..3c3725d1cf2a 100644
--- a/dev-lang/python/python-3.8.18.ebuild
+++ b/dev-lang/python/python-3.8.18.ebuild
@@ -195,9 +195,13 @@ src_configure() {
 
                # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
                # propagated to sysconfig for built extensions
-               local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
-               local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+               #
+               # -fno-lto to avoid bug #700012 (not like it matters for 
mini-CBUILD Python anyway)
+               local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
+               local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
                local -x CFLAGS= LDFLAGS=
+               local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
+               local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
 
                # We need to build our own Python on CBUILD first, and feed it 
in.
                # bug #847910 and bug #864911.

diff --git a/dev-lang/python/python-3.9.18.ebuild 
b/dev-lang/python/python-3.9.18.ebuild
index ef4bf0a3c3fd..5df9769c3928 100644
--- a/dev-lang/python/python-3.9.18.ebuild
+++ b/dev-lang/python/python-3.9.18.ebuild
@@ -237,9 +237,13 @@ src_configure() {
 
                # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
                # propagated to sysconfig for built extensions
-               local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
-               local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+               #
+               # -fno-lto to avoid bug #700012 (not like it matters for 
mini-CBUILD Python anyway)
+               local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
+               local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
                local -x CFLAGS= LDFLAGS=
+               local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
+               local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
 
                # We need to build our own Python on CBUILD first, and feed it 
in.
                # bug #847910 and bug #864911.

Reply via email to