Is it possible to change the CRT Rust links to on Windows MSVC?


#1

I’m currently experimenting with targeting Windows UWP. One of the major differences I’ve found when looking at the compile process for a simple C++ command line app for both, UWP and desktop, is the CRT that is linked to:
UWP apps link to vccorlib140_app and vcruntime140_app whereas desktop apps don’t have the _app suffix. There’s also some additional compiler/linker flags when targeting UWP.

Is it possible to somehow hijack the build process to accomplish this sort of thing or is it hardcoded somewhere in libstd or compiler code? I’m not quite sure how the CRT and the vcruntime are used in Rust executables, are there any resources/reference for it?


#2

Currently linking to the CRT is handled by the libc crate, which is a dependency of std. The correct solution is to write RFCs and pull requests to add UWP as a set of new targets to Rust. The hacky solution is to either go the #![no_std] route using just core and winapi, or to use a custom build of std.

If you do pursue this either way, please reach out to me in #winapi on mozilla IRC. I really want to get winapi usable for UWP applications.