{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/32858","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/32858/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/32858/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/32858/events","html_url":"https://github.com/rust-lang/rust/issues/32858","id":147155665,"number":32858,"title":"Can't cross compile from Linux to Windows (x86_64)","user":{"login":"bozaro","id":2458138,"avatar_url":"https://avatars.githubusercontent.com/u/2458138?v=3","gravatar_id":"","url":"https://api.github.com/users/bozaro","html_url":"https://github.com/bozaro","followers_url":"https://api.github.com/users/bozaro/followers","following_url":"https://api.github.com/users/bozaro/following{/other_user}","gists_url":"https://api.github.com/users/bozaro/gists{/gist_id}","starred_url":"https://api.github.com/users/bozaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bozaro/subscriptions","organizations_url":"https://api.github.com/users/bozaro/orgs","repos_url":"https://api.github.com/users/bozaro/repos","events_url":"https://api.github.com/users/bozaro/events{/privacy}","received_events_url":"https://api.github.com/users/bozaro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-09T19:23:07Z","updated_at":"2016-04-09T19:40:36Z","closed_at":null,"body":"Environment:\r\n\r\n * Ubuntu 16.04 LTS final beta (`lxc-create -n rust -t ubuntu -- --release xenial`)\r\n * Mingw (`apt install mingw-w64`)\r\n * `rustup` tool (`curl https://sh.rustup.rs -sSf | sh`)\r\n * Rust 1.8 and nightly (`rustup default beta`/`rustup default nightly`)\r\n * Rust windows x86_64 toolchain (`rustup target add x86_64-pc-windows-gnu`)\r\n\r\nI create a sample file `hello.rs`:\r\n```rust\r\nfn main() {\r\n    println!(\"Hello, world!\");\r\n}\r\n```\r\n\r\nAnd run compilation:\r\n```sh\r\nrustc -v -C linker=x86_64-w64-mingw32-ld --target x86_64-pc-windows-gnu hello.rs\r\n```\r\n\r\nI expected `hello.exe` file, but has error:\r\n```\r\nerror: linking with `x86_64-w64-mingw32-ld` failed: exit code: 1\r\nnote: \"x86_64-w64-mingw32-ld\" \"-Wl,--enable-long-section-names\" \"-fno-use-linker-plugin\" \"-Wl,--nxcompat\" \"-nostdlib\" \"-m64\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/crt2.o\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o\" \"-L\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib\" \"hello.0.o\" \"-o\" \"hello.exe\" \"-Wl,--gc-sections\" \"-nodefaultlibs\" \"-L\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib\" \"-Wl,-Bstatic\" \"-Wl,-Bdynamic\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-18402db3.rlib\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcollections-18402db3.rlib\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_unicode-18402db3.rlib\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librand-18402db3.rlib\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc-18402db3.rlib\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc_system-18402db3.rlib\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liblibc-18402db3.rlib\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcore-18402db3.rlib\" \"-l\" \"gcc_eh\" \"-l\" \"ws2_32\" \"-l\" \"userenv\" \"-l\" \"shell32\" \"-l\" \"advapi32\" \"-l\" \"compiler-rt\" \"-lmingwex\" \"-lmingw32\" \"-lgcc\" \"-lmsvcrt\" \"-luser32\" \"-lkernel32\" \"/home/ubuntu/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsend.o\"\r\nnote: x86_64-w64-mingw32-ld: unrecognised emulation mode: 64\r\nSupported emulations: i386pep i386pe\r\n\r\nerror: aborting due to previous error\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/207841751","html_url":"https://github.com/rust-lang/rust/issues/32858#issuecomment-207841751","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/32858","id":207841751,"user":{"login":"bozaro","id":2458138,"avatar_url":"https://avatars.githubusercontent.com/u/2458138?v=3","gravatar_id":"","url":"https://api.github.com/users/bozaro","html_url":"https://github.com/bozaro","followers_url":"https://api.github.com/users/bozaro/followers","following_url":"https://api.github.com/users/bozaro/following{/other_user}","gists_url":"https://api.github.com/users/bozaro/gists{/gist_id}","starred_url":"https://api.github.com/users/bozaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bozaro/subscriptions","organizations_url":"https://api.github.com/users/bozaro/orgs","repos_url":"https://api.github.com/users/bozaro/repos","events_url":"https://api.github.com/users/bozaro/events{/privacy}","received_events_url":"https://api.github.com/users/bozaro/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T19:40:36Z","updated_at":"2016-04-09T19:40:36Z","body":"Same issue with Ubuntu 14.04.4 LTS"}}