{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1061","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1061/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1061/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1061/events","html_url":"https://github.com/rust-lang/rfcs/issues/1061","id":68204364,"number":1061,"title":"Rust, Windows, and MSVC","user":{"login":"retep998","id":666308,"avatar_url":"https://avatars.githubusercontent.com/u/666308?v=3","gravatar_id":"","url":"https://api.github.com/users/retep998","html_url":"https://github.com/retep998","followers_url":"https://api.github.com/users/retep998/followers","following_url":"https://api.github.com/users/retep998/following{/other_user}","gists_url":"https://api.github.com/users/retep998/gists{/gist_id}","starred_url":"https://api.github.com/users/retep998/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retep998/subscriptions","organizations_url":"https://api.github.com/users/retep998/orgs","repos_url":"https://api.github.com/users/retep998/repos","events_url":"https://api.github.com/users/retep998/events{/privacy}","received_events_url":"https://api.github.com/users/retep998/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/P-high","name":"P-high","color":"eb6420"},{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-tools","name":"T-tools","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"brson","id":147214,"avatar_url":"https://avatars.githubusercontent.com/u/147214?v=3","gravatar_id":"","url":"https://api.github.com/users/brson","html_url":"https://github.com/brson","followers_url":"https://api.github.com/users/brson/followers","following_url":"https://api.github.com/users/brson/following{/other_user}","gists_url":"https://api.github.com/users/brson/gists{/gist_id}","starred_url":"https://api.github.com/users/brson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brson/subscriptions","organizations_url":"https://api.github.com/users/brson/orgs","repos_url":"https://api.github.com/users/brson/repos","events_url":"https://api.github.com/users/brson/events{/privacy}","received_events_url":"https://api.github.com/users/brson/received_events","type":"User","site_admin":false},"milestone":null,"comments":77,"created_at":"2015-04-13T22:02:02Z","updated_at":"2015-10-18T08:58:11Z","closed_at":null,"body":"### Remaining tasks\r\n\r\n* [ ] Improve the quality of PDB debug info with variable and type information.\r\n* [ ] Implement unwinding https://github.com/rust-lang/rust/issues/25869\r\n* [ ] Support `dllimport` properly. https://github.com/rust-lang/rust/issues/27438\r\n* [ ] Completely remove the dependence on the CRT. Consists of `strlen`, `memmove`, `memcpy`, `memcmp`, `memset`, and a bunch of math functions, along with the entry point.\r\n* [ ] Fix library creation so that libraries compiled by `cl` with `/GL` can be linked properly. https://github.com/rust-lang/rust/issues/26003\r\n* [ ] Provide fallback implementations to missing APIs on XP/Vista so that code will still run correctly and not panic. https://github.com/rust-lang/rust/issues/26654\r\n\r\n### Completed tasks\r\n\r\nFixed in https://github.com/rust-lang/rust/pull/25350\r\n\r\n* [x] Support `dllexport`. https://github.com/rust-lang/rust/issues/7196\r\n* [x] Emit PDB debug info on msvc. https://github.com/rust-lang/rust/issues/19533\r\n* [x] Get rid of the dependency on `libgcc` and use native/llvm unwinding stuff. This is definitely important.\r\n* [x] Teach `librustc_back` how to invoke `link.exe`.\r\n* [x] Add code to figure out where MSVC and the Windows SDK is installed.\r\n* [x] Upgrade the Rust build system to be able to build code using the MSVC toolchain rather than the GNU toolchain.\r\n* [x] Add code so that the Rust standard library can be built using only APIs available on XP or Vista. https://github.com/rust-lang/rust/issues/12842\r\n* [x] Do all IO using WinAPI rather than libc, since WinAPI is just a layer of overhead anyway.\r\n\r\n### Wishlist\r\n\r\n* [ ] Add an alternate build system to build Rust that can run on Windows without depending upon MSYS at all.\r\n* [ ] Create a Rust distribution that comes with multiple standard libraries and is able to target various configurations such as whether to use msvc or gnu, or whether to build for 32 or 64 bit.\r\n* [ ] Once `lld` actually works, bundle that instead of `ld`, but when targeting the msvc toolchain use `link` instead when possible. https://github.com/rust-lang/rust/issues/9367\r\n\r\n### Related links\r\n\r\nhttps://github.com/rust-lang/rust/issues/1768"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/148993049","html_url":"https://github.com/rust-lang/rfcs/issues/1061#issuecomment-148993049","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1061","id":148993049,"user":{"login":"alexchandel","id":637714,"avatar_url":"https://avatars.githubusercontent.com/u/637714?v=3","gravatar_id":"","url":"https://api.github.com/users/alexchandel","html_url":"https://github.com/alexchandel","followers_url":"https://api.github.com/users/alexchandel/followers","following_url":"https://api.github.com/users/alexchandel/following{/other_user}","gists_url":"https://api.github.com/users/alexchandel/gists{/gist_id}","starred_url":"https://api.github.com/users/alexchandel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexchandel/subscriptions","organizations_url":"https://api.github.com/users/alexchandel/orgs","repos_url":"https://api.github.com/users/alexchandel/repos","events_url":"https://api.github.com/users/alexchandel/events{/privacy}","received_events_url":"https://api.github.com/users/alexchandel/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T08:58:11Z","updated_at":"2015-10-18T08:58:11Z","body":"@retep998 I've never had success crossing from OSX to 32bit windows via MinGW. The lack of SEH support (I don't think it's acceptable to pass around a `libgcc_s_dw2-1.dll` with your executable) combined with people's love for exceptions gives me segfaults, plus I dislike the idea of installing a binutils for every target I need. Moreover, Rust's `i686-pc-windows-gnu` target ships a Windows binary for `gcc.exe` which can't be natively run on OSX, and LLD doesn't yet play nicely with MinGW's libraries (this week it's giving the error: `-aligncomm:_hInst,2 is not allowed in .drectve`).\r\n\r\nBut this is working well. `CPATH=\"$HOME/i686-pc-windows-msvc-w10/include:$HOME/i686-pc-windows-msvc-vc6/include\"  clang -target i686-pc-windows-msvc -c ...` and `LIB=\"$HOME/i686-pc-windows-msvc-w10/lib;$HOME/i686-pc-windows-msvc-vc6/lib\" link.exe ...` (where `link.exe` is a symlink to LLD) can compile a C Win32 GUI application, and the latter LLD invocation can link a console-based Rust program that grabs screenshots and sends keyboard/mouse events.\r\n\r\nThe trouble was really figuring out which of the infinite permutations would work. I didn't try, but linking against UCRT instead of VC6 may work too. It's too bad Microsoft can't just provide a minimalist zip file that we could redistribute for cross-compiling: the VS2015 download I extracted the Win10 libraries & headers from was multiple gigabytes of bloat."}}