From 8bda16cb8f98e0fcdb41c82eb98f21c16cad16ec Mon Sep 17 00:00:00 2001 From: Vadim Sukhomlinov Date: Thu, 1 Dec 2022 10:19:47 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4071387 Reviewed-by: Vadim Bendebury Commit-Queue: Vadim Sukhomlinov Auto-Submit: Vadim Sukhomlinov Tested-by: Vadim Sukhomlinov Reviewed-by: Vadim Sukhomlinov Commit-Queue: Vadim Bendebury Code-Coverage: Vadim Sukhomlinov --- core/cortex-m/build.mk | 8 +++++--- 1 file 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 -- cgit v1.2.1