Open
Description
I have a library and and app using the library, and compiling for AVR target using avr-gcc
. It's seem to be overflowing the device so I want to check stack usage. I tried building my library which is pure rust and got:
$ RUSTFLAGS="-Z emit-stack-sizes" cargo build --lib -r
...
$ size -A target/release/libnoble_secp256k1.rlib | grep -A1 -B1 double
.text 0 0
.text._ZN15noble_secp256k15point5Point17double_assign_mod17h64c79c0a4005e01fE 3040 0
.stack_sizes 10 0
which makes no sense as the function works with 64-byte numbers, and does a few allocations. I turned to cargo-call-stack
and as it doesn't support AVR either (japaric/cargo-call-stack#92), I chose an ARM target to view call-stack
output:
so according to cargo-call-stack
which uses emit-stack-sizes
under the hood, the same function double_assign_mod
uses 1424 bytes, which makes more sense.
related:
- Tracking issue for -Z emit-stack-sizes #54192
- Any chance of supporting AVR? japaric/cargo-call-stack#92
rustc --version --verbose
:
nightly-2022-07-10