Add initial MinGW support#60
Conversation
|
I've realized there's no i686-rust9x-windows-msvc target. Would it be okay to drop the i686-rust9x-windows-gnu target? That would leave only two new targets: i586-rust9x-windows-gnu and x86_64-rust9x-windows-gnu. Edit: I was wrong, I missed it. Previous Jookia was right. |
This commit introduces the following targets: - x86_64-rust9x-windows-gnu: 64-bit Windows XP onwards - i686-rust9x-windows-gnu: i686 Windows NT4/98 onwards - i586-rust9x-windows-gnu: i586 Windows NT4/98 onwards The MinGW target has a higher minimum OS version for a two reasons: 1. MSVCRT is expected to be shipped with the operating system 2. pthreads requires NT4 functions
An earlier Rust9x patch (see Fixes:) changes the function signature for hashmap_random_keys. This breaks cross-compiling on Linux. Modify the Linux code to use the new signature as a fix. Fixes: cd6c320
The Rust bootstrap code currently tries to build the rtstartup objects using a stage0 compiler because it's a bit more convenient. The stage0 compiler doesn't know about rust9x targets so instruct it to use a compiler we've built instead.
Windows Vista onwards implements APIs to handle initializing values once. Use a double-lock on Rust9x for backwards compatibility.
seritools
left a comment
There was a problem hiding this comment.
looking good! one small nit, otherwise good to go!
| let pending = self.pending.load(Acquire); | ||
| if pending == false { |
There was a problem hiding this comment.
nit: could store initialized instead, preventing the inverted logic here (and have the initial state be zero instead of 1)
There was a problem hiding this comment.
I kind of wanted to match the the logic from the other code but yeah I can update this.
There was a problem hiding this comment.
ah i see, that makes sense -- std Once also seems to agree:
rust/library/std/src/sys/sync/once/futex.rs
Lines 19 to 22 in 25a5ea7
am convinced, can stay as is ^^
There was a problem hiding this comment.
also, if !pending would be better I guess?
There was a problem hiding this comment.
It's a somewhat stylistic choice but I wanted to match the other functions pending == c::FALSE.
If it really matters I can do a PR for it.
|
Alright! I'll give it a day or two to sit and fix the nit and anything else you think of. I'll open some other PRs in the mean time. If @cher-nov has any other input that would be good. :) |
| let pending = self.pending.load(Acquire); | ||
| if pending == false { |
There was a problem hiding this comment.
ah i see, that makes sense -- std Once also seems to agree:
rust/library/std/src/sys/sync/once/futex.rs
Lines 19 to 22 in 25a5ea7
am convinced, can stay as is ^^
|
Yay! |
Here's the initial MinGW support. It is missing:
I will write up some instructions when it's a little more mature, hopefully that could be added to the wiki. I'm happy to write instructions for anyone for the purposes of testing and review.