-
Notifications
You must be signed in to change notification settings - Fork 631
Conversation
@chshersh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @neongreen, @flyingleafe and @volhovm to be potential reviewers. |
if os(linux) | ||
ghc-options: -optl-fuse-ld=gold | ||
ld-options: -fuse-ld=gold | ||
if os(darwin) | ||
ghc-options: "-pgmc clang" "-pgma clang" "-pgml clang" "-optl-fuse-ld=lld" | ||
ld-options: -fuse-ld=lld |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we using lld
in macOS because it doesn't have gold
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also because it's actually faster than gold
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think lld is in a state where can be used on Mach-O, see my comment.
Also, it's not necessarily faster than gold. In many tests we run it goes from parity to 2x faster (in particular scenarios, e.g. when linking with debuginfo or with some options (e.g. -gdb-index
). It's a safe claim to say that's generally at least as fast as gold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's approved, but as we know it doesn't work. Now everybody can merge it and I am afraid that somebody will do it, so I am rejecting it just in case.
What is the status of this, @gromakovsky? We need to know if this can be used to speed up Hydra builds. |
@deepfire we are already using gold for linux builds (in master). We are not using lld for MacOS because it doesn't work (that's the reason this PR is still open). Niklas can help us with it if it's a priority. |
Looks like we won't need it after switching to GHC 8.2:
|
Afaik this one depends on NixOS/nixpkgs#24744 |
LLVM/lld dev here. My $0.02 here. The MachO backend hasn't been pretty much touched since the split. All the timings for haskell, as far as I can tell have been taken on ELF. I'll be very surprised if the Mach-O backend links anything larger than an hello world (I'm pretty sure it doesn't self-host, because I tried myself). As such, I think having lld has a viable alternative on Nix (MacOS) would require a substantial amount of work and it's definitely not ready for production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good move :)
if os(linux) | ||
ghc-options: -optl-fuse-ld=gold | ||
ld-options: -fuse-ld=gold | ||
if os(darwin) | ||
ghc-options: "-pgmc clang" "-pgma clang" "-pgml clang" "-optl-fuse-ld=lld" | ||
ld-options: -fuse-ld=lld |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think lld is in a state where can be used on Mach-O, see my comment.
Also, it's not necessarily faster than gold. In many tests we run it goes from parity to 2x faster (in particular scenarios, e.g. when linking with debuginfo or with some options (e.g. -gdb-index
). It's a safe claim to say that's generally at least as fast as gold.
Oops, sorry, I thought this was for NixOS. Ignore my comment (although my reasoning is still valid :) |
This commit is a part of CSL-1002 issues: speeding up linking to build project faster.
gold
linker is already added. Though there're some problems with addinglld
. Waiting for @neongreen and @nh2 to comment.