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

Make MSVC detection ludicrously robust #31158

Closed
wants to merge 1 commit into from

Conversation

retep998
Copy link
Member

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

@retep998 retep998 force-pushed the please-be-robust-already branch 2 times, most recently from 307d8f4 to 6fe9688 Compare January 24, 2016 05:27
Should fix a few more edge cases

Signed-off-by: Peter Atashian <[email protected]>
"arm" => Some("x86_arm"),
_ => None,
fn bin_subdir(arch: &str) -> Vec<(&'static str, &'static str)> {
if let Some(host) = host_arch() {
Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member

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?

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to resubmit with comments addressed!

@retep998
Copy link
Member Author

VS 15 preview has come out so I intend to update this PR to support it.

bors added a commit that referenced this pull request Jul 2, 2016
Make MSVC detection ludicrously robust

Resurrection of #31158

r? @alexcrichton
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 this pull request may close these issues.

2 participants