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

msvc: pass -Thost=x64 when compiling x64 target #57

Merged
merged 1 commit into from
Sep 6, 2018
Merged

msvc: pass -Thost=x64 when compiling x64 target #57

merged 1 commit into from
Sep 6, 2018

Conversation

jordanrh1
Copy link
Contributor

If you try to build rust for --host x86_64-pc-windows-msvc, you will receive the following error when it tries to compile llvm:

Visual Studio generators use the x86 host compiler by
default, even for 64-bit targets. This can result in linker
instability and out of memory errors. To use the 64-bit
host compiler, pass -Thost=x64 on the CMake command line.

This change passes -Thost=x64 to cmake when compiling for x64, which eliminates the error.

@alexcrichton alexcrichton merged commit a015caa into rust-lang:master Sep 6, 2018
@alexcrichton
Copy link
Member

Thanks!

@alexcrichton
Copy link
Member

Er actually, shouldn't this match on the host target rather than the target target?

@jordanrh1
Copy link
Contributor Author

Pretty sure 'target' in this case refers to the host target. When I cross compile to thumbv7a-pc-windows-msvc, 'target' is x86_64-pc-windows-msvc.

@alexcrichton
Copy link
Member

Hm are you sure? That's what the host variable is for (the host, whereas target should be thumbv7a)

@jordanrh1
Copy link
Contributor Author

I'm sure. target gets passed to visual_studio_generator(), which uses target to determine which visual studio generator to use. The generated visual studio project targets the host architecture.

@alexcrichton
Copy link
Member

Ah ok I think we're talking about different things, I assumed that we'd pass this argument for all compiles (even if you're cross-compiling) to use the 64-bit host compiler by default. But it sounds like what you're targeting this patch for is to only use the 64-bit host compiler when targeting a 64-bit platform, which is also fine.

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