On my system, LD_FLAGS is set to LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--as-needed" After commit c38056ecf68cd7c730d41fcf131829175a7793ab (gitweb), mold is picked up as an option in mozconfig (-> --enable-linker=mold) Building firefox then fails. Removing "-fuse-ld=mold " from LD_FLAGS allows to build with no errors. Reproducible: Always Logs will follow
Created attachment 849521 [details] emerge --info
Created attachment 849523 [details] build log mold: fatal: /var/tmp/portage/www-client/firefox-109.0/work/firefox_build/toolkit/library/build/libxul_so.list:1022: INPUT("../../../gfx/cairo/cairo/src/cairo-image-source.o") library not found: ../../../gfx/cairo/cairo/src/cairo-image-source.o error: linker command failed with exit code 1 (use -v to see invocation)
Linker script issue.
That's weird, I managed to build firefox-109.0 with -fuse-ld=mold and pretty similar use flags that you have. What are your use flags for cairo and gtk+:3.0?
Does it always fail to the same spot? Are you limited by ulimits? Idea gotten from https://bugzilla.mozilla.org/show_bug.cgi?id=1746462#c3 and the followup comment #4.
(In reply to Joonas Niilola from comment #4) > That's weird, I managed to build firefox-109.0 with -fuse-ld=mold and pretty > similar use flags that you have. > > What are your use flags for cairo and gtk+:3.0? emerge -pqv cairo gtk+ [ebuild R ] x11-libs/cairo-1.17.6 USE="X glib opengl (-aqua) (-debug) (-gles2-only) -gles3 -gtk-doc -test" ABI_X86="(64) -32 (-x32)" [ebuild R ] x11-libs/gtk+-3.24.35 USE="X cups introspection vim-syntax (-aqua) -broadway -colord -examples -gtk-doc -sysprof -test -wayland -xinerama" ABI_X86="(64) -32 (-x32)" I will try to rebuild both and test again
(In reply to Joonas Niilola from comment #5) > Does it always fail to the same spot? Are you limited by ulimits? Idea > gotten from https://bugzilla.mozilla.org/show_bug.cgi?id=1746462#c3 and the > followup comment #4. It is strange, on some other machine the failure is in a different spot, but rebuilding on the same machine seems to fail in the same way. I'll make some other test. About ulimits: 'ulimit' gives 'unlimited'
After rebuilding both cairo and gtk+, the error message is the same. So, without cleaning the workdir, I've launched an ebuild `equery w firefox` compile and again after removing the offending .o file. The result is still the same.
(In reply to Joonas Niilola from comment #5) > Does it always fail to the same spot? Are you limited by ulimits? Idea > gotten from https://bugzilla.mozilla.org/show_bug.cgi?id=1746462#c3 and the > followup comment #4. OK, it appears to be an ulimit problem. I tampered a little with the parameters, and "ulimit -n 2048" (default 1024) solved the issue on two different systems. I'm not sure if 2048 is too high, though.
I seem to have "-n 1048576 -l unlimited" for whatever reason. Soo... Glad you figured it out. Funny how it seems mold will trigger this issue. I do wonder if there's some sort of a recommendation as to good ulimites for desktop machines, or if I need to add some general warning to the ebuild that gets printed with mold in future.
Don't think the current approach is correct. Currently, ulimit is being set in the src_configure phase, but imo it should be set in src_compile phase as I've been using in my overlay here ```https://github.com/ambasta/ambasta/blob/6f3e07fe62a3dae959cb2cb0702e646d474e2a3e/www-client/firefox/firefox-113.0.2.ebuild#L1140``` Attempting to build firefox w/ the ebuild in portage tree still runs into ulimit erros as ``` 173:01.38 mold: fatal: /var/tmp/portage/www-client/firefox-114.0/work/firefox_build/toolkit/library/build/libxul_so.list:1022: INPUT("../../../gfx/cairo/cairo/src/cairo-polygon-reduce.o") 173:01.38 ^ library not found: ../../../gfx/cairo/cairo/src/cairo-polygon-reduce.o 173:01.42 clang-16: error: linker command failed with exit code 1 (use -v to see invocation) ```
Yeah I guess and was afraid so, tucking it with the mold checks felt the easiest solution though :\ I'll update and move it to src_compile.