What changed, and why it matters
This commit fixes the order in which two software libraries are linked together when building the BitBox02 firmware. It is a build-system correction that prevents future 'undefined symbol' linker errors. It does not change any runtime behavior, user-facing functionality, or security logic.
No security action required. Treat as a normal build-system fix. If auditing, verify that the resulting firmware builds and that secp256k1 symbols are correctly resolved.
Security signals we found
No security-relevant code change
Build-system only: CMake link order adjustment
No change to cryptographic algorithms, keys, or memory handling
No vulnerability class present in diff
Evidence from the diff
The change moves the Rust static library (${firmware}rust_c) ahead of the secp256k1 static library in the CMake link order. With GNU ld’s left-to-right archive resolution, the Rust archive introduces secp256k1* references that must be unresolved when secp256k1 is later scanned, otherwise the needed secp256k1 objects are not pulled in. The commit is purely a build/linkage fix and has no runtime security effect on its own.
Changed components
src/CMakeLists.txtInspect captured patch +4 / −2
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a62113f..7fc4a6e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -569,6 +569,10 @@ if(CMAKE_CROSSCOMPILING)
target_link_libraries(${elf} PRIVATE "-Wl,-Map=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${firmware}.map\" -T\"${CMAKE_SOURCE_DIR}/firmware.ld\"")
target_link_libraries(${elf} PRIVATE -Wl,--defsym=STACK_SIZE=${STACK_SIZE} -Wl,-defsym=HEAP_SIZE=${HEAP_SIZE})
+ # Link the Rust static library before its C dependencies. Static library resolution is
+ # left-to-right.
+ target_link_libraries(${elf} PRIVATE ${firmware}_rust_c)
+
target_link_libraries(${elf} PRIVATE secp256k1)
target_link_libraries(${elf} PRIVATE ${QTOUCHLIB_A} ${QTOUCHLIB_B} ${QTOUCHLIB_T})
@@ -578,8 +582,6 @@ if(CMAKE_CROSSCOMPILING)
target_compile_options(${elf} PRIVATE --specs=nosys.specs)
target_link_libraries(${elf} PRIVATE --specs=nosys.specs)
- target_link_libraries(${elf} PRIVATE ${firmware}_rust_c)
-
# Optiga config must be defined both when compiling the optiga lib, and also when compiling our
# sources. We can verify this include is indeed used by our sources - when you point it to a
# non-existing file, compilation fails.
Why this scored 14/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.