LedgerHQ / nanos-secure-sdk

Secure (ST31) SDK for Ledger Nano S
Apache License 2.0
96 stars 54 forks source link

How to optimize app binary size like official builds? #20

Closed danuker closed 5 years ago

danuker commented 5 years ago

I tried to load Bitcoin 1.3.7, Bitcoin Cash 1.3.7, and Ethereum 1.1.9 from the source code of ledger-app-btc and ledger-app-eth.

They do not fit at the same time. However, if I install via Ledger Live, they DO fit! This is strange.

Is there a way to get them work from the source code at the same time, on a Nano S? Perhaps via some compiler optimization?

danuker commented 5 years ago

I looked at the generated bin/app.hex and bin/app.elf files in ledger-app-btc, and noticed that they kept the same size for BTC and BCH, which seemed fishy.

Cleaning everything then rebuilding BCH (make clean then COIN=bitcoin_cash make again) created a much smaller hex and elf file, which allowed me to push all three of Bitcoin, Bitcoin Cash, and Ethereum to my wallet.

Cheers!