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

Linking with gold does not search /usr/local/lib #30784

Closed
brson opened this issue Jan 8, 2016 · 7 comments
Closed

Linking with gold does not search /usr/local/lib #30784

brson opened this issue Jan 8, 2016 · 7 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@brson
Copy link
Contributor

brson commented Jan 8, 2016

If it thinks it can rustc will link with the gold linker. Unfortunately ld.bfd and ld.gold do not search the same paths for libraries. The bfd linker looks in the runtime linker path, while gold does not. This creates a very confusing difference in behavior.

Original report.

@brson brson added I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Jan 8, 2016
@eddyb
Copy link
Member

eddyb commented Jan 8, 2016

Like I said on the on the PR, this seems to be a distro/user bug, since it would affect everything using gold, not just rustc.

@birkenfeld
Copy link
Contributor

How it can be a distro bug I'm not sure, if that's just the way that gold works.

Does any distro actually install gold as the default linker (ld)? There is usually a mechanism to switch to it, but it isn't the default.

By the way, since there usually is this mechanism, why not let that extend to Rust as well, and let the user choose by whatever is ld on their system?

@rprichard
Copy link
Contributor

The title says /etc/local/lib. I think it should be /usr/local/lib?

@brson brson changed the title Linking with gold does not search /etc/local/lib Linking with gold does not search /usr/local/lib Jan 11, 2016
@brson
Copy link
Contributor Author

brson commented Jan 11, 2016

@rprichard updated the op. Thanks.

@alexcrichton
Copy link
Member

Removing nomination/regression tags but leaving open as to why we reverted gold

@alexcrichton alexcrichton added A-tools and removed I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Jan 27, 2016
@Mark-Simulacrum Mark-Simulacrum added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 24, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 24, 2017
@bstrie
Copy link
Contributor

bstrie commented Jan 29, 2020

leaving open as to why we reverted gold

If the implication is that this was being left open only in the event that gold was made rustc's default linker someday, at this point I think it's unlikely that gold would be chosen over something like LLD. To that end I'd suggest this can be closed.

@jonas-schievink jonas-schievink added A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Jan 29, 2020
@Mark-Simulacrum
Copy link
Member

I agree that this doesn't seem particularly useful to keep open - this is just linker behavior, and rustc doesn't even invoke/care about linker search paths itself for the most part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants