I have noticed that binaries on linux (fedora & ubuntu) resulted from cargo build --release is way bigger than them on macOS. for example compiling this package on linux results in 4.8M but on my macOS it's just 1.4M.
Is there a reason for this to happen, and how can I achieve that small size binary on linux?
It may be that the linux build uses more static linking, so it's embedding more code in the binary? Is there much difference when you see what libraries are linked to dynamically using ldd?
I tried this out on my laptop with that repo and cross-compiling with cross for both windows and linux (I don't have access to a mac, and cross doesn't yet support x86_64-apple-darwin).