Use RUSTC_LINKER's prefix as last resort for prefix_for_target().#685
Merged
thomcc merged 1 commit intorust-lang:mainfrom Oct 26, 2022
Merged
Use RUSTC_LINKER's prefix as last resort for prefix_for_target().#685thomcc merged 1 commit intorust-lang:mainfrom
thomcc merged 1 commit intorust-lang:mainfrom
Conversation
55c8697 to
9f86471
Compare
9f86471 to
9a77fbe
Compare
thomcc
approved these changes
Oct 26, 2022
Member
thomcc
left a comment
There was a problem hiding this comment.
This seems very reasonable to me.
| // Put aside RUSTC_LINKER's prefix to be used as last resort | ||
| let rustc_linker = self.getenv("RUSTC_LINKER").unwrap_or("".to_string()); | ||
| // let linker_prefix = rustc_linker.strip_suffix("-gcc"); // >=1.45.0 | ||
| let linker_prefix = if rustc_linker.len() > 4 { |
Member
There was a problem hiding this comment.
I'd probably implement this as if rustc_linker.ends_with("-gcc") { ... }, but I don't really think this needs to be done here (I probably will be making a case for bumping cc-rs's MSRV in coherence with whatever we decide in rust-lang/libs-team#72, so I don't think this needs to be bad for that long).
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.
User-provided cross-linker is a working cross-compiler with a perfectly usable prefix. Usable in the prefix_for_target() context that is. One can wonder if it's possible to even remove the majority of the mapping table... (I write "majority" because *-windows-gnu [and no-std?] users are excused from configuring cross-linker.) Potentially fixes #666 and #637. [
Possibly even #654.To help #654 one would have to remove the musl mappings. So that the fallback is actually fallen on.]