I'm unable to compile www-client/firefox-115.9.1 on musl hardened system. See log attached. Reproducible: Always Portage 3.0.61 (python 3.11.8-final-0, default/linux/amd64/23.0/split-usr/musl/hardened, gcc-12, musl-1.2.4-r1, 6.6.21-gentoo-hardened x86_64) ================================================================= System uname: Linux-6.6.21-gentoo-hardened-x86_64-AMD_A10-6800K_APU_with_Radeon-tm-_HD_Graphics-with-libc KiB Mem: 32351804 total, 12534124 free KiB Swap: 16777212 total, 16776944 free Timestamp of repository gentoo: Sat, 13 Apr 2024 15:00:00 +0000 Head commit of repository gentoo: 6949922bace35e72bf757504f0f289f63c3c53cc Timestamp of repository localrepo: Tue, 09 Apr 2024 00:34:57 +0000 Timestamp of repository mv: Thu, 04 Apr 2024 17:48:35 +0000 Head commit of repository mv: cf9c29dd36f109783cfa81bcd7ffc52ddeba35e1 Timestamp of repository vapoursynth: Sat, 13 Apr 2024 12:03:33 +0000 Head commit of repository vapoursynth: ac85ed3c8275f45a3efbcbfb116713d3111bb74e sh bash 5.1_p16-r6 ld GNU ld (Gentoo 2.41 p5) 2.41.0 app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.1_p16-r6::gentoo dev-build/autoconf: 2.13-r8::gentoo, 2.71-r6::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.28.3::gentoo dev-build/libtool: 2.4.7-r4::gentoo dev-build/make: 4.4.1-r1::gentoo dev-build/meson: 1.3.2::gentoo dev-java/java-config: 2.3.3-r1::gentoo dev-lang/perl: 5.38.2-r2::gentoo dev-lang/python: 3.11.8_p1::gentoo, 3.12.3::gentoo dev-lang/rust: 1.75.0-r1::gentoo sys-apps/baselayout: 2.14-r2::gentoo sys-apps/openrc: 0.54::gentoo sys-apps/sandbox: 2.38::gentoo sys-devel/binutils: 2.41-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 17.0.6::gentoo sys-devel/gcc: 12.3.1_p20240209::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/lld: 17.0.6::gentoo sys-devel/llvm: 17.0.6::gentoo sys-kernel/linux-headers: 6.6-r1::gentoo (virtual/os-headers) sys-libs/musl: 1.2.4-r1::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://home.lan/gentoo-portage priority: -1000 volatile: False sync-rsync-extra-opts: sync-rsync-verify-metamanifest: yes sync-rsync-verify-jobs: 1 sync-rsync-verify-max-age: 24 localrepo location: /var/db/repos/localrepo sync-type: rsync sync-uri: rsync://home.lan/localrepo masters: gentoo volatile: False sync-rsync-extra-opts: mv location: /var/db/repos/mv sync-type: git sync-uri: https://github.com/gentoo-mirror/mv.git masters: gentoo volatile: False vapoursynth location: /var/db/repos/vapoursynth sync-type: git sync-uri: https://github.com/gentoo-mirror/vapoursynth.git masters: gentoo volatile: False Installed sets: @dbuspkg, @fonts, @games, @librsvg, @localrepo, @phone, @themes, @vm, @wm ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-musl" CFLAGS="-march=bdver2 -O2 -pipe" CHOST="x86_64-pc-linux-musl" CONFIG_PROTECT="/etc /etc/portage/savedconfig/sys-kernel/linux-firmware /usr/bin/startx /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/thumbnailers/ffmpegthumbnailer.thumbnailer /usr/share/thumbnailers/imagemagick-pdf.thumbnailer" 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/terminfo" CXXFLAGS="-march=bdver2 -O2 -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--usepkg --binpkg-respect-use=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="-march=bdver2 -O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=bdver2 -O2 -pipe" GENTOO_MIRRORS="https://mirror.leaseweb.com/gentoo/" INSTALL_MASK="/etc/sysctl.d/ /etc/systemd/ /lib/systemd/ /usr/lib/sysctl.d/ /usr/lib/systemd/ /run/systemd/ -/lib/systemd/systemd-udevd" LANG="C.UTF8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs" LEX="flex" LINGUAS="en fr" MAKEOPTS="-j5" 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 a52 aac acl acpi aio alsa amd64 btrfs bzip2 cairo cdda cdr cet cli crypt cryptsetup cups dbus device-mapper dri dts dvd elogind encode exif fam fftw flac gif gpm graphite gtk hardened iconv icu ipv6 jpeg libnotify libtirpc lto lvm lz4 lzo mad mp3 mp4 ncurses nfs nls ogg opengl openmp openssl opus pam pango pcre pdf pgo pic pie png policykit readline sdl seccomp sftp split-usr ssh ssl ssp startup-notification svg system-av1 system-binutils system-cairo system-clang system-cmark system-compress system-digest system-ffmpeg system-harfbuzz system-heimdal system-icu system-images system-jpeg system-jsoncpp system-lcms system-leveldb system-libevent system-libmspack system-libs system-libvpx system-libyaml system-llvm system-lua system-lz4 system-nss system-openjpeg system-pixman system-png system-renpy system-snappy system-sqlite system-tbb system-uulib system-vpx system-zlib test-rust tiff truetype udev udisks unicode upower usb vaapi vdpau verify-sig vorbis webp wxwidgets x264 xattr xcb xml xtpax xv xvid xxhash zlib" ABI_X86="64" 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 avx f16c fma3 fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" ELIBC="musl" 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="fr" 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-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="aarch64 arm ppc ppc64 i386 x86_64" QEMU_USER_TARGETS="aarch64 arm armeb ppc ppc64 i386 x86_64" RUBY_TARGETS="ruby31" VIDEO_CARDS="radeon r600" 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, 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
Created attachment 890741 [details] www-client/firefox-115.9.1 Error loading shared library libmozsandbox.so
Exact same error with firefox-124.0.2 too.
(In reply to David Duchesne from comment #2) > Exact same error with firefox-124.0.2 too. Rebuild sys-apps/sandbox then update. This is caused by musl changes.
(In reply to Jory A. Pratt from comment #3) > (In reply to David Duchesne from comment #2) > > Exact same error with firefox-124.0.2 too. > > Rebuild sys-apps/sandbox then update. This is caused by musl changes. I've rebuilt sys-apps/sandbox and tried again with firefox-115.10.0, same error again.
I have the same problem with firefox-126 and I saw that you have the 'system-*` USE flags to so I suspected they might be the problem, after painfully recompiling it a few time, I found `system-av1` to be the problem
(In reply to Marwan from comment #5) > I have the same problem with firefox-126 and I saw that you have the > 'system-*` USE flags to so I suspected they might be the problem, after > painfully recompiling it a few time, I found `system-av1` to be the problem Hello, thanks for the suggestion. Tried again with -system-av1 set, unfortunately same failure, this time with 115.11.0. I don't know what else I can do. I forgot to mention that I'm using a gentoo chroot but in the past, I had no issue compiling firefox in this musl chroot.
A little update to let you know that with -pgo, it builds fine. I tried with both latest esr (115.12.0) and rapid (127.0.2) If I enable back pgo then, same error as initially reported in this bug report. At least, I have a working web browser with musl.
I have had the exact same thing happen with any Firefox, Icecat, and Librewolf package with pgo enabled. I found that on an initial installation, it must be compiled -pgo first. Once an installation is present on the system, pgo can be enabled and compilation should be successful. This only occurs on musl systems. I currently have Icecat-115.13.0[pgo] (firefox:esr) installed in this manner. Updates should succeed from this point on with pgo enabled; they have on my system.
(In reply to Mike Batterton from comment #8) > I have had the exact same thing happen with any Firefox, Icecat, and > Librewolf package with pgo enabled. I found that on an initial installation, > it must be compiled -pgo first. Once an installation is present on the > system, pgo can be enabled and compilation should be successful. This only > occurs on musl systems. I currently have Icecat-115.13.0[pgo] (firefox:esr) > installed in this manner. Updates should succeed from this point on with pgo > enabled; they have on my system. I tried again to build with USE pgo set, with an installed copy of firefox (without -pgo), and it builds without issue this time! I could have realize it earlier If I had kept the previous firefox[-pgo] installed but it wasn't in my @world and was unmerged during a depclean. Anyway, now firefox is in my @world, so we'll see if it builds fine when the next update (115.14.0) or next esr is out. Thanks for the concise explanation Mike Batterton. Cheers.
Created attachment 899844 [details, diff] fix-pgo.patch I encountered the same problem when building firefox-129.0 with llvm-18.1.8. As others have mentioned, in the musl environment, perhaps rpath is not set up correctly, the profiling executable fails to start because it cannot find the shared libraries. On systems where another Firefox is already installed, the build will succeed because its libraries are used, but this is clearly incorrect. Instead, I confirmed that this problem can be worked around by setting LD_PRELOAD at profiling time. Please try the attached patch.
I uninstalled Icecat-115.14.0 (Firefox:esr) and reinstalled Icecat-115.14.0[pgo] applying the above patch. On my system, the patch fixes the problem.
I'll include this patch in today's 129.0.2 bump, and it will also be synced to 128.2.0 when it's out. I won't even try to fix 115esr series - utilize /etc/portage/patches for that.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7200cea618d6b3f1f8c3c59d98539ec29e565f82 commit 7200cea618d6b3f1f8c3c59d98539ec29e565f82 Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2024-08-21 10:43:54 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2024-08-21 10:46:06 +0000 www-client/firefox: add 129.0.2 - allow net-misc/connman[networkmanager] to be used with +wifi use flag, - include a patch to fix pgo on musl when compiling for the first time, - remove tc-ld-is-mold function since it's merged into toolchain-funcs.eclass. Closes: https://bugs.gentoo.org/938205 Bug: https://bugs.gentoo.org/929967 Signed-off-by: Joonas Niilola <juippis@gentoo.org> www-client/firefox/Manifest | 102 +++ www-client/firefox/firefox-129.0.2.ebuild | 1370 +++++++++++++++++++++++++++++ 2 files changed, 1472 insertions(+)