tkey-libs: Optimize for size

Optimize tkey-libs for size to fit firmware in ROM
This commit is contained in:
Michael Cardell Widerkrantz 2025-04-08 13:30:05 +02:00 committed by Mikael Ågren
parent 353d7e9f50
commit 1be5140850
No known key found for this signature in database
GPG key ID: E02DA3D397792C46
2 changed files with 12 additions and 2 deletions

View file

@ -122,7 +122,17 @@ official version tag.
Easiest is probably to just remove the tkey-libs directory and then
git clone the desired tag. Use the entire repo, but remove the .-files
like `.git`, `.github`, et cetera.
like `.git`, `.github`, et cetera. Something like:
```
$ rm -rf tkey-libs
$ git clone git@github.com:tillitis/tkey-libs.git
$ cd tkey-libs
$ git checkout fw-3
```
Note that you need to change the optimization flag in the tkey-libs'
Makefile to `-Os`.
## Measured boot

View file

@ -17,7 +17,7 @@ INCLUDE=include
# either of them. You don't need to recompile tkey-libs.
CFLAGS = -target riscv32-unknown-none-elf -march=rv32iczmmul -mabi=ilp32 \
-mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common \
-mcmodel=medany -static -std=gnu99 -Os -ffast-math -fno-common \
-fno-builtin-printf -fno-builtin-putchar -nostdlib -mno-relax -flto \
-Wall -Werror=implicit-function-declaration \
-I $(INCLUDE) -I .