-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
How to find LLD with old versions of gcc? #97402
Copy link
Copy link
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This issue is related to stabilizing use of LLD from rustc and/or making it default - rust-lang/compiler-team#510, #39915.
GCC and Clang have several ways to specify linker.
-B directory, you specify a search directory, then the compiler finds a file namedldin it an uses it as a linker.This is the old way working on all versions of GCC and Clang that we want to support (?).
-fuse-ld=bfd|gold|lld|moldlimited to 4 well-known linker names, you specify the name, then the compiler finds a file namedld.namein its search directories.This is a somewhat new way, the well-known name
-fuse-ld=lldworks in Clang, and in GCC since 2018 (which GCC version?).-fuse-ld=/absolute/path/to/lld, where you specify the full linker path.This doesn't work with GCC, and worked with Clang since 2016, but is now deprecated in favor of
--ld-path.--ld-path=/absolute/path/to/lld, where you specify the full linker path.This doesn't work with GCC, and works with Clang since 2021.
rustcneeds to tell C compiler to use LLD in two modesThis mode always uses
-B directoryright now (after Simplify implementation of-Z gcc-ld#97375) just because it's simple to do, but it also means that old compilers are supported.QUESTIONS:
-fuse-ld=lld?