summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Sukhomlinov <sukhomlinov@google.com>2022-12-01 10:19:47 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-01 18:41:45 +0000
commit8bda16cb8f98e0fcdb41c82eb98f21c16cad16ec (patch)
tree41747dc3c2d86f4169e33c4a08530ed084282a4d
parentc2a105622ebdbeae7f0c00c3bb7c4b3c13211f8d (diff)
downloadchrome-ec-8bda16cb8f98e0fcdb41c82eb98f21c16cad16ec.tar.gz
cr50: set cc-name to gcc to avoid build errors
Some change in ChromeOS chroot caused different defaults, so cc-name switched from `gcc` to `clang` in compiler autodetection for host target, but never was set to `gcc` by board/chip/core. Adding setting `cc-name:=gcc` for core/cortex-m/build.mk to use specific toolchain. BUG=b:260904818 TEST=make buildall -j Change-Id: Ic0b8ffade9fa4d82bd265add8b7906be7d98f7c1 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4071387 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Code-Coverage: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r--core/cortex-m/build.mk8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk
index be2a8a6501..b18d01e114 100644
--- a/core/cortex-m/build.mk
+++ b/core/cortex-m/build.mk
@@ -10,7 +10,8 @@
$(call set-option,CROSS_COMPILE,\
$(CROSS_COMPILE_arm),\
/opt/coreboot-sdk/bin/arm-eabi-)
-
+# Force gcc compiler
+cc-name:=gcc
# FPU compilation flags
CFLAGS_FPU-$(CONFIG_FPU)=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
@@ -24,8 +25,9 @@ CFLAGS_CPU+=-flto
LDFLAGS_EXTRA+=-flto
endif
-# TODO: remove this workaround once migration to gcc 11.2 completed.
-GCC_VERSION := $(shell $(CROSS_COMPILE)gcc -dumpversion)
+# gcc 11.2 had a known issue which doesn't affect Cr50 build anymore
+# but we can't remove -fno-ipa-modref as it changes FIPS module digest
+GCC_VERSION := $(shell $(CROSS_COMPILE)$(cc-name) -dumpversion)
ifeq ("$(GCC_VERSION)","11.2.0")
# IPA modref pass crashes gcc 11.2 when LTO is used with partial linking
CFLAGS_CPU += -fno-ipa-modref