rust-embedded / cargo-binutils

Cargo subcommands to invoke the LLVM tools shipped with the Rust toolchain
Apache License 2.0
474 stars 41 forks source link

cargo-size (any maybe others?) seem to not pass along -Z flags appropriately #139

Open jamesmunns opened 8 months ago

jamesmunns commented 8 months ago

I noticed that passing -Z flags seems not to work as I expect:

cargo build --release -Z build-std=core -Z build-std-features=panic_immediate_abort --target thumbv7em-none-eabi && arm-none-eabi-size target/thumbv7em-none-eabi/release/redacted
    Finished release [optimized + debuginfo] target(s) in 0.13s
   text     data      bss      dec      hex  filename
  15448       56   205248   220752    35e50  target/thumbv7em-none-eabi/release/redacted

cargo size --release -Z build-std=core -Z build-std-features=panic_immediate_abort --target thumbv7em-none-eabi
    Finished release [optimized + debuginfo] target(s) in 0.10s
   text     data      bss      dec      hex  filename
  19688       56   205248   224992    36ee0  redacted

cargo size --release --target thumbv7em-none-eabi 
    Finished release [optimized + debuginfo] target(s) in 0.10s
   text    data     bss     dec     hex filename
  19688      56  205248  224992   36ee0 redacted

In the second invocation, the size SHOULD be the same, but 19K is what I see when I don't enable build-std(-features).

Emilgardis commented 8 months ago

This should be fixed on the master branch with #128, we've just not had a release since then. Not sure why

Coekjan commented 7 months ago

I also met this problem today.