rust-cross / rust-musl-cross

Docker images for compiling static Rust binaries using musl-cross
MIT License
620 stars 68 forks source link

Strip #9

Closed xoac closed 6 years ago

xoac commented 6 years ago

Hi, I was wondering how I could cross strip my final application just using this docker image? Anybody know about existing cross striping? or maybe some [profile.release] configuration (can rustc strip by itself?)

dbrgn commented 6 years ago

I'd also be interested in a strip option 🙂

messense commented 6 years ago

Sorry for late response. I think musl comes with strip command prefix with target name, for example x86_64-unknown-linux-musl-strip, you can use it to strip binary.

xoac commented 6 years ago

I use this function added to .zshrc hope it can also work with .bashrc

rust-musl_strip-armv7() {
    docker run --rm -it -v "$(pwd)":/home/rust/src messense/rust-musl-cross:armv7-musleabihf musl-strip /home/rust/src/target/armv7-unknown-linux-musleabihf/release/"$1"
}

And use like this:

rust-musl_strip-armv7 BINARY_TO_STRIP 
JimChenWYU commented 1 year ago

hello, how can I to know what different between musl-strip and strip(from GNU Binary Utilities)?