Compiled on RPI3B with 6.1.25-piCore-v7 with F2FS filesystem Append this section to the bottom of Cargo.toml [profile.release] opt-level = "z" # Optimize for size. "s" is a synonym (opt-level = "s") lto = true codegen-units = 1 panic = 'abort' strip = true Compile: # default (first time, it need time to download certain files to the system, second round is faster if you messed up something for the first time) time cargo build --release real 33m 5.34s user 39m 28.37s sys 2m 2.22s install -Dm755 target/release/cbindgen /tmp/packing-cbindgen/usr/local/bin/cbindgen