-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make MSVC detection ludicrously robust #31158
Conversation
307d8f4
to
6fe9688
Compare
Should fix a few more edge cases Signed-off-by: Peter Atashian <retep998@gmail.com>
6fe9688
to
ff6e555
Compare
"arm" => Some("x86_arm"), | ||
_ => None, | ||
fn bin_subdir(arch: &str) -> Vec<(&'static str, &'static str)> { | ||
if let Some(host) = host_arch() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some comments why this is necessary? It's not clear to me at least what the benefit is of not using cfg(target_arch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, if we're a 32-bit rustc on a 64-bit computer, we can take advantage of the amd64_x86
linker which has increased address space and performance so it can link very large projects with ease.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok that sounds reasonable to me, yeah. Can you add some documentation to that effect?
Closing due to inactivity, but feel free to resubmit with comments addressed! |
VS 15 preview has come out so I intend to update this PR to support it. |
Make MSVC detection ludicrously robust Resurrection of #31158 r? @alexcrichton
Should fix a few more edge cases.
By using
Option
all the way down the rabbit hole this code can now fallback to older versions of MSVC if a newer version doesn't contain the necessary things.Also prefers the linker whose host matches the system's architecture instead of target_arch, but can also fallback from amd64 to x86 as the host.
cc #31151
r? @alexcrichton