Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936013 - net-libs/nodejs-22.3.0: miscompiled by sys-devel/gcc on arm64, riscv at least (www-client/firefox-115.13.0: fails to emerge)
Summary: net-libs/nodejs-22.3.0: miscompiled by sys-devel/gcc on arm64, riscv at least...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard: Workaround applied to nodejs
Keywords: PullRequest
Depends on:
Blocks: 915000
  Show dependency tree
 
Reported: 2024-07-13 21:01 UTC by Andrew Cameron
Modified: 2024-09-21 02:19 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build Log Part 1 (build_1.log.gz,247.44 KB, application/gzip)
2024-07-13 21:01 UTC, Andrew Cameron
Details
Build Log Part 2 (build_2.log.gz,383.24 KB, application/gzip)
2024-07-13 21:02 UTC, Andrew Cameron
Details
Info log (info.txt,8.19 KB, text/plain)
2024-07-13 21:02 UTC, Andrew Cameron
Details
pqv log (pqv.txt,1017 bytes, text/plain)
2024-07-13 21:03 UTC, Andrew Cameron
Details
Environment (environment,242.13 KB, text/plain)
2024-07-13 21:03 UTC, Andrew Cameron
Details
amd64 nodejs-22.4.1 build log (build.log.gz,690.21 KB, application/gzip)
2024-07-20 09:06 UTC, Fredrik Eriksson
Details
amd64 diff of -O2 and -O3 (O2toO3.diff,3.65 KB, patch)
2024-07-22 14:05 UTC, Fredrik Eriksson
Details | Diff
amd64 diff of -O1 and -O2 (O1toO2.diff,10.62 KB, patch)
2024-07-22 14:05 UTC, Fredrik Eriksson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cameron 2024-07-13 21:01:37 UTC
Created attachment 897546 [details]
Build Log Part 1

