New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firefox: use gold linker to speedup build #98331
Conversation
Is there any change in binary output size? |
With BFD ld (both listings manually cleaned from non-elf)
With ld.gold:
I am not sure what should be preffered here -- build time/builder memory consumption or final executables size |
IMHO what matters most is runtime performance of firefox. Which is why I've been trying to get around to implementing what #76484 (comment) describes. That would switch the linker to |
@ajs124 I am ok with |
As a first step this should be fine. When we finally manage PGO/LTO we can still switch to lld. |
There is |
Last time it at least doubled the required storage requirements. The build took easily 2x the time it already takes. Part of that is probably that you've to create profile first and then feed that back into a second build. |
LTO does not make local builds impossible. Well, not that I have found. It builds within reasonable time comparable to non-LTO Firefox. As for PGO, it is inherently nondeterministic to my understanding because the profile created depends on the system it is built on. It might be possible for the PGO profiles to generated and then distributed so the determinism problem is in a way solved, but I have not looked into whether Firefox's build system supports that. That being said I have not given PGO a serious attempt. As for LTO support please see #76484 (comment). It has a |
Since we've added LTO support (which unfortunately broke wayland support and is thus disabled by default) do we still want this as well? I am a bit more cautious with changing the linker etc.. |
We can try use lld as "isolated change of linker" and let look if something breaks. (but I need remember how to add lld to buildInputs first) |
I would rather go to the full LLVM road after I've spent a sunday debugging aarch64 builds. Mozilla doesn't test builds with GCC anymore so it will always be a battle to support GCC. There are a enough distributions that will still use GCC so there will be support (and patches) for that but I am not convinced we want to fight that battle for a marginal benefit. |
I marked this as stale due to inactivity. → More info |
|
Motivation for this change
Passing
--enable-linker=gold
speed-up final linking a bit. (not significant, in compare with gkrust crate building, but should save half minute or so).Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)