Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upmsvc: Enable unwinding, improve finding link.exe #26741
Conversation
alexcrichton
added some commits
Jun 29, 2015
rust-highfive
assigned
nikomatsakis
Jul 2, 2015
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
r? @brson cc @retep998 -- lots of windows registry stuff |
rust-highfive
assigned
brson
and unassigned
nikomatsakis
Jul 2, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Trawling the registry to find linker and SDK libraries is... unorthodox and is likely to break with future versions, but I guess you already know that. Otherwise, lgtm. Sadly, I cannot propose a better way of detecting VC's install location. |
This comment has been minimized.
This comment has been minimized.
|
Regarding unwinding: if the goal is to get rid of libgcc dependency, we could implement Itanium-style LSDA parser in rust_eh_personality and thus avoid all the trouble associated with MSVC-style landing pads. |
This comment has been minimized.
This comment has been minimized.
|
Yeah I was a little uneasy probing the registry, but it's what clang does so I didn't feel too too bad about it (ish) I also actually started a branch a long time ago to just write the necessary portions of libgcc in Rust, but it ended up getting super hairy super quickly. I want to believe that LLVM support will become more robust/rock solid over the next few months, but if it ends up languishing too much then we can definitely look again into doing the libgcc-like stuff. |
This comment has been minimized.
This comment has been minimized.
Which bits of it got hairy? CPU context management? Did you try to do it just for Windows or for all platforms? |
This comment has been minimized.
This comment has been minimized.
|
Oh no I was only trying for 64-bit MSVC Windows. I found that the rabbit hole kept getting deeper and deeper and look liked it was going to be quite a chunk of code, so I bailed out. This is when I was initially adding MSVC support though so I wasn't expecting it to be a large dive. In isolation it may not be so bad today? |
This comment has been minimized.
This comment has been minimized.
|
I checked over the registry ffi definitions and they seem correct. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton commentedJul 2, 2015
This PR was originally going to be a "let's start running tests on MSVC" PR, but it didn't quite get to that point. It instead gets us ~80% of the way there! The steps taken in this PR are:
link.exe) is now looked up in the Windows Registry if it's not otherwise available in the environment. This improves using the compiler outside of a VS shell (e.g. in a MSYS shell or in a vanilla cmd.exe shell). This also makes cross compiles via Cargo "just work" when crossing between 32 and 64 bit!run-passtests were fixed.rust_builtinlibrary was removed entirely for MSVC to try to prevent anycl.execompiled objects get into the standard library. This should help us later remove any dependence on the CRT by the standard library.rust_try_msvc_32.llfor 32-bit MSVC and ensured that landing pads were turned off by default there as well.Despite landing pads being enabled, there are still many failing tests on MSVC. The two major classes I've identified so far are:
ld -rto assemble them into one object file. The MSVC linker, however, does not have this ability, and this will need to be rearchitected to work on MSVC.I will fix parallel codegen in a future PR, and I'll also be watching LLVM closely to see if the aborts... disappear!