doc: improve building and benching docs for rustc#1283
Conversation
I don't see any reason why do that. Additionally with the currently recommended configuration you'd need to have lld installed or symlink other linker as lld.
|
Opening this as draft to get some feedback while waiting for the rust PR to merge. EDIT: it's merged so I'm marking this as ready for review. |
|
I probably should have tried out the instructions before merging rather than after, but I just tried them and at least on my machine, rustc didn't end up being linked by wild. A bunch of other stuff (build scripts and stuff) did use wild, but not librustc-driver and rustc. When I switched from setting PATH to setting RUSTFLAGS however, it did link with wild, so I think that's a definite improvement from last time I tried. Perhaps due to your change to rustc bootstrap. Building with |
|
Are you sure you pulled the latest changes from rust I just did a clean build and it worked fine. my bootstrap.toml is just: What my change to bootstrap did is — now setting My motivation against setting RUSTFLAGS is the fact that forgetting to set it — will cause a rebuild. Maybe you need to do a fresh build by running |
|
Thanks for the prompt about the master->main rename. I was still on the former. Although I had checked and confirmed that your change showed up when I ran git log. I tried again after pulling the latest changes from main and running To determine what was going on, I ran the build under strace: It looks like clang is invoked for linking and is passed the argument My guess is that clang on my system is configured to find lld at that specific path. So perhaps it's an OS difference. I'm testing on Ubuntu 25.10. |
|
Yeah it might be an OS or clang version difference. I'm on arch & clang 21.1. Anyway, I submitted rust-lang/rust#148795 that will allow putting the rustflags in |
|
FWIW, relying on PATH is pretty unreliable when it comes to overriding linker. It happens to work well for us on Arch Linux, but for example on openSUSE So, a solution that currently works across more distributions would to either use You should also check the tests are using the correct linker (especially For a permanent solution, you can use https://github.com/mati865/wild-proxy, but you will have to remember to rebuilt it for the every change you want to try. |
|
Yeah, I now realize this solution is far from ideal. |
The currently recommended instructions for linking and benchmarking rustc are outdated and don't work.
There isn't any good way of opting out of using lld (so we could symlink default linker to wild) yet in
bootstrap.toml.Instead we can use lld from $PATH using
rust.bootstrap-override-lld = trueonceWe no longer recommend to first build rustc with other linker than wild (see commit c0f337b).