fix(core): fix build with --debug option
What changed, and why it matters
This commit fixes a build failure that occurred when compiling Trezor firmware with the --debug option. It adds explicit references to the 'sys' Rust module so the linker includes necessary symbols such as the panic handler. There is no indication this change addresses a security vulnerability or runtime behavior in release builds.
No security action required. Treat as a normal build-system fix. If reviewing for supply-chain risk, verify the `sys` module only contains expected linker-required symbols and that --debug builds now pass CI.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds use sys as _; to the main.rs entry points of bootloader, firmware, kernel, prodtest, and unix projects. In Rust, use X as _; forces the crate/module to be linked without exposing names, pulling in generated symbols including the panic handler. The comment is updated to note ‘incl. the panic handler’. This resolves a link-time failure specific to –debug builds where the panic handler was being discarded. No functional code logic is changed, and no security bug is described or evident in the diff.
Changed components
core/embed/projects/bootloader/src/main.rscore/embed/projects/firmware/src/main.rscore/embed/projects/kernel/src/main.rscore/embed/projects/prodtest/src/main.rscore/embed/projects/unix/src/main.rsInspect captured patch +10 / −1
### core/embed/projects/bootloader/src/main.rs
@@ -1,4 +1,6 @@
#![no_std]
#![no_main]
+// force pull in Rust generated symbols (incl. the panic handler)
+use sys as _;
use trezor_lib as _;
### core/embed/projects/firmware/src/main.rs
@@ -1,4 +1,6 @@
#![no_std]
#![no_main]
+// force pull in Rust generated symbols (incl. the panic handler)
+use sys as _;
use trezor_lib as _;
### core/embed/projects/kernel/src/main.rs
@@ -1,5 +1,6 @@
#![no_std]
#![no_main]
-// force pull in Rust generated symbols
+// force pull in Rust generated symbols (incl. the panic handler)
use io as _;
+use sys as _;
### core/embed/projects/prodtest/src/main.rs
@@ -1,5 +1,7 @@
#![no_std]
#![no_main]
+// force pull in Rust generated symbols (incl. the panic handler)
use io as _;
+use sys as _;
use trezor_lib as _;
### core/embed/projects/unix/src/main.rs
@@ -1,4 +1,6 @@
#![no_std]
#![no_main]
+// force pull in Rust generated symbols (incl. the panic handler)
+use sys as _;
use trezor_lib as _;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.