Binary is way bigger on linux than on macOS


#1

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?


#2

Try to strip it.

This is a known issue https://github.com/rust-lang/rust/issues/46034.