Commit 496d087
committed
build: include wally in the firmware directly when amalgamating
In many cases we check/assert our arguments before calling wally
functions. By amalgamating wally directly, the compiler can remove
code that redundantly re-checks already asserted conditions.
In some cases further optimizations are possible. For example explicit
rangeproofs do not contain a side channel message and thus the secp code
to generate it (and the 4k stack buffer it uses) can be eliminated.
We perform the wally amalgamation by compiling the external library with
no code, and then including the wally sources in the main firmware
directly. This approach lets us avoid trying to selectively disable the
wally component during amalgamated builds, as this is not supported by
the idf.py build machinery.1 parent e9e000b commit 496d087
File tree
3 files changed
+33
-0
lines changed- components/libwally-core
- main
3 files changed
+33
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| 55 | + | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
5 | 25 | | |
6 | 26 | | |
7 | 27 | | |
| |||
0 commit comments