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

Should integrate cc-rs knowledge of linkers with rustc #693

Open
joshtriplett opened this issue Jul 6, 2022 · 2 comments · May be fixed by #1225
Open

Should integrate cc-rs knowledge of linkers with rustc #693

joshtriplett opened this issue Jul 6, 2022 · 2 comments · May be fixed by #1225

Comments

@joshtriplett
Copy link
Member

rustc currently has limited knowledge of the correct linker to use on various platforms. cc-rs has a much better idea of which linker to use. There's been a long-standing goal that many people have advocated of making the compiler use cc-rs to find the linker; this would fix cross-compilation for many targets.

Filing this issue to track that possibility. There are also corresponding issues on the rustc repo, which this should link to / be linked from.

@dot-asm
Copy link
Contributor

dot-asm commented Jul 11, 2022

many people have advocated of making the compiler use cc-rs to find the linker

If the suggestion is to introduce dependency on cc-rs, then I for one[!] would advocate against it(*). I reckon that rustc would be better off being self-sufficient and maintaining its own cross-compile prefixing scheme(**) and provide a way for cc-rs to use at its discretion. As opposed the other way around. Just in case, I do recognize the sentiment behind the suggestion to let cc-rs decide over rustc, and even found myself wishing for it to be possible multiple times, yet at the same time I recognize the value of rustc being self-sufficient.

(*) Well, there already is a dependency, on Windows, so I suppose this is an argument against widening the dependency.
(**) Yet keep the current way to specify the linker, so that one can override the default for experimental and trouble-shooting purposes.

@dot-asm
Copy link
Contributor

dot-asm commented Jul 11, 2022

there already is a dependency, on Windows

For reference. The dependency on Windows is of different nature. cc-rs helps rustc to find the toolchain components it's looking for, but doesn't tell which components to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants