Comment by seritools
4 years ago
Oh trust me I've thought about that :)
It depends on two things:
- is the supported API surface big enough?
- is there an msvc runtime that can be linked with a somewhat modern linker (so that rust/llvm don't get angry) but that still works under Win32s. I'm not sure that exists, though :c
I know that Win32s requires that the EXE have a RELOC section, so it must be built with relocation enabled.
I hope you don't need to go all the way to /NODEFAULTLIB though, that kind of configuration is a big headache to build on.
Is there a .lib file for "msvcrt.dll" that will work with /NODEFAULTLIB? If so, I wonder if there is a Win32s compatible binary for that.
> that kind of configuration is a big headache to build on
Not really, I've done just that (though in the end I didn't need full /NODEFAULTLIB):
https://github.com/rust9x/rust9x-sample/blob/main/.cargo/con...
With older msvcrt libraries you only need to link `libcmt.lib`/`msvcrt.lib`, that's it. Visual C++ 4.0 is apparently the last version to support Win32s, so if you can make it link to its libraries you might have a chance!
Biggest difference would probably be the complete lack of multithreading.
Win32s applications (like Win16 applications more generally) run in a shared address space with cooperative multitasking. They're basically async applications within an OS-provided runtime.
Oh right, that's also a thing :v