Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative strip: llvm-strip via cargo-binutils #15

Closed
ZeroErrors opened this issue Jun 12, 2020 · 4 comments
Closed

Alternative strip: llvm-strip via cargo-binutils #15

ZeroErrors opened this issue Jun 12, 2020 · 4 comments

Comments

@ZeroErrors
Copy link

Consider adding cargo-binutils to the README. It provides easy to use cargo commands for a few llvm tools that can be installed via rustup. These tools work for quite a few platforms including windows and is easy to get setup if you use rustup for your rust toolchain.

$ rustup component add llvm-tools-preview
$ cargo install cargo-binutils
$ cargo strip

The cargo-binutils cargo commands automatically handle building the project if needed as well as finding and passing the target binary path to the tool. They also support the majority of the command line options that cargo build does to make the tools as intuitive as using cargo itself.

Also provides access to llvm-size via cargo size.

https://github.com/rust-embedded/cargo-binutils

Disclaimer: I recently did a little bit of work on cargo-binutils to make it easier to use and more closely match the built in cargo commands, and the README is a little out of date because of that.

@yoshuawuyts
Copy link

yoshuawuyts commented Jun 12, 2020

llvm strip should be available directly from Cargo on nightly as well through rust-lang/cargo#8246. I believe the syntax to run it is:

$ cargo +nightly build -Z strip=symbols

@johnthagen
Copy link
Owner

johnthagen commented Jun 12, 2020

@yoshuawuyts It'd like to add the reference to the nightly flag, as it's pretty simple to use (and hopefully is what is stabilized eventually).

Do you happen to know which nightly was the earliest it's available in?

@yoshuawuyts
Copy link

yoshuawuyts commented Jun 12, 2020

@johnthagen this was merged on may 27th, so that would be the 1.45 nightlies. I tried finding the exact nigthly on forge but couldn't find it -- mentioning something like: "Available starting 1.45.0-nightly (2020-05-28)" should be good enough I think.

@johnthagen
Copy link
Owner

Fixed in 1c13bc6.

Thanks @ZeroErrors and @yoshuawuyts for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants