Skip to content

Wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor#89288

Merged
bors merged 1 commit intorust-lang:masterfrom
rusticstuff:lld_wrapper
Oct 8, 2021
Merged

Wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor#89288
bors merged 1 commit intorust-lang:masterfrom
rusticstuff:lld_wrapper

Conversation

@hkratz
Copy link
Contributor

@hkratz hkratz commented Sep 26, 2021

This PR adds an lld-wrapper tool which is installed as ld and ld64 in lib\rustlib\<host_target>\bin\gcc-ld directory and whose sole purpose is to invoke rust-lld in the parent directory with the correct flavor. Lld decides which flavor to use from either the first two commandline arguments or from the name of the executable (ld for GNU/ld flavor, ld64 for Darwin/Macos/ld64 flavor and so on). Symbolic links could not be used as they are not supported by rustup and on Windows.

The wrapper replaces full copies of rust-lld which added some significant bloat. On UNIXish operating systems it exec rust-lld, on Windows it spawns it as a child process.

Fixes #88869.

r? @Mark-Simulacrum
cc @nagisa @petrochenkov @1000teslas

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doublicated ld\ld64 executables added into rustc package, increasing it's size