diff options
author | Vadim Sukhomlinov <sukhomlinov@google.com> | 2021-10-11 20:31:29 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-14 07:02:54 +0000 |
commit | b72f2a1c948ad6e1a5a4402cf07121d815400d58 (patch) | |
tree | 54fd8c63e8ec4295e4800dac6e368fff4fa580fe /board | |
parent | 31bf4f49ecbbeb2ce4f4d86c334d4c3fa4144a26 (diff) | |
download | chrome-ec-b72f2a1c948ad6e1a5a4402cf07121d815400d58.tar.gz |
cr50: add run-time detection of gcc version to support gcc 11.2 LTO
With planned upgrade to gcc 11.2 we need to make sure it will not fail
cr50 build as it will be a reason to revert. gcc 11.2 gives us 1768 b
back after TPM2 LTO, but it changes default linker behavior and produce
LTO object file during partial link unless -flinker-output=nolto-rel is
used. This option however fail 8.3 build.
Also, gcc 11.2 introduced new optimization path IPA modref which doesn't
play nice with LTO and partial link used together, causing gcc crash.
To overcome this issue add -fno-ipa-modref when gcc 11.2 is used. This
results in almost no impact on code size.
BUG=none
TEST=make BOARD=cr50 tested with gcc 8.3 and gcc 11.2
Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com>
Change-Id: I78a3b3403e84dc4a426dede02b399d9d249ece81
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3218577
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/cr50/build.mk | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/board/cr50/build.mk b/board/cr50/build.mk index a7bde7a688..f92a527ad8 100644 --- a/board/cr50/build.mk +++ b/board/cr50/build.mk @@ -210,7 +210,8 @@ rw_board_deps := $(addsuffix .d, $(RW_FIPS_OBJS)) FIPS_CFLAGS = $(CFLAGS) -frandom-seed=0 -flto=1 -flto-partition=1to1 -fipa-pta\ -fvisibility=hidden -fipa-cp-clone -fweb -ftree-partial-pre\ -flive-range-shrinkage -fgcse-after-reload -fgcse-sm -fgcse-las -fivopts\ - -fpredictive-commoning -freorder-blocks-algorithm=stc + -fpredictive-commoning -freorder-blocks-algorithm=stc\ + $(CFLAGS_LTO_PARTIAL_LINK) $(RW_BD_OUT)/$(FIPS_MODULE): $(RW_FIPS_OBJS) $(FIPS_LD_SCRIPT) @echo " LD $(notdir $@)" |