Forward -B linker search path in thin/patch link args on Linux#5443
Merged
jkelleyrtp merged 1 commit intoDioxusLabs:mainfrom Apr 3, 2026
Merged
Forward -B linker search path in thin/patch link args on Linux#5443jkelleyrtp merged 1 commit intoDioxusLabs:mainfrom
-B linker search path in thin/patch link args on Linux#5443jkelleyrtp merged 1 commit intoDioxusLabs:mainfrom
Conversation
jkelleyrtp
approved these changes
Apr 3, 2026
6fdb67f to
2895c22
Compare
Contributor
Author
|
@jkelleyrtp formatted! |
Member
|
Thanks!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since Rust 1.86, the toolchain injects two flags when linking on Linux to use the bundled lld instead of the system
ld:B/path/to/rustup/.../gcc-ld— tellsccwhere to find linker programsfuse-ld=lld— tellsccto select lldThe fat link captures the full set of args from the initial cargo build and replays them verbatim, so it already picked up both flags and worked correctly on systems without binutils installed.
The patch link (thin) builds its own arg list in
thin_link_args. It forwarded-fuse-ldbut not-B, socc -fuse-ld=lldcould not locateld.lldfrom the Rust toolchain and fell back to the systemld, failing with:Fix: add
-Bto the pass-through filter so the patch linker invocation forwards the same gcc-ld search path that cargo injects.Implementation notes - Rust RFC
Thanks to:
I tested it on MacOS 23.3.1(a) with Rust 1.93