From 8f1d33d5f9a73f6a7cc60cd135f0a731ce6d2a10 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 27 Apr 2022 12:04:35 +0200 Subject: [PATCH] build(core,legacy): remove gcc, use cc instead of gcc for firmware builds we still use arm-none-eabi-gcc via $(PREFIX)gcc [no changelog] --- ci/shell.nix | 2 -- core/SConscript.firmware | 2 +- core/SConscript.unix | 2 +- crypto/Makefile | 2 +- legacy/Makefile.include | 4 ++-- legacy/gen/Makefile | 2 +- storage/tests/c/Makefile | 2 +- storage/tests/c0/Makefile | 2 +- tests/fido_tests/u2f-tests-hid/Makefile | 4 ++-- 9 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ci/shell.nix b/ci/shell.nix index f784f1642..4b507fd16 100644 --- a/ci/shell.nix +++ b/ci/shell.nix @@ -39,7 +39,6 @@ let # to use official binary, remove rustfmt from buildInputs and add it to extensions: extensions = [ "clippy" ]; }; - gcc = nixpkgs.gcc11; llvmPackages = nixpkgs.llvmPackages_13; # see pyright/README.md for update procedure pyright = nixpkgs.callPackage ./pyright {}; @@ -77,7 +76,6 @@ stdenvNoCC.mkDerivation ({ check curl # for connect tests editorconfig-checker - gcc gcc-arm-embedded git gitAndTools.git-subrepo diff --git a/core/SConscript.firmware b/core/SConscript.firmware index b3b0e1bae..e81ae4de2 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -680,7 +680,7 @@ if FROZEN: if FEATURE_FLAGS["SECP256K1_ZKP"]: host_env = Environment(ENV=os.environ) host_env.Replace( - CC=os.getenv('CC_FOR_BUILD') or 'gcc', + CC=os.getenv('CC_FOR_BUILD') or 'cc', COPT='-O2', CPPPATH='vendor/secp256k1-zkp', CPPDEFINES=[ diff --git a/core/SConscript.unix b/core/SConscript.unix index 18c921f0e..5fe735fef 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -641,7 +641,7 @@ if FROZEN: if FEATURE_FLAGS["SECP256K1_ZKP"]: host_env = Environment(ENV=os.environ) host_env.Replace( - CC=os.getenv('CC_FOR_BUILD') or 'gcc', + CC=os.getenv('CC_FOR_BUILD') or 'cc', COPT='-O2', CPPPATH='vendor/secp256k1-zkp', CPPDEFINES=[ diff --git a/crypto/Makefile b/crypto/Makefile index baf6deda9..1a9d7ecec 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -35,7 +35,7 @@ else ifeq ($(ADDRESS_SANITIZER),1) SANFLAGS += -fsanitize=address,undefined endif -CC ?= gcc +CC ?= cc OPTFLAGS ?= -O3 -g diff --git a/legacy/Makefile.include b/legacy/Makefile.include index 8918ef56d..1d6f220f3 100644 --- a/legacy/Makefile.include +++ b/legacy/Makefile.include @@ -6,10 +6,10 @@ Q := @ endif PYTHON ?= python -CC_FOR_BUILD ?= gcc +CC_FOR_BUILD ?= cc ifeq ($(EMULATOR),1) -CC ?= gcc +CC ?= cc LD := $(CC) OBJCOPY := true OBJDUMP := true diff --git a/legacy/gen/Makefile b/legacy/gen/Makefile index c518d9182..4f0e93046 100644 --- a/legacy/gen/Makefile +++ b/legacy/gen/Makefile @@ -1,4 +1,4 @@ -CC=gcc +CC=cc all: strwidth diff --git a/storage/tests/c/Makefile b/storage/tests/c/Makefile index ba0dd1330..6dd4dc358 100644 --- a/storage/tests/c/Makefile +++ b/storage/tests/c/Makefile @@ -1,4 +1,4 @@ -CC = gcc +CC = cc CFLAGS = -Wall -Wshadow -Wextra -Wpedantic -Werror -Wno-missing-braces -fPIC -fsanitize=address,undefined LIBS = INC = -I ../../../crypto -I ../.. -I . diff --git a/storage/tests/c0/Makefile b/storage/tests/c0/Makefile index 854ffa693..e6375f19a 100644 --- a/storage/tests/c0/Makefile +++ b/storage/tests/c0/Makefile @@ -1,4 +1,4 @@ -CC=gcc +CC=cc CFLAGS=-Wall -fPIC LIBS= OBJ=storage.o norcow.o flash.o diff --git a/tests/fido_tests/u2f-tests-hid/Makefile b/tests/fido_tests/u2f-tests-hid/Makefile index beae983d3..d705c2b9a 100644 --- a/tests/fido_tests/u2f-tests-hid/Makefile +++ b/tests/fido_tests/u2f-tests-hid/Makefile @@ -6,8 +6,8 @@ all: HIDTest U2FTest -CC ?= gcc -CXX ?= g++ +CC ?= cc +CXX ?= c++ CFLAGS ?= -Wall %.o: %.c