Repository navigation
64-bit windows build. #1237
Description
Activity
@graydon just following up as you are assigned to this issue (although I can't see when you were assigned unfortunately, and can only assume it was when this issue was made). Are you still planning on completing this? Not volunteering because I don't personally run Windows, just trying to see if there's any progress. Sounds like a pretty significant change and I can't see anything particular holding it back, so it would be nice to see someone finish this off.
The current milestone here is "well-covered", but I think it would be suicide to release 1.0 without supporting the world's most popular desktop platform. It would also completely destroy the notion of ever using Rust for the sort of games that currently require C++. I know we don't currently have a milestone for 1.0, but I'm tempted to reassign this to "backwards-compatible" just to ensure that it doesn't slip.
renominating for production ready
accepted for production-ready milestone
accepted for production-ready milestone
#8488 and #8840 enabled rustc to cross-build for mingw-w64. With cross-built
rustrt.dllandstd-<hash>.dllinsiderustc/x86_64-w64-mingw32/bin/, your rustc can build 64-bit exe.What's missing now:
- morestack. I think it is not so hard, but GS register holds stack range thus it should be maintained.
- stack unwinding. In 64-bit windows, there are two methods available: SJLJ and SEH. (no dwarf!) Also note that win32 SEH and win64 SEH are totally different. I guess llvm supports SJLJ but no SEH. (See also @thadguidry's comment on undefined reference to `__gxx_personality_v0' on Windows Vista 32bit with GCC 4.8.1 #7953) SEH is better, so we have to use it before 1.0 lands.
Also, I think it's better to use mingw-w64 for both win32/win64, to minimize platform difference (e.g. #8663).
I found win64/SEH patchset from LDC (via ldc-developers/ldc#166 and LDC wiki). It is not merged in trunk now, and I don't know any further discussion from LDC or LLVM.
1.0, high
@klutzy, so what's the current status on win64 support?
@vadimcn when I cross-built 64-bit rustc recently (maybe 2 months ago?):
../configure --build=x86_64-w64-mingw32 && make RUSTFLAGS="-Z no-opt"seemed to work.- 64-bit rustc crashed if it is built with optimization flag. It means plain
makecrashes during stage2. - unwinding didn't work. task failure led process exit.
(I used mingw-builds x64 + win32 threads + seh unwinding.)
Currentlysrc/libstd/rt/unwind.rsmay need__gcc_personality_seh0patch, but I guess the status has not changed much.Huh, after rebasing my changes on top of recent rust master, Rust build no longer crashes in stage1 when compiling with optimizations, and gets all the way to compiletest.
I have a branch here, which gets all the way to stage2 and passes almost all tests, when built with RUSTFLAGS="-Z no-opt". Unfortunately, after rebasing on top of the current rust master, it started crashing again while building stage2 libstd :(
Anyhow, I thought some of you folks might be interested. @klutzy, @thadguidry, @alexcrichton, @kvanberendonck
That looks really impressive, nice work! I'd be willing to help you upstream any of those LLVM patches, they all look pretty easily upstream-able.
Ok, now it works on top of current rust master: https://github.com/vadimcn/rust/compare/Win64
The only outstanding issue is "what to do about noreturn functions?"15 remaining items
@vadimcn Landed 64-bit SEH support in LLVM: http://reviews.llvm.org/rL211399.
Thought I'd post an update on the status of win64:
- SEH unwind info emission support has been merged into LLVM master.
- Rust compiler bootstraps up to stage2, but doesn't pass tests (compiletest crashes at startup).
Known problems:
- as mentioned above, compiletest is broken. It seems that the culprit is libgreen: when I switched compiletest to use libnative, it got through many tests, though in the end it hung - after complaining about task 'receiving on a closed channel'.
debug info is broken- nevermind: line numbers are also broken in the latest nightly
I've published the current state of my repo in on github: https://github.com/vadimcn/rust/commits/Win64. To build it you'll need to fetch LLVM master and run configure --build=x86_64-w64-mingw32.
Now somebody's gonna have to set up a build bot for it . 😉
- added a commit that references this issue
on Apr 19, 2015 - added a commit that references this issue
on Dec 30, 2024 - added a commit that references this issue
on Jan 2, 2025
Currently the windows build is 32-bit only. This is mostly a matter of figuring out the right build environment and editing the Makefiles, though there may be some changes needed to the x86_64 assembly as the windows calling convention is not the same as the one used on Mac and linux.