hello-rs
hello-rs copied to clipboard
Windows: use #![no_std]
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 /NODEFAULTLIBnow need to be passed to the linker. This removes dependencies on the CRT and other libraries that are normally linked in by default.