SFT-4381: Emit debugging information.
What changed, and why it matters
This commit adds compiler debugging symbols to the firmware build and uploads the resulting ELF file as a build artifact. It does not change the shipped firmware binary, runtime behavior, or introduce any security weakness. It is a developer convenience change.
No security action required. This is a benign build/debugging infrastructure change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change adds -g to CFLAGS in ports/stm32/Makefile, which causes the compiler to include DWARF debugging information in the ELF object. The GitHub workflow is updated to upload ports/stm32/build-Passport/firmware.elf as an artifact. The commit message explicitly states this does not affect final binary size and the ELF is for developer use only. The actual firmware binary shipped to devices remains unchanged.
Changed components
ports/stm32/Makefile.github/workflows/build.yamlInspect captured patch +16 / −0
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 0844ca4..005a820 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -58,6 +58,12 @@ jobs:
env:
SIGNING_KEY: ${{ secrets.UserSigningKey }}
+ - name: Upload firmware ELF
+ uses: actions/upload-artifact@v4
+ with:
+ name: v${{env.version}}${{ matrix.build.suffix }}.elf
+ path: ports/stm32/build-Passport/firmware.elf
+
- name: Upload firmware (unsigned)
uses: actions/upload-artifact@v4
with:
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index e538214..2214df2 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -151,6 +151,16 @@ else
COPT += -O2 -DNDEBUG
endif
+# FOUNDATION CHANGE: BEGIN
+#
+# Instead of using DEBUG=1 (which defines -DPENDSV_DEBUG) which is not
+# necessary, just enable debugging information generation directly.
+#
+# This does not affect the final binary size, only the ELF file which
+# should only be used by developers.
+CFLAGS += -g
+# FOUNDATION CHANGE: END
+
# Flags for optional C++ source code
CXXFLAGS += $(filter-out -Wmissing-prototypes -Wold-style-definition -std=gnu99,$(CFLAGS))
CXXFLAGS += $(CXXFLAGS_MOD)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.