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

rustc: Add an i586-pc-windows-msvc target #32034

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

alexcrichton
Copy link
Member

Similarly to #31629 where an i586-unknown-linux-gnu target was added, there is
sometimes a desire to compile for x86 Windows as well where SSE2 is disabled.
This commit mirrors the i586-unknown-linux-gnu target and simply adds a variant
for Windows as well.

This is motivated by a recent Gecko bug where crashes were seen on 32-bit
Windows due to users having CPUs that don't support SSE2 instructions. It was
requested that we could have non-SSE2 builds of the standard library available
so they could continue to use vanilla releases and nightlies.

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @brson

@rust-highfive rust-highfive assigned brson and unassigned aturon Mar 4, 2016
@MagaTailor
Copy link

On the off-chance someone actually tries to create binaries with this target or even bootstrap rustc (and not just libstd) I'd advise putting explicit C(XX)FLAGS in the mk file.

I have no idea about msvc's default codegen on 32-bit but it's probably not i586.

pub fn target() -> Target {
let mut base = super::i686_pc_windows_msvc::target();
base.options.cpu = "pentium".to_string();
base.llvm_target = "i586-pc-windows-mscv".to_string();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be i586-pc-windows-msvc instead of -mscv?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, indeed!

@froydnj
Copy link
Contributor

froydnj commented Mar 4, 2016

I have no idea about msvc's default codegen on 32-bit but it's probably not i586.

VS2012+ defaults to SSE2 codegen, so it would be a good idea to force that off.

@alexcrichton
Copy link
Member Author

Appears I misread the docs and SSE2 is indeed enabled by default.

Similarly to rust-lang#31629 where an i586-unknown-linux-gnu target was added, there is
sometimes a desire to compile for x86 Windows as well where SSE2 is disabled.
This commit mirrors the i586-unknown-linux-gnu target and simply adds a variant
for Windows as well.

This is motivated by a recent [Gecko bug][ff] where crashes were seen on 32-bit
Windows due to users having CPUs that don't support SSE2 instructions. It was
requested that we could have non-SSE2 builds of the standard library available
so they could continue to use vanilla releases and nightlies.

[ff]: https://bugzilla.mozilla.org/show_bug.cgi?id=1253202
@rillian
Copy link
Contributor

rillian commented Mar 4, 2016

FWIW it looks like we build gecko with /arch:IA32 except for sse(2)-specific optimization files which are compiled but whose entry points are gated by runtime cpuid detection.

@alexcrichton
Copy link
Member Author

Thanks for the info @rillian! We don't actually have any C code in the standard library right now for MSVC, so it's not a big worry for us, but keeps us compatible into the future if we ever add any.

@rillian
Copy link
Contributor

rillian commented Mar 4, 2016

jemalloc doesn't end up in the std library binaries?

@alexcrichton
Copy link
Member Author

Not for MSVC, no, we never figured out how to build it

@rillian
Copy link
Contributor

rillian commented Mar 4, 2016

Ok, thanks!

@rillian
Copy link
Contributor

rillian commented Mar 11, 2016

@aturon @brson review ping on this?

@aturon
Copy link
Member

aturon commented Mar 11, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented Mar 11, 2016

📌 Commit 01a2a7f has been approved by aturon

@bors
Copy link
Contributor

bors commented Mar 11, 2016

⌛ Testing commit 01a2a7f with merge 40c85cd...

bors added a commit that referenced this pull request Mar 11, 2016
rustc: Add an i586-pc-windows-msvc target

Similarly to #31629 where an i586-unknown-linux-gnu target was added, there is
sometimes a desire to compile for x86 Windows as well where SSE2 is disabled.
This commit mirrors the i586-unknown-linux-gnu target and simply adds a variant
for Windows as well.

This is motivated by a recent [Gecko bug][ff] where crashes were seen on 32-bit
Windows due to users having CPUs that don't support SSE2 instructions. It was
requested that we could have non-SSE2 builds of the standard library available
so they could continue to use vanilla releases and nightlies.

[ff]: https://bugzilla.mozilla.org/show_bug.cgi?id=1253202
@bors
Copy link
Contributor

bors commented Mar 11, 2016

💔 Test failed - auto-win-gnu-64-opt

@alexcrichton
Copy link
Member Author

@bors: retry

On Fri, Mar 11, 2016 at 12:22 AM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-gnu-64-opt
http://buildbot.rust-lang.org/builders/auto-win-gnu-64-opt/builds/3360


Reply to this email directly or view it on GitHub
#32034 (comment).

@bors bors merged commit 01a2a7f into rust-lang:master Mar 11, 2016
@alexcrichton alexcrichton deleted the old-x86-msvc branch March 11, 2016 23:12
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.

8 participants