summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2021-06-14 23:18:07 +0200
committerCommit Bot <commit-bot@chromium.org>2021-06-17 17:02:27 +0000
commitb322426aa510b4c2fa9edcbc8a6e51939180f2a0 (patch)
tree36943de78ba98bc94129a4043a82b1d303c89a8e /Makefile.rules
parent1720d5608109584722d3b7566e8bc1627b14f246 (diff)
downloadchrome-ec-b322426aa510b4c2fa9edcbc8a6e51939180f2a0.tar.gz
build system: Link with LTO partitioning strategy "one"
By putting all object files in a single LTO partition there's less room to optimize the build time using multi-threading. On the upside, the build becomes more reproducible and the build result tends to be smaller thanks to better optimization opportunities. This is needed on gcc 11 for now build kodama: without it, the code grows beyond the bounds it needs to fit in (that gcc 8 manages to hold, so a regression). BUG=none BRANCH=none TEST=one class of error less with gcc 11 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Change-Id: I86b2c70cb5a2e85024630e7217cf8bd24d349910 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2959922 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index b6a631bec9..8cd04edf38 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -87,7 +87,7 @@ cmd_bin_to_hex = $(OBJCOPY) -I binary -O ihex \
--change-addresses $(_program_memory_base) $^ $@
cmd_smap = $(NM) $< | sort > $@
cmd_elf = $(CC) $(objs) $(libsharedobjs_elf-y) $(LDFLAGS) \
- -o $@ -Wl,-T,$< -Wl,-Map,$(patsubst %.elf,%.map,$@)
+ -o $@ -Wl,-T,$< -Wl,-Map,$(patsubst %.elf,%.map,$@) -flto-partition=one
cmd_fuzz_exe = $(CXX) $^ $(HOST_TEST_LDFLAGS) $(LDFLAGS_EXTRA) -o $@
cmd_run_fuzz = build/host/$*/$*.exe -seed=1 -runs=1 $(silent) \
$(silent_err) || (echo "Test $* failed!" && false)