arrow
arrow copied to clipboard
[C++] Add support for LLD
Describe the enhancement requested
https://lld.llvm.org/
LLD is the LLVM Linker. It's faster than GNU ld.
Component(s)
C++
LLD is a drop-in replacement for the GNU linkers that accepts the same command line arguments and linker scripts as GNU.
Do we even need to add anything explicitly if this is the case?
We need to pass -fuse-ld=lld argument to gcc/g++.
See also: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
Ah I see, I thought it had a setup like mold that pretends to be ld ^^
As I look at the linker logic I am struck that we could end up trying to use multiple linkers, I was thinking that we might add an option to choose the linker by name, and populate that from the boolean flags. If we want to keep it simple maybe just warn that multiple linkers were selected and that we will use X, where we would then need to determine the default if all, etc. I can put something together and let you both take a look.
You're suggesting ARROW_LINKER=gold|mold|lld or something instead of ARROW_USE_LD_GOLD/ARROW_USE_MOLD/ARROW_USE_LLD, right?
I'm OK with it. (I don't have a strong opinion for this.)
BTW, I think that we can drop support for ARROW_USE_LD_GOLD after we add support for mold and LLD.
You're suggesting
ARROW_LINKER=gold|mold|lldor something instead ofARROW_USE_LD_GOLD/ARROW_USE_MOLD/ARROW_USE_LLD, right? I'm OK with it. (I don't have a strong opinion for this.)
Yes, just to ensure we only request one linker, or what I added with a default in an if, elseif block.
BTW, I think that we can drop support for
ARROW_USE_LD_GOLDafter we add support for mold and LLD.
Yeah? It does look a little overly complex, but I wasn't sure on the history there.
Issue resolved by pull request 40927 https://github.com/apache/arrow/pull/40927