Skip to content

debug: separate DEBUG and QEMU build configs, add DEBUG linker script - #102

Merged
jthornblad merged 1 commit into
mainfrom
split_debug
Jul 10, 2026
Merged

debug: separate DEBUG and QEMU build configs, add DEBUG linker script#102
jthornblad merged 1 commit into
mainfrom
split_debug

Conversation

@jthornblad

@jthornblad jthornblad commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Split QEMU and DEBUG into distinct build modes for tkey_app and tkey_uecc: QEMU keeps -O0/-g3/-mno-relax for debugging under QEMU, while DEBUG now builds with -Oz/-mrelax/-flto and lld's --icf=safe/--relax-gp for a smaller, relaxed release-like debug build (was previously sharing QEMU's unoptimized flags)
  • Add tkey_debug.ld linker script (128 KB RAM) for the new DEBUG target, separate from tkey_qemu.ld (1 MB) and the default tkey.ld
  • Add tkey_uecc_qemu.mk / tkey_uecc_qemu.a as its own uECC build target for QEMU, decoupled from tkey_uecc_debug.mk
  • Rename tkey_uecc_debug.mk's define from QEMU_DEBUG to TKEY_DEBUG to match its new DEBUG-only role
  • Minor cleanup: drop stale commented-out flags, fix indentation in tkey_qemu.ld and tkey_uecc.mk

Type of change

Please tick any that are relevant to this PR and remove any that aren't.

  • Bugfix (non breaking change which resolve an issue)
  • Feature (non breaking change which adds functionality)
  • Breaking Change (a change which would cause existing functionality to not work as expected)
  • Documentation (a change to documentation)

Submission checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my changes
  • I have tested and verified my changes on target
  • My changes are well written and CI is passing
  • I have squashed my work to relevant commits and rebased on main for linear history
  • I have added a "Co-authored-by: x" if several people contributed, either pair programming or by squashing commits from different authors.
  • I have updated the documentation where relevant (readme, dev.tillitis.se etc.)
  • QEMU is updated to reflect changes

@jthornblad
jthornblad requested a review from dehanj July 10, 2026 11:58
Comment thread targets/tkey_app.mk Outdated
TARGET_ASFLAGS += -O0
TARGET_ASFLAGS += -g3
else ifdef DEBUG
TARGET_ASFLAGS += -mrelax

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make comment that tkey-libs also should be built with -mrelax

- Split QEMU and DEBUG into distinct build modes for tkey_app and
  tkey_uecc: QEMU keeps -O0/-g3/-mno-relax for debugging under QEMU,
  while DEBUG now builds with -Oz/-mrelax/-flto and lld's
  --icf=safe/--relax-gp for a smaller, relaxed release-like debug
  build (was previously sharing QEMU's unoptimized flags)
- Add tkey_debug.ld linker script (128 KB RAM) for the new DEBUG
  target, separate from tkey_qemu.ld (1 MB) and the default tkey.ld
- Add tkey_uecc_qemu.mk / tkey_uecc_qemu.a as its own uECC build
  target for QEMU, decoupled from tkey_uecc_debug.mk
- Rename tkey_uecc_debug.mk's define from QEMU_DEBUG to TKEY_DEBUG
  to match its new DEBUG-only role
- Minor cleanup: drop stale commented-out flags, fix indentation in
  tkey_qemu.ld and tkey_uecc.mk
@jthornblad
jthornblad merged commit 162031c into main Jul 10, 2026
2 of 5 checks passed
@jthornblad
jthornblad deleted the split_debug branch July 10, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants