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

WIP: bootstrap: remove use-lld #116182

Closed
wants to merge 1 commit into from

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Sep 26, 2023

Removes the use-lld flag, which doesn't seem very useful - it's only used on one place in our CI explicitly, and setting of lld is far from being as simple as a boolean option. I think that we should just use lld based on the target specs or other inferred LLD usage. Opening a PR to see what CI has to say about it.

Removes the `use-lld` flag, which doesn't seem very useful.
@rustbot
Copy link
Collaborator

rustbot commented Sep 26, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Sep 26, 2023
@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 26, 2023

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 26, 2023
@bors
Copy link
Contributor

bors commented Sep 26, 2023

⌛ Trying commit 608d444 with merge 6d68f23...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 26, 2023
…try>

WIP: bootstrap: remove use-lld

Removes the `use-lld` flag, which doesn't seem very useful - it's only used on one place in our CI explicitly, and setting of `lld` is far from being as simple as a boolean option. I think that we should just use lld based on the target specs or other inferred LLD usage. Opening a PR to see what CI has to say about it.
@bors
Copy link
Contributor

bors commented Sep 26, 2023

☀️ Try build successful - checks-actions
Build commit: 6d68f23 (6d68f232de0e7b0efd8a709f8588739fea0f386e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6d68f23): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.6% [0.6%, 5.8%] 112
Regressions ❌
(secondary)
3.0% [0.7%, 5.4%] 66
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-2.6% [-3.5%, -1.2%] 5
All ❌✅ (primary) 2.6% [-2.0%, 5.8%] 113

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.1% [0.9%, 10.2%] 17
Regressions ❌
(secondary)
3.9% [0.9%, 9.1%] 63
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.1% [0.9%, 10.2%] 17

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 633.132s -> 634.219s (0.17%)
Artifact size: 317.17 MiB -> 320.54 MiB (1.06%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 27, 2023
@petrochenkov
Copy link
Contributor

and setting of lld is far from being as simple as a boolean option

Why?
It's just as simple (at least on my targets), I use it all the time.
What is the alternative - waiting twice as long for linking to complete?

@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 27, 2023

It's just as simple (at least on my targets), I use it all the time.

Ok! I'd like to know how it's being used. On which targets do you use use-lld = true?

In terms of our CI, we only use it for x64 Linux, and that target should hopefully switch soon to using LLD by default, so then the only usage of the flag would be removed.

Regarding the flag itself, I think that it's a bit messy at the moment. At the same time, it enables the usage of LLD linker flags, and also tells bootstrap to use rust-lld from the snapshot compiler. However, that really conflates two things together. For example, once x64 defaults to using LLD, we might want to force our CI builders that use an externally provided LLVM to also use an externally provided LLD. That's not really possible with use-lld currently, since it will try to use rust-lld coming from the snapshot compiler.

To clarify, I want to keep some way of telling bootstrap to use lld, I just think that this flag should be modified or replaced with some other mechanism.

I think that one way could be to introduce something like this in bootstrap:

enum LldConfig {
   Disabled,               // don't use lld
   External(PathBuf), // use externally provided lld
   LocallyBuilt,          // use lld built from src/llvm-project
   Snapshot              // use lld from the snapshot compiler
}

or, alternatively, just set lld in target.XYZ.linker, and then have another flag in config.toml that will let bootstrap know that the linker is a "lld flavor" and that bootstrap should pass LLD-like flags to it.

@petrochenkov petrochenkov self-assigned this Sep 27, 2023
@mati865
Copy link
Contributor

mati865 commented Sep 27, 2023

I suppose it's about Windows targets.
Windows-gnu does work with LLD but we cannot move it use LLD by the default because ld.bfd still has numerous issues with import libraries made by LLD. It's much bigger issue than on Linux because PE/COFF handling code in Binutils is (very) suboptimal, there were some fixes merged for the next release though.
Moving windows-gnullvm targets to Tier 2 with host tools (so it can bootstrap itself without hacks) could be an alternative but I'm struggling to find co-maintainer as per Tier 2 (the one with std only) policy requirement.
No clue about MSVC.

@ChrisDenton
Copy link
Member

For msvc, lld should be a drop in replacement but there have been issues in practice. It's not something we test so arguably it's not technically supported. I believe Chromium use it tho and do report issues.

@petrochenkov
Copy link
Contributor

Ok! I'd like to know how it's being used. On which targets do you use use-lld = true?

x86_64-unknown-linux-gnu and x86_64-pc-windows-gnu.
LLD is installed globally, not shipped with some Rust toolchain or self-built.
Switching between lld and ld is commenting or uncommenting one line - use-lld = true.

On windows-gnu LLD may not work good enough to cover all corner cases, but it certainly works good enough to build and test rustc.
If something regresses then I report such regressions (but everything went smooth last 1-2 years, IIRC).

we only use it for x64 Linux, and that target should hopefully switch soon to using LLD by default

I also have such a hope, but I wouldn't put my money on it.

@petrochenkov
Copy link
Contributor

Regarding the flag itself, I think that it's a bit messy at the moment.

I'm not against refactoring the options, but I would like to keep the existing functionality.

@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 28, 2023

x86_64-unknown-linux-gnu and x86_64-pc-windows-gnu.
LLD is installed globally, not shipped with some Rust toolchain or self-built.
Switching between lld and ld is commenting or uncommenting one line - use-lld = true.

I think that If you use the global lld, you also have to set it with the linker flag in config.toml. Just using use-lld will use the lld from the snapshot compiler.

@petrochenkov
Copy link
Contributor

For me it doesn't matter match whether snapshot lld or global lld is used, snapshot lld would even be more convenient - no need to install anything globally.
It's just use-lld didn't work without a global lld installation when I tested it last time (that's what I'm talking about in #116197 (comment) as well).

@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 28, 2023

It's just use-lld didn't work without a global lld installation when I tested it last time (that's what I'm talking about in #116197 (comment) as well).

Yeah, the reason why it doesn't work is #102101 and specifically this line. #116197 should fix that.

@petrochenkov
Copy link
Contributor

@Kobzol

It's just use-lld didn't work without a global lld installation when I tested it last time (that's what I'm talking about in #116197 (comment) as well).

Yeah, the reason why it doesn't work is #102101 and specifically this line. #116197 should fix that.

No, it was (long?) before that.
I'm trying to test the current behavior right now, it just may take some time.

@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 28, 2023

No, it was (long?) before that.

Aha, I see. I guess that something like this might also be problematic.

@petrochenkov
Copy link
Contributor

Okay, it didn't take much time, here's the first failure.
The last line (collect2) is just bad diagnostics, it actually cannot find lld, not ld.

Log
   Compiling compiler_builtins v0.1.101
     Running `C:\msys64\home\we\rust\build\bootstrap\debug\rustc --crate-name build_script_build --edition=2018 'C:\Users\we\.cargo\registry\src\index.crates.io-6f17d22bba15001f\compiler_builtins-0.1.101\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artif
acts,future-incompat --diagnostic-width=270 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C codegen-units=10000 -C debuginfo=1 -C debug-assertions=off --cfg 'feature="c"' --cfg 'feature="cc"' --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg '
feature="default"' --cfg 'feature="rustc-dep-of-std"' -Zunstable-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=7429f31e2b6dfc4a -C extra-filename=-7429f31e2b6dfc4a --out-dir 'C:\msys64\home\we\rust\build\x86_64-pc-windows-gnu\stage0-std\release\build\c
ompiler_builtins-7429f31e2b6dfc4a' -L 'dependency=C:\msys64\home\we\rust\build\x86_64-pc-windows-gnu\stage0-std\release\deps' --extern 'cc=C:\msys64\home\we\rust\build\x86_64-pc-windows-gnu\stage0-std\release\deps\libcc-8eebe327d55fceab.rlib' --cap-lints allow -Z binary-
dep-depinfo`
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "C:\\msy
s64\\tmp\\rustc0lSJmm\\symbols.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.00.rcgu.o" "C:\\msys64\\home\\we\\rust
\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.01.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\c
ompiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.02.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31
e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.03.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.04.rcgu.o"
"C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.05.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\st
age0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.06.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\
\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.07.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b
6d0d7889d08-cgu.08.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.09.rcgu.o" "C:\\msys64\\home\\we\\rust\\build
\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.10.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler
_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.11.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc
4a.build_script_build.e426b6d0d7889d08-cgu.12.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.13.rcgu.o" "C:\\ms
ys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.14.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-st
d\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.15.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_
script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.16.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d788
9d08-cgu.17.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.18.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_6
4-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.19.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builti
ns-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.20.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.buil
d_script_build.e426b6d0d7889d08-cgu.21.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.22.rcgu.o" "C:\\msys64\\h
ome\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.23.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\rele
ase\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.24.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_
build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.25.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cg
u.26.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.27.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-wi
ndows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.28.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429
f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.29.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_scrip
t_build.e426b6d0d7889d08-cgu.30.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.31.rcgu.o" "C:\\msys64\\home\\we
\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.32.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\bu
ild\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.33.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7
429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.34.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.35.rc
gu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.36.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-g
nu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.37.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6
dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.38.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build
.e426b6d0d7889d08-cgu.39.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.40.rcgu.o" "C:\\msys64\\home\\we\\rust\
\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.41.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\co
mpiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.42.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e
2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.43.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.44.rcgu.o" "
C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.45.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\sta
ge0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.46.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\
build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.47.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6
d0d7889d08-cgu.48.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.49.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\
\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.50.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_
builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.51.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4
a.build_script_build.e426b6d0d7889d08-cgu.52.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.53.rcgu.o" "C:\\msy
s64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.54.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std
\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.build_script_build.e426b6d0d7889d08-cgu.55.rcgu.o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_s
cript_build-7429f31e2b6dfc4a.4zpfcg1jasyai31s.rcgu.o" "-L" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\deps" "-L" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstati
c" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\deps\\libcc-8eebe327d55fceab.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-fe1b463bc1ca115a.rlib" "C:\\msys64\\h
ome\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-16edc4e24e70adcf.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libobject-728ba82bf9fdb181.r
lib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libmemchr-c492326f70748ccc.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libaddr2line-8c
d733efd217074e.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libgimli-4c984e08f5b4447b.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\
librustc_demangle-fd1124a5b7f80f1a.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd_detect-871d12d5e66bd3b0.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86
_64-pc-windows-gnu\\lib\\libhashbrown-583a2ed4731794ed.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-b132f1304efa7e93.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-win
dows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libminiz_oxide-d235d6933c315da4.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libadler-e4fb189ce3d5afce.rlib" "C:\\msys64\\home\\we\\rust\\bui
ld\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-59980d8d2cbbb4f2.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcfg_if-b2401d0e84b8c0e1.rlib" "C:\\msys64\\home\\
we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-149f878a536cd78b.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-1f3ce2f37f0a574b.rlib" "C:\\msys
64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_core-50d2805e0cc19e2f.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-ad2
41f954ca2bfa9.rlib" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-963cb7fdcc89eb90.rlib" "-Wl,-Bdynamic" "-ladvapi32" "-lole32" "-loleaut32" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel
32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\l
ib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-o" "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0-std\\release\\build\\compiler_builtins-7429f31e2b6dfc4a\\build_script_build-7429f31e2b6dfc4a.exe" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "-fuse-ld=lld"
 "C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: collect2.exe: fatal error: cannot find 'ld'
          compilation terminated.

@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 28, 2023

Ok, so it can't find lld from "-fuse-ld=lld". My first idea would be to just pass the absolute path to <snapshot compiler>/(rust-)lld to -fuse-ld=, but I'm not sure if it's that easy? E.g. if there is something that hardcodes its behavior on the exact lld string and then does something LLD-specific.

@petrochenkov
Copy link
Contributor

My first idea would be to just pass the absolute path to <snapshot compiler>/(rust-)lld to -fuse-ld=

-fuse-ld doesn't support absolute paths, it's a deprecated clang extension.

You can look how fn add_lld_args works to guide C compiler to use some specific lld in a more portable way, it's -fuse-ld=lld + -B path.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2023
@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 28, 2023

Thanks, I'll take a look at -B. Since the discussion has moved forward, I think that the first issue that I would like to tackle is unify the usage of snapshot/external lld in bootstrap. So to avoid fragmenting the discussion, I'll close this PR and continue with #116197.

@Kobzol Kobzol closed this Sep 28, 2023
@Kobzol Kobzol deleted the bootstrap-remove-use-lld branch September 28, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants