Skip to content
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

[C++] Add support for LLD #40400

Closed
kou opened this issue Mar 7, 2024 · 7 comments
Closed

[C++] Add support for LLD #40400

kou opened this issue Mar 7, 2024 · 7 comments

Comments

@kou
Copy link
Member

kou commented Mar 7, 2024

Describe the enhancement requested

https://lld.llvm.org/

LLD is the LLVM Linker. It's faster than GNU ld.

Component(s)

C++

@assignUser
Copy link
Member

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?

@kou
Copy link
Member Author

kou commented Mar 8, 2024

We need to pass -fuse-ld=lld argument to gcc/g++.
See also: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

@assignUser
Copy link
Member

Ah I see, I thought it had a setup like mold that pretends to be ld ^^

@cryos
Copy link
Contributor

cryos commented Apr 1, 2024

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.

@kou
Copy link
Member Author

kou commented Apr 2, 2024

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.

@cryos
Copy link
Contributor

cryos commented Apr 2, 2024

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.)

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_GOLD after we add support for mold and LLD.

Yeah? It does look a little overly complex, but I wasn't sure on the history there.

cryos added a commit to cryos/arrow that referenced this issue Apr 5, 2024
cryos added a commit to cryos/arrow that referenced this issue Apr 5, 2024
kou pushed a commit that referenced this issue Apr 5, 2024
### Rationale for this change

Add support for the LLD LLVM linker, it is faster than the default linker.

### What changes are included in this PR?

Added `ARROW_USE_LLD` as a CMake option, test if GCC supports the flags and then set the linker flags if so when the option is enabled.

### Are these changes tested?

When this is enabled then the libraries and tests will use the linker flag.

### Are there any user-facing changes?

No
* GitHub Issue: #40400

Authored-by: Marcus D. Hanwell <marcus@voltrondata.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 16.0.0 milestone Apr 5, 2024
@kou
Copy link
Member Author

kou commented Apr 5, 2024

Issue resolved by pull request 40927
#40927

@kou kou closed this as completed Apr 5, 2024
tolleybot pushed a commit to tmct/arrow that referenced this issue May 2, 2024
### Rationale for this change

Add support for the LLD LLVM linker, it is faster than the default linker.

### What changes are included in this PR?

Added `ARROW_USE_LLD` as a CMake option, test if GCC supports the flags and then set the linker flags if so when the option is enabled.

### Are these changes tested?

When this is enabled then the libraries and tests will use the linker flag.

### Are there any user-facing changes?

No
* GitHub Issue: apache#40400

Authored-by: Marcus D. Hanwell <marcus@voltrondata.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
tolleybot pushed a commit to tmct/arrow that referenced this issue May 4, 2024
### Rationale for this change

Add support for the LLD LLVM linker, it is faster than the default linker.

### What changes are included in this PR?

Added `ARROW_USE_LLD` as a CMake option, test if GCC supports the flags and then set the linker flags if so when the option is enabled.

### Are these changes tested?

When this is enabled then the libraries and tests will use the linker flag.

### Are there any user-facing changes?

No
* GitHub Issue: apache#40400

Authored-by: Marcus D. Hanwell <marcus@voltrondata.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
rok pushed a commit to tmct/arrow that referenced this issue May 8, 2024
### Rationale for this change

Add support for the LLD LLVM linker, it is faster than the default linker.

### What changes are included in this PR?

Added `ARROW_USE_LLD` as a CMake option, test if GCC supports the flags and then set the linker flags if so when the option is enabled.

### Are these changes tested?

When this is enabled then the libraries and tests will use the linker flag.

### Are there any user-facing changes?

No
* GitHub Issue: apache#40400

Authored-by: Marcus D. Hanwell <marcus@voltrondata.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
rok pushed a commit to tmct/arrow that referenced this issue May 8, 2024
### Rationale for this change

Add support for the LLD LLVM linker, it is faster than the default linker.

### What changes are included in this PR?

Added `ARROW_USE_LLD` as a CMake option, test if GCC supports the flags and then set the linker flags if so when the option is enabled.

### Are these changes tested?

When this is enabled then the libraries and tests will use the linker flag.

### Are there any user-facing changes?

No
* GitHub Issue: apache#40400

Authored-by: Marcus D. Hanwell <marcus@voltrondata.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
vibhatha pushed a commit to vibhatha/arrow that referenced this issue May 25, 2024
### Rationale for this change

Add support for the LLD LLVM linker, it is faster than the default linker.

### What changes are included in this PR?

Added `ARROW_USE_LLD` as a CMake option, test if GCC supports the flags and then set the linker flags if so when the option is enabled.

### Are these changes tested?

When this is enabled then the libraries and tests will use the linker flag.

### Are there any user-facing changes?

No
* GitHub Issue: apache#40400

Authored-by: Marcus D. Hanwell <marcus@voltrondata.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants