hello-rs icon indicating copy to clipboard operation
hello-rs copied to clipboard

Windows: use #![no_std]

Open FaultyRAM opened this issue 10 years ago • 0 comments

I've rewritten the Windows version to use #![no_std], shaving off roughly 200 bytes.

Notes:

  • #![no_std] executables are unstable, so this now requires nightly Rust for the time being.
  • In line with the above, the Cargo dependencies on winapi and kernel32-sys had to be replaced with hand-written FFI bindings because they aren't #![no_std], which caused rustc to pull in a ton of dependencies and then fail to build the executable anyway. It might be worth investigating if the winapi crates can be #![no_std].
  • /SUBSYSTEM:CONSOLE /NODEFAULTLIB now need to be passed to the linker. This removes dependencies on the CRT and other libraries that are normally linked in by default.

FaultyRAM avatar Apr 18 '16 18:04 FaultyRAM