isKeywordES5:r,isKeywordES6:n,isReservedWordES5:a,isReservedWordES6:s,isRestrictedWord:function(e){return"eval"===e||"arguments"===e},isIdentifierNameES5:i,isIdentifie
rNameES6:o,isIdentifierES5:function(e,t){return i(e)&&!a(e,t)},isIdentifierES6:function(e,t){return o(e)&&!s(e,t)}}}()}))),as=(ns.isKeywordES5,ns.isKeywordES6,ns.isRese
rvedWordES5,ns.isReservedWordES6,ns.isRestrictedWord,ns.isIdentifierNameES5,ns.isIdentifierNameES6,ns.isIdentifierES5,ns.isIdentifierES6,Vt((function(e,t){t.ast=ts,t.co
de=rs,t.keyword=ns})));as.ast,as.code,as.keyword;function ss(e,t){if(e===t)return!0;if(Fs[t])return!1;var r=_s[t];if(r){if(r[0]===e)return!0;var n=r,a=Array.isArray(n),
s=0;for(n=a?n:n[Symbol.iterator]();;){var i;if(a){if(s>=n.length)break;i=n[s++]}else{if((s=n.next()).done)break;i=s.value}if(e===i)return!0}}return!1}function is(e,t){i
f(e===t)return!0;var r=hi[e];if(r){var n=r,a=Array.isArray(n),s=0;for(n=a?n:n[Symbol.iterator]();;){var i;if(a){if(s>=n.length)break;i=n[s++]}else{if((s=n.next()).done)
break;i=s.value}if(t===i)return!0}}return!1}function os(e,t,r){return!!t&&(ss(t.type,e)?void 0===r||o(t,r):!r&&"Placeholder"===t.type&&e in _s&&is(t.expectedNode,e))}va
r us=["consequent","body","alternate"],cs=["left","init"],ls=["leadingComments","trailingComments","innerComments"],ps=["||","&&","??"],ds=["++","--"],fs=[">","<",">=",
"<="],hs=["=='
8107:43.95 gmake[3]: *** [backend.mk:849: devtools/client/debugger/src/actions/ast/.deps/node.stub.stub] Error 1
8107:43.95 gmake[3]: *** Waiting for unfinished jobs....
8107:44.80 Executing "/usr/bin/node /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/shared/build/build.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/event-listeners.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/exceptions.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/expressions.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/file-search.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/index.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/navigation.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/preview.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/project-text-search.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/quick-open.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/source-actors.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/sources-tree.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/tabs.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/toolbox.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/tracing.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/threads.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/devtools/client/debugger/src/actions/ui.js /var/tmp/portage/www-client/firefox-115.13.0/work/firefox_build/dist/bin/browser/chrome/devtools/modules/devtools/client/debugger/src/actions"
Comment 1 Andrew Cameron 2024-07-13 21:02:16 UTC
Created attachment 897547 [details]
Build Log Part 2
Comment 2 Andrew Cameron 2024-07-13 21:02:42 UTC
Created attachment 897548 [details]
Info log
Comment 3 Andrew Cameron 2024-07-13 21:03:07 UTC
Created attachment 897549 [details]
pqv log
Comment 4 Andrew Cameron 2024-07-13 21:03:33 UTC
Created attachment 897550 [details]
Environment
Comment 5 Andrew Cameron 2024-07-13 21:04:52 UTC
My current installed version of Firefox is
     Installed versions:  115.10.0(esr)(01:08:43 04/18/24)(X clang dbus gmp-autoupdate hwaccel pulseaudio system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp wifi -debug -eme-free -geckodriver -hardened -jack -libproxy -lto -openh264 -pgo -screencast -selinux -sndio -system-png -system-python-libs -wayland CPU_FLAGS_ARM="-neon" L10N="-ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-CA -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fur -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -ne -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -ru -sc -sco -si -sk -sl -son -sq -sr -sv -szl -ta -te -th -tl -tr -trs -uk -ur -uz -vi -xh -zh-CN -zh-TW")
     Homepage:            https://www.mozilla.com/firefox
     Description:         Firefox Web Browser
Comment 6 Joonas Niilola gentoo-dev 2024-07-14 08:26:47 UTC
Hmm from a quick glance it's somehow nodejs related. Could you recompile nodejs, with "safe" *FLAGS and especially without lto if you have such a thing enabled?
Comment 7 Andrew Cameron 2024-07-14 08:31:40 UTC
(In reply to Joonas Niilola from comment #6)
> Hmm from a quick glance it's somehow nodejs related. Could you recompile
> nodejs, with "safe" *FLAGS and especially without lto if you have such a
> thing enabled?

Here is the installed version of nodejs. 
     Installed versions:  22.4.1(0/22)^t(14:49:02 07/13/24)(icu inspector npm snapshot ssl system-icu system-ssl -corepack -debug -doc -lto -pax-kernel -test CPU_FLAGS_X86="-sse2")
     Homepage:            https://nodejs.org/
     Description:         A JavaScript runtime built on Chrome's V8 JavaScript engine

What flags do you want me to change?
Comment 8 Joonas Niilola gentoo-dev 2024-07-14 08:41:29 UTC
Your CFLAGS, CXXFLAGS and LDFLAGS look fine. I have different USE flags for nodejs but I'm not aware any of the USE flags, other than lto, causing issues. So try recompiling nodejs. 

Well one thing you could also try is compile Firefox with gcc instead.
Comment 9 Fredrik Eriksson 2024-07-14 17:30:56 UTC
I'm seeing this problem on my amd64 package builder as well. I've tried to disable ccache and rebuild nodejs (version 22.3.0), but firefox still fails.

I can provide full build logs if you want them, but as far as I can tell the error message is similar to what's already in attached build log part 2:

107:45.68 gmake[3]: *** [backend.mk:839: devtools/client/debugger/src/actions/.deps/node.stub.stub] Error 1
107:45.69 gmake[3]: Leaving directory '/var/tmp/portage/www-client/firefox-115.13.0/work/firefox_build'
107:45.69 gmake[2]: *** [/var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/config/recurse.mk:34: misc] Error 2
107:45.69 gmake[2]: Leaving directory '/var/tmp/portage/www-client/firefox-115.13.0/work/firefox_build'
107:45.69 gmake[1]: *** [/var/tmp/portage/www-client/firefox-115.13.0/work/firefox-115.13.0/config/rules.mk:361: default] Error 2
107:45.69 gmake[1]: Leaving directory '/var/tmp/portage/www-client/firefox-115.13.0/work/firefox_build'
107:45.69 gmake: *** [client.mk:60: build] Error 2
107:45.69 145 compiler warnings present.


my emerge --info below

Portage 3.0.65 (python 3.12.3-final-0, default/linux/amd64/23.0/feffe/server/systemd, gcc-13, glibc-2.39-r6, 6.6.35-gent oo-dist x86_64)       
=================================================================                                                       
System uname: Linux-6.6.35-gentoo-dist-x86_64-Westmere_E56xx-L56xx-X56xx_-IBRS_update-with-glibc2.39                    
KiB Mem:    12248988 total,   2062008 free
KiB Swap:    8388604 total,   8348836 free
Timestamp of repository gentoo: Sun, 14 Jul 2024 09:45:00 +0000                                                         
Head commit of repository gentoo: c945a8670728cf0e7ea3a318b9838fd50ff13d1b                                              
Head commit of repository feffe: 1f799f1c74008124c4229361129c97d29ef80ca0                                               
                                                                                                                        
sh bash 5.2_p26-r6                                                                                                      
ld GNU ld (Gentoo 2.42 p3) 2.42.0                                                                                       
ccache version 4.9.1 [enabled]                                                                                          
app-misc/pax-utils:        1.3.7::gentoo                                                                                
app-shells/bash:           5.2_p26-r6::gentoo                                                                           
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo                                                             
dev-build/automake:        1.16.5-r2::gentoo                                                                            
dev-build/cmake:           3.28.5::gentoo                                                                               
dev-build/libtool:         2.4.7-r4::gentoo                                                                             
dev-build/make:            4.4.1-r1::gentoo                                                                             
dev-build/meson:           1.4.1::gentoo                                                                                
dev-java/java-config:      2.3.3-r1::gentoo                                                                             
dev-lang/perl:             5.38.2-r3::gentoo                                                                            
dev-lang/python:           3.11.9-r1::gentoo, 3.12.3-r1::gentoo                                                         
dev-lang/rust-bin:         1.77.1::gentoo                                                                               
dev-util/ccache:           4.9.1-r1::gentoo                                                                             
sec-policy/selinux-base:   2.20240226-r2::gentoo      
sys-apps/baselayout:       2.15::gentoo                                                                                 
sys-apps/sandbox:          2.38::gentoo                                                                                 
sys-apps/systemd:          255.7-r1::gentoo                                                                             
sys-devel/binutils:        2.42-r1::gentoo                                                                              
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 17.0.6::gentoo 
sys-devel/gcc:             13.2.1_p20240210::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             15.0.7::gentoo, 17.0.6::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 17.0.6::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
sys-libs/libselinux:       3.6-r1::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: true

feffe
    location: /var/db/repos/feffe
    sync-type: git
    sync-uri: https://gitea.fulh.ax/feffe/feffe-portage-overlay.git
    masters: gentoo
    priority: 100
    volatile: False
    sync-git-verify-commit-signature: false

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -OPERA-2018 -JoyPixels -worklog-assistant -AnyDesk-TOS -genymotion -TeamViewer -GIMPS -microsoft-edge -android -Steam -baudline -zi-labone -geekbench -NVIDIA-CUDA -LOKI-EULA -PICO-8 -Dell-EULA -bestcrypt -Microsemi -MakeMKV-EULA -Aseprite-EULA -2dboy-EULA -Gameplay-Group-EULA -PassMark-EULA -Primate-Plunge -MTA-0.5 -RAR -supermicro -Intel-SDP -ETQW -Introversion -NVIDIA-SDK -PUEL-11 -teamspeak3 -Synology -Microsoft-vscode -THINKTANKS -FAH-EULA-2014 -microsoft-azurevpnclient -Ookla -PAPERS-PLEASE -WPS-EULA -SPS -f.lux -Coherent-Graphics -QUAKE4 -sfpg -teamspeak5 -TIK -CAPYBARA-EULA -GOG-EULA -Flightradar24 -google-chrome -ubiquiti -ut2003 -Vivaldi -AMD-GPU-PRO-EULA -Q3AEULA-20000111 -Mojang -ut2003-demo"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=x86-64-v2 -mtune=intel"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=x86-64-v2 -mtune=intel"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg --binpkg-respect-use=y --binpkg-changed-deps=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -march=x86-64-v2 -mtune=intel"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance binpkg-request-signature binpkg-signing buildpkg buildpkg-live ccache config-protect-if-modified distlocks ebuild-locks fixlafiles gpg-keepalive ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox parallel-fetch pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=x86-64-v2 -mtune=intel"
GENTOO_MIRRORS="https://ftp.halifax.rwth-aachen.de/gentoo/ https://ftp.snt.utwente.nl/pub/os/linux/gentoo https://www.mirrorservice.org/sites/distfiles.gentoo.org/"
LANG="sv_SE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="sv en"
MAKEOPTS="-j5 -l6"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X aacs acl alsa amd64 archive audit bdplus berkdb bluetooth bluray bzip2 cairo caps cet cjk colord conntrack corefonts crypt cryptsetup cups dbus device-mapper dist-kernel dnssec dracut dri drm dvd egl exif fcitx4 fontconfig fortran gdbm gdk-pixbuf gif gpg grub gssapi gtk gui hardened harfbuzz hdri heif http2 hwaccel iconv icu idn iproute2 ipset ipv6 jpeg kerberos lapack lcms ldap libde265 libdovi libkms libnotify libplacebo libtirpc libxml2 lm-sensors lvm lz4 lzma modemmanager mp3 multilib native-headset ncurses networkmanager nftables nginx nls nss ocr ofono-headset ogg opencl opengl openmp optical opus pam pcre pic pie pkcs11 pkcs7 png policykit printsupport pulseaudio python qsv qt qt5 raw rdp readline ruby rustfmt scanner seccomp selinux shaderc smartcard spell spice sqlite ssh ssl ssp svg systemd systray test-rust tiff tray truetype udev udf udisks unicode usb usbredir v4l vaapi vim-syntax vmaf vnc vorbis vpx vulkan wallpapers wayland webp widgets wifi x265 xattr xfs xft xinerama xmp xtpax zfs zimg zlib" ABI_X86="64 32" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="sv en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11 python3_12" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="dummy intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 10 Andrew Cameron 2024-07-14 19:09:41 UTC
I downgraded nodejs to a much older version and firefox emerged successfully

     Installed versions:  20.14.0(0/20)^t(18:36:08 07/14/24)(icu inspector npm snapshot ssl system-icu system-ssl -corepack -debug -doc -lto -pax-kernel -test CPU_FLAGS_X86="-sse2")
     Homepage:            https://nodejs.org/
     Description:         A JavaScript runtime built on Chrome's V8 JavaScript engine


     Installed versions:  115.13.0(esr)(20:06:02 07/14/24)(X clang dbus gmp-autoupdate hwaccel pulseaudio system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp wayland wifi -debug -eme-free -geckodriver -hardened -jack -libproxy -lto -openh264 -pgo -screencast -selinux -sndio -system-png -system-python-libs CPU_FLAGS_ARM="-neon" L10N="-ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-CA -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fur -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -ne -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -ru -sc -sco -si -sk -sl -son -sq -sr -sv -szl -ta -te -th -tl -tr -trs -uk -ur -uz -vi -xh -zh-CN -zh-TW")
     Homepage:            https://www.mozilla.com/firefox
     Description:         Firefox Web Browser
Comment 11 Fredrik Eriksson 2024-07-15 05:08:43 UTC
Can confirm firefox builds successfully for me as well after downgrading nodejs to net-libs/nodejs-20.14.0.
Comment 12 Joonas Niilola gentoo-dev 2024-07-15 05:50:58 UTC
What version of nodejs you had before? I'll need to test it on amd64 too and probably mask it if it's broken like that.
Comment 13 Fredrik Eriksson 2024-07-15 06:29:21 UTC
It was the current stable net-libs/nodejs-22.3.0 that resulted in build failures for me on amd64.
Comment 14 Joonas Niilola gentoo-dev 2024-07-15 07:10:11 UTC
Hmm, that works for me though. What use flags you have enabled?
Comment 15 Fredrik Eriksson 2024-07-15 07:35:12 UTC
net-libs/nodejs-22.3.0-2:0/22::gentoo  USE="icu inspector npm snapshot ssl system-icu system-ssl -corepack -debug -doc (-lto) -pax-kernel -test" CPU_FLAGS_X86="sse2"

www-client/firefox-115.13.0-1:esr::gentoo  USE="X clang dbus hardened hwaccel pulseaudio (selinux) system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp wayland wifi -debug -eme-free -geckodriver (-gmp-autoupdate) -jack -libproxy -lto -openh264 -pgo -screencast -sndio -system-png (-system-python-libs)" L10N="sv -ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-CA -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fur -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -ne -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -ru -sc -sco -si -sk -sl -son -sq -sr -szl -ta -te -th -tl -tr -trs -uk -ur -uz -vi -xh -zh-CN -zh-TW"

I'm using a custom profile based on (and only minor modifications from) default/linux/amd64/23.0/hardened/selinux/systemd 

You can get and inspect the compiled nodejs package from here: https://pkg.winterbird.org/gentoo/net-libs/nodejs/nodejs-22.3.0-2.gpkg.tar
Comment 16 Andrew Cameron 2024-07-15 13:32:05 UTC
I have tried  net-libs/nodejs-20.15.1 and Firefox emerges ok with it.
Anything newer fails for me.

    Installed versions:  20.15.1(0/20)^t(13:11:35 07/15/24)(icu inspector npm snapshot ssl system-icu system-ssl -corepack -debug -doc -lto -pax-kernel -test CPU_FLAGS_X86="-sse2")
     Homepage:            https://nodejs.org/
     Description:         A JavaScript runtime built on Chrome's V8 JavaScript engine
Comment 17 Joonas Niilola gentoo-dev 2024-07-19 10:50:21 UTC
I can't reproduce though, nodejs-22.3.0, 22.4.0 and 22.4.1 seems to work here. The use flags doesn't seem to make a difference either.

Does 22.4.1 work for you if you test that?
Comment 18 Andrew Cameron 2024-07-19 12:01:50 UTC
(In reply to Joonas Niilola from comment #17)
> I can't reproduce though, nodejs-22.3.0, 22.4.0 and 22.4.1 seems to work
> here. The use flags doesn't seem to make a difference either.
> 
> Does 22.4.1 work for you if you test that?

 22.4.1 is the one I had initially installed when it failed.
NOTE as my system is Risc-v based it has additional Risc-v patches applied to nodejas as part of the build for versions greater than 20.15.1
Comment 19 Fredrik Eriksson 2024-07-20 09:06:54 UTC
Created attachment 898027 [details]
amd64 nodejs-22.4.1 build log

Build fails for me with nodejs-22.4.1 as well. My build machine is really slow, but I will attempt a complete world rebuild as well in case there is a problem with one of my old binary packages.

If anyone else has a vm or chroot, machine power and time to spare you could try to reproduce this by checking out tag gentoo#936013 from https://gitea.fulh.ax/feffe/feffe-portage-overlay.git and use the overlay profile default/linux/amd64/23.0/feffe/desktop. For my build machine I use a kvm VM with CPU set to "Westmere-IBRS".
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-21 13:13:09 UTC
As linked in the PR (thanks!), https://issues.chromium.org/issues/42204492 is the report to Chromium.

Fedora force -O3: https://src.fedoraproject.org/rpms/nodejs20/blob/908db65fbdfcaa64b4a73d222840bb9768a05cbd/f/nodejs20.spec#_532. That's a ridiculous workaround and not acceptable. Honestly, I can't quite believe they've done that, especially given they could easily speak to the various GCC developers involved in Fedora. It's unbelievably flaky. But I guess I sympathise as nodejs is huge.

Please run the following and figure out which option between -O2/-O3 fixes it:
for t in param target optimize optimizer; do cmd="gcc -Q --help=$t"; diff -U0 <(LANG=C $cmd -O2) <(LANG=C $cmd -O3); done

or, better, between -O1 and -O2:
for t in param target optimize optimizer; do cmd="gcc -Q --help=$t"; diff -U0 <(LANG=C $cmd -O1) <(LANG=C $cmd -O2); done
Comment 21 Fredrik Eriksson 2024-07-22 14:05:17 UTC
Created attachment 898110 [details, diff]
amd64 diff of -O2 and -O3

I don't know the first thing about gcc optimizations unfortunately, but I can provide the requested diffs if anyone finds them useful.

I can also confirm that building nodejs with -O3 instead of -O2 lets me successfully build firefox afterwards.
Comment 22 Fredrik Eriksson 2024-07-22 14:05:53 UTC
Created attachment 898111 [details, diff]
amd64 diff of -O1 and -O2
Comment 23 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-24 11:20:02 UTC
Hi Fredrik, no worries.

Sasha has come up with a reduced testcase and reported it upstream. It looks like it's introduced by SLP.
Comment 24 Larry the Git Cow gentoo-dev 2024-07-24 19:09:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=893fc8602102e9732a5c50e0dcffe13e4b6ef6ad

commit 893fc8602102e9732a5c50e0dcffe13e4b6ef6ad
Author:     Sasha Finkelstein <fnkl.kernel@gmail.com>
AuthorDate: 2024-07-24 18:31:43 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-07-24 19:08:35 +0000

    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@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/37651
    Signed-off-by: Sam James <sam@gentoo.org>

 net-libs/nodejs/{nodejs-22.4.1.ebuild => nodejs-22.4.1-r1.ebuild} | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Comment 25 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-24 19:09:48 UTC
Let's keep it open until we have a fix in GCC.
Comment 26 Larry the Git Cow gentoo-dev 2024-07-29 17:19:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca25b4bfc01598224ee236fb97bc45be2a6e0a58

commit ca25b4bfc01598224ee236fb97bc45be2a6e0a58
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-07-29 17:17:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-07-29 17:18:58 +0000

    sys-devel/gcc: add 14.1.1_p20240729 (RC2)
    
    Includes the SLP fix for nodejs.
    
    Bug: https://bugs.gentoo.org/936013
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                    |  1 +
 sys-devel/gcc/gcc-14.1.1_p20240729.ebuild | 54 +++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
Comment 27 Larry the Git Cow gentoo-dev 2024-08-01 21:55:26 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79d344553208c7a767a08526503d55ae1488d0c6

commit 79d344553208c7a767a08526503d55ae1488d0c6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-08-01 18:00:20 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-08-01 21:53:33 +0000

    sys-devel/gcc: add 14.2.0
    
    wrt #880677: while there's still a workaround in the ebuild and it
    seems to have worked by chance with 14, I suspect the real fix for
    that bug is in 14.2.0 (the various IPA fixes Honza committed recently).
    
    wrt #936013: keywording to get this fix out.
    
    Bug: https://bugs.gentoo.org/880677
    Bug: https://bugs.gentoo.org/936013
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest          |  1 +
 sys-devel/gcc/gcc-14.2.0.ebuild | 53 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)