Closed BlueberryWolf closed 3 weeks ago
It may not be the best solution to the issue (if it can even be considered one), but it is nice to see a smaller file size for the loader dll.
To compress the binary, I used the following command:
upx --best --lzma loader.dll
cargo bloat reports the following:
I am not stripping the binary, making panic abort, or using UPX, but I'd be willing to try the other things. UPX as a packer tends to set off antimalware.
LTO only shaves ~500kb off of the DLL, which isn't worth it for the risk of unknown compiler flags, so I probably won't do this.
By using some rust compiler flags, and packing the loader with UPX, I managed to reduce the file size to 514kb (from 2MB)
UPX compresses your binary, and can be unpacked, and is therefore non-destructive
I did not thoroughly research the compiler flags I used, and therefore use them with caution.
I found this convenient info from the following guide: min-sized-rust