From 756d2500156974e1d332d27a56926e84aa7aa831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Vejpustek?= Date: Mon, 15 Apr 2024 17:55:24 +0200 Subject: [PATCH] chore(core): initialize automatic variables to zero [no changelog] --- core/SConscript.boardloader | 2 +- core/SConscript.bootloader | 2 +- core/SConscript.bootloader_ci | 2 +- core/SConscript.bootloader_emu | 2 +- core/SConscript.firmware | 2 +- core/SConscript.prodtest | 2 +- core/SConscript.reflash | 2 +- core/SConscript.unix | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/SConscript.boardloader b/core/SConscript.boardloader index 4cf682d849..eafb66910a 100644 --- a/core/SConscript.boardloader +++ b/core/SConscript.boardloader @@ -148,7 +148,7 @@ cmake_gen = env.Command( obj_program = [] obj_program += env.Object(source=SOURCE_MOD) -obj_program += env.Object(source=SOURCE_MOD_CRYPTO) +obj_program += env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero') obj_program += env.Object(source=SOURCE_BOARDLOADER) obj_program += env.Object(source=SOURCE_HAL) diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader index 12baa0b6f6..567424b8b2 100644 --- a/core/SConscript.bootloader +++ b/core/SConscript.bootloader @@ -268,7 +268,7 @@ env.Append(LINKFLAGS=f' -l{RUST_LIB}') obj_program = [] obj_program += env.Object(source=SOURCE_MOD) -obj_program += env.Object(source=SOURCE_MOD_CRYPTO) +obj_program += env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero') obj_program += env.Object(source=SOURCE_BOOTLOADER) obj_program += env.Object(source=SOURCE_NANOPB) obj_program += env.Object(source=SOURCE_HAL) diff --git a/core/SConscript.bootloader_ci b/core/SConscript.bootloader_ci index 861744a5a6..e042a0a1eb 100644 --- a/core/SConscript.bootloader_ci +++ b/core/SConscript.bootloader_ci @@ -207,7 +207,7 @@ cmake_gen = env.Command( obj_program = [] obj_program += env.Object(source=SOURCE_MOD) -obj_program += env.Object(source=SOURCE_MOD_CRYPTO) +obj_program += env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero') obj_program += env.Object(source=SOURCE_BOOTLOADER) obj_program += env.Object(source=SOURCE_NANOPB) obj_program += env.Object(source=SOURCE_HAL) diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu index 290faa2c07..d915d5df28 100644 --- a/core/SConscript.bootloader_emu +++ b/core/SConscript.bootloader_emu @@ -329,7 +329,7 @@ env.Append(LINKFLAGS='-lm') obj_program = [] obj_program += env.Object(source=SOURCE_MOD) -obj_program += env.Object(source=SOURCE_MOD_CRYPTO) +obj_program += env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero') obj_program += env.Object(source=SOURCE_BOOTLOADER) obj_program += env.Object(source=SOURCE_NANOPB) obj_program += env.Object(source=SOURCE_TREZORHAL) diff --git a/core/SConscript.firmware b/core/SConscript.firmware index e46a296667..196b0c2c02 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -737,7 +737,7 @@ if FROZEN: source_files = SOURCE_MOD + SOURCE_MOD_CRYPTO + SOURCE_FIRMWARE + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED + SOURCE_HAL obj_program = [] obj_program.extend(env.Object(source=SOURCE_MOD)) -obj_program.extend(env.Object(source=SOURCE_MOD_CRYPTO)) +obj_program.extend(env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero')) if FEATURE_FLAGS["SECP256K1_ZKP"]: obj_program.extend(env.Object(source=SOURCE_MOD_SECP256K1_ZKP, CCFLAGS='$CCFLAGS -Wno-unused-function')) source_files.extend(SOURCE_MOD_SECP256K1_ZKP) diff --git a/core/SConscript.prodtest b/core/SConscript.prodtest index 476ff7b5b4..5ca7c58fca 100644 --- a/core/SConscript.prodtest +++ b/core/SConscript.prodtest @@ -199,7 +199,7 @@ cmake_gen = env.Command( obj_program = [] obj_program.extend(env.Object(source=SOURCE_MOD)) -obj_program.extend(env.Object(source=SOURCE_MOD_CRYPTO)) +obj_program.extend(env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero')) obj_program.extend(env.Object(source=SOURCE_PRODTEST)) obj_program.extend(env.Object(source=SOURCE_HAL)) diff --git a/core/SConscript.reflash b/core/SConscript.reflash index 657c9581fe..6dfdef1d7a 100644 --- a/core/SConscript.reflash +++ b/core/SConscript.reflash @@ -162,7 +162,7 @@ cmake_gen = env.Command( obj_program = [] obj_program += env.Object(source=SOURCE_MOD) -obj_program += env.Object(source=SOURCE_MOD_CRYPTO) +obj_program += env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero') obj_program += env.Object(source=SOURCE_REFLASH) obj_program += env.Object(source=SOURCE_HAL) diff --git a/core/SConscript.unix b/core/SConscript.unix index ec93317266..9c69edc877 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -824,7 +824,7 @@ if FROZEN: obj_program = [] source_files = SOURCE_MOD + SOURCE_MOD_CRYPTO + SOURCE_MICROPYTHON + SOURCE_UNIX obj_program.extend(env.Object(source=SOURCE_MOD)) -obj_program.extend(env.Object(source=SOURCE_MOD_CRYPTO)) +obj_program.extend(env.Object(source=SOURCE_MOD_CRYPTO, CCFLAGS='$CCFLAGS -ftrivial-auto-var-init=zero')) if FEATURE_FLAGS["SECP256K1_ZKP"]: obj_program.extend(env.Object(source=SOURCE_MOD_SECP256K1_ZKP, CCFLAGS='$CCFLAGS -Wno-unused-function')) source_files.extend(SOURCE_MOD_SECP256K1_ZKP)