commit:     295d9880d9cd001ebc35c1e2cb35884ccc0f7f59
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Sat May  1 21:52:51 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Sat May  1 21:52:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=295d9880

net-libs/nodejs: disallow USE=lto with gcc-11+

Runtime errors + a segfault in the test suite.

Bug: https://bugs.gentoo.org/787158
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 net-libs/nodejs/nodejs-12.22.1-r1.ebuild | 10 +++++++++-
 net-libs/nodejs/nodejs-14.16.1-r1.ebuild | 10 +++++++++-
 net-libs/nodejs/nodejs-16.0.0-r1.ebuild  | 10 +++++++++-
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/net-libs/nodejs/nodejs-12.22.1-r1.ebuild 
b/net-libs/nodejs/nodejs-12.22.1-r1.ebuild
index aa8392c1ff2..52bbbaf5862 100644
--- a/net-libs/nodejs/nodejs-12.22.1-r1.ebuild
+++ b/net-libs/nodejs/nodejs-12.22.1-r1.ebuild
@@ -59,7 +59,15 @@ pkg_pretend() {
 
        if [[ ${MERGE_TYPE} != "binary" ]]; then
                if use lto; then
-                       tc-is-gcc || die "${PN} only supports LTO for gcc"
+                       if tc-is-gcc; then
+                               if [[ $(gcc-major-version) -ge 11 ]]; then
+                                       # Bug #787158
+                                       die "LTO builds of ${PN} using gcc-11+ 
currently fail tests and produce runtime errors. Either switch to gcc-10 or 
unset USE=lto for this ebuild"
+                               fi
+                       else
+                               # configure.py will abort on this later if we 
do not
+                               die "${PN} only supports LTO for gcc"
+                       fi
                fi
        fi
 }

diff --git a/net-libs/nodejs/nodejs-14.16.1-r1.ebuild 
b/net-libs/nodejs/nodejs-14.16.1-r1.ebuild
index 02e8c08318b..0cc7ac183ee 100644
--- a/net-libs/nodejs/nodejs-14.16.1-r1.ebuild
+++ b/net-libs/nodejs/nodejs-14.16.1-r1.ebuild
@@ -54,7 +54,15 @@ pkg_pretend() {
 
        if [[ ${MERGE_TYPE} != "binary" ]]; then
                if use lto; then
-                       tc-is-gcc || die "${PN} only supports LTO for gcc"
+                       if tc-is-gcc; then
+                               if [[ $(gcc-major-version) -ge 11 ]]; then
+                                       # Bug #787158
+                                       die "LTO builds of ${PN} using gcc-11+ 
currently fail tests and produce runtime errors. Either switch to gcc-10 or 
unset USE=lto for this ebuild"
+                               fi
+                       else
+                               # configure.py will abort on this later if we 
do not
+                               die "${PN} only supports LTO for gcc"
+                       fi
                fi
        fi
 }

diff --git a/net-libs/nodejs/nodejs-16.0.0-r1.ebuild 
b/net-libs/nodejs/nodejs-16.0.0-r1.ebuild
index e9e14a67345..e9b170f229d 100644
--- a/net-libs/nodejs/nodejs-16.0.0-r1.ebuild
+++ b/net-libs/nodejs/nodejs-16.0.0-r1.ebuild
@@ -53,7 +53,15 @@ pkg_pretend() {
 
        if [[ ${MERGE_TYPE} != "binary" ]]; then
                if use lto; then
-                       tc-is-gcc || die "${PN} only supports LTO for gcc"
+                       if tc-is-gcc; then
+                               if [[ $(gcc-major-version) -ge 11 ]]; then
+                                       # Bug #787158
+                                       die "LTO builds of ${PN} using gcc-11+ 
currently fail tests and produce runtime errors. Either switch to gcc-10 or 
unset USE=lto for this ebuild"
+                               fi
+                       else
+                               # configure.py will abort on this later if we 
do not
+                               die "${PN} only supports LTO for gcc"
+                       fi
                fi
        fi
 }

Reply via email to