What changed, and why it matters
This commit is a routine build cleanup. It removes several unused C preprocessor definitions (APP_BTC, APP_LTC, APP_ETH) from the build files, leaving only APP_U2F. There is no indication this changes runtime behavior or fixes a security issue.
No security action needed. Treat as normal build hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the APP_BTC, APP_LTC, and APP_ETH compile definitions from CMakeLists.txt and the bitbox02-sys build.rs. These macros are described as ‘unused’, so the change is purely a build-system simplification. APP_U2F remains because it is still used. No functional code is modified.
Changed components
src/CMakeLists.txtsrc/rust/bitbox02-sys/build.rsInspect captured patch +5 / −8
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 815a4c1..69c825d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -407,10 +407,7 @@ foreach(type ${RUST_LIBS})
TESTING
_UNIT_TEST_
PRODUCT_BITBOX_MULTI=1
- APP_BTC=1
- APP_LTC=1
APP_U2F=1
- APP_ETH=1
)
# For tests all C-files are built into the rust lib.
target_include_directories(${type}_rust_c INTERFACE
@@ -443,7 +440,7 @@ if(CMAKE_CROSSCOMPILING)
add_executable(${elf} ${BOOTLOADER-SOURCES} ${PLATFORM-BITBOX02-SOURCES})
target_link_libraries(${elf} PRIVATE c asf4-drivers-min samd51a-ds -Wl,-u,exception_table)
target_include_directories(${elf} PRIVATE ${INCLUDES})
- target_compile_definitions(${elf} PRIVATE BOOTLOADER "APP_BTC=0" "APP_LTC=0" "APP_ETH=0" "APP_U2F=0")
+ target_compile_definitions(${elf} PRIVATE BOOTLOADER "APP_U2F=0")
# needed to find version.h
target_include_directories(${elf} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
# needed to find bootloader_version.h
@@ -543,15 +540,15 @@ if(CMAKE_CROSSCOMPILING)
endforeach(firmware)
target_sources(firmware.elf PRIVATE firmware.c)
- target_compile_definitions(firmware.elf PRIVATE PRODUCT_BITBOX_MULTI "APP_BTC=1" "APP_LTC=1" "APP_ETH=1" "APP_U2F=1")
+ target_compile_definitions(firmware.elf PRIVATE PRODUCT_BITBOX_MULTI "APP_U2F=1")
target_sources(firmware.elf PRIVATE ${FIRMWARE-U2F-SOURCES} ${FIRMWARE-U2F-DRIVER-SOURCES} ${PLATFORM-BITBOX02-SOURCES})
target_sources(firmware-btc.elf PRIVATE firmware.c)
- target_compile_definitions(firmware-btc.elf PRIVATE PRODUCT_BITBOX_BTCONLY "APP_BTC=1" "APP_LTC=0" "APP_ETH=0" "APP_U2F=0")
+ target_compile_definitions(firmware-btc.elf PRIVATE PRODUCT_BITBOX_BTCONLY "APP_U2F=0")
target_sources(firmware-btc.elf PRIVATE ${PLATFORM-BITBOX02-SOURCES})
target_sources(factory-setup.elf PRIVATE factorysetup.c)
- target_compile_definitions(factory-setup.elf PRIVATE PRODUCT_BITBOX02_FACTORYSETUP "APP_BTC=0" "APP_LTC=0" "APP_ETH=0" "APP_U2F=0")
+ target_compile_definitions(factory-setup.elf PRIVATE PRODUCT_BITBOX02_FACTORYSETUP "APP_U2F=0")
target_sources(factory-setup.elf PRIVATE ${PLATFORM-BITBOX02-SOURCES})
# Copy the binary file to the output directory because the symbol names in
diff --git a/src/rust/bitbox02-sys/build.rs b/src/rust/bitbox02-sys/build.rs
index dd98f8d..3af8091 100644
--- a/src/rust/bitbox02-sys/build.rs
+++ b/src/rust/bitbox02-sys/build.rs
@@ -450,7 +450,7 @@ pub fn main() -> BuildResult<()> {
// Needs to match the definitions in `CMakeList.txt' files (unit tests, hardware fakes and
// simulator)
- let mut definitions = vec!["-DAPP_BTC=1", "-DAPP_LTC=1", "-DAPP_U2F=1", "-DAPP_ETH=1"];
+ let mut definitions = vec!["-DAPP_U2F=1"];
definitions.extend(&extra_flags);
run_command(
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.