Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
klensy opened this issue Sep 11, 2021 · 5 comments · Fixed by #89288
Closed

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

klensy opened this issue Sep 11, 2021 · 5 comments · Fixed by #89288
Assignees
Labels
P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta.
Milestone

Comments

@klensy
Copy link
Contributor

klensy commented Sep 11, 2021

Checked that on x86_64-pc-windows-msvc target,
found duplicates in versions:

rustc 1.56.0-beta.1 (e784c962e 2021-09-07)
rustc 1.57.0-nightly (b69fe5726 2021-09-10)

and no duplicates 2 duplicates (only rust-lld.exe, ld.exe) in stable rustc 1.55.0 (c8dfcfe04 2021-09-06), rustc 1.56.0-nightly (4e282795d 2021-07-31)
(bisecting is kinda slow on my connection)

there 3 copies of that executable, that gives ~ 187mb

@rustbot label +regression-from-stable-to-beta

@rustbot rustbot added regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 11, 2021
@klensy
Copy link
Contributor Author

klensy commented Sep 11, 2021

Can be found in:

.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\gcc-ld\ld.exe
.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\gcc-ld\ld64.exe
.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\rust-lld.exe

@ghost
Copy link

ghost commented Sep 12, 2021

I think they were added in #88250 and #85961.

and no duplicates (only ld.exe)

I believe ld is also a copy of ../rust-lld.

@apiraino
Copy link
Contributor

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 22, 2021
@hkratz
Copy link
Contributor

hkratz commented Sep 24, 2021

@rustbot claim

@hkratz
Copy link
Contributor

hkratz commented Sep 24, 2021

Sorry, I only came across this issue just now. The copies are there for a reason, see linked issues.

Multiple things to consider:

  • The files in the gcc-ld directory are only used with the -Z gcc-ld=lld unstable option. So they could be removed for beta and stable.
  • They can be replaced with small Rust executables which just exec ../rust-lld -flavor ld <supplied args> and ../rust-lld -flavor ld64 <supplied args> respectively. I will be working on that for nightly.

@Mark-Simulacrum Mark-Simulacrum added this to the 1.56.0 milestone Oct 2, 2021
Manishearth added a commit to Manishearth/rust that referenced this issue Oct 5, 2021
…ulacrum

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

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 rust-lang#88869.

r? `@Mark-Simulacrum`
cc `@nagisa` `@petrochenkov` `@1000teslas`
Manishearth added a commit to Manishearth/rust that referenced this issue Oct 7, 2021
…ulacrum

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

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 rust-lang#88869.

r? `@Mark-Simulacrum`
cc `@nagisa` `@petrochenkov` `@1000teslas`
Manishearth added a commit to Manishearth/rust that referenced this issue Oct 8, 2021
…ulacrum

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

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 rust-lang#88869.

r? ``@Mark-Simulacrum``
cc ``@nagisa`` ``@petrochenkov`` ``@1000teslas``
@bors bors closed this as completed in 1c1c6ed Oct 8, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants