commit:     893fc8602102e9732a5c50e0dcffe13e4b6ef6ad
Author:     Sasha Finkelstein <fnkl.kernel <AT> gmail <DOT> com>
AuthorDate: Wed Jul 24 18:31:43 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 24 19:08:35 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=893fc860

net-libs/nodejs: Adjust CFLAGS to prevent miscompilations.

With -ftree-vectorize (enabled by default with -O2) GCC miscompiles
node's exception handling code, causing it to fail to catch exceptions
sometimes. Disable it.

This bug also causes build fails for www-client/firefox.

Upstream bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116057

[sam: Revbump to propagate the fixed binary.]

Closes: https://bugs.gentoo.org/936013
Signed-off-by: Sasha Finkelstein <fnkl.kernel <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/37651
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-libs/nodejs/{nodejs-22.4.1.ebuild => nodejs-22.4.1-r1.ebuild} | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net-libs/nodejs/nodejs-22.4.1.ebuild 
b/net-libs/nodejs/nodejs-22.4.1-r1.ebuild
similarity index 96%
rename from net-libs/nodejs/nodejs-22.4.1.ebuild
rename to net-libs/nodejs/nodejs-22.4.1-r1.ebuild
index 745f2560bf03..b6c767e67464 100644
--- a/net-libs/nodejs/nodejs-22.4.1.ebuild
+++ b/net-libs/nodejs/nodejs-22.4.1-r1.ebuild
@@ -116,6 +116,10 @@ src_configure() {
 
        # LTO compiler flags are handled by configure.py itself
        filter-lto
+       # GCC with -ftree-vectorize miscompiles node's exception handling code
+       # causing it to fail to catch exceptions sometimes
+       # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116057
+       tc-is-gcc && append-cxxflags -fno-tree-vectorize
        # nodejs unconditionally links to libatomic #869992
        # specifically it requires __atomic_is_lock_free which
        # is not yet implemented by sys-libs/compiler-rt (see
@@ -274,6 +278,6 @@ src_test() {
 pkg_postinst() {
        if use npm; then
                ewarn "remember to run: source /etc/profile if you plan to use 
nodejs"
-               ewarn " in your current shell"
+               ewarn " in your current shell"
        fi
 }

Reply via email to