Attention is currently required from: Jérémy Compostella.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83561?usp=email )
Change subject: arch/x86: Link ramstage in one go ......................................................................
arch/x86: Link ramstage in one go
Link ramstage in one go instead of doing partial linking. For some reason this reduces the size of the binary.
Qemu i440fx: before: fallback/ramstage 65321 LZMA (139572 decompressed) after fallback/ramstage 60387 LZMA (124228 decompressed)
Also for LTO to work linking needs to be done in one go.
Change-Id: Ib5848ed44c94780acee1cf900f58162256f3c6da Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/x86/Makefile.mk 1 file changed, 3 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/83561/1
diff --git a/src/arch/x86/Makefile.mk b/src/arch/x86/Makefile.mk index 2bd4338..1a59ee9 100644 --- a/src/arch/x86/Makefile.mk +++ b/src/arch/x86/Makefile.mk @@ -315,13 +315,9 @@ $(objcbfs)/ramstage.elf: $(objcbfs)/ramstage.debug.rmod cp $< $@
-$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.o $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) - @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) $< -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) - -$(objgenerated)/ramstage.o: $$(ramstage-objs) $(COMPILER_RT_ramstage) $$(ramstage-libs) - @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) $(LD_MACHINE) -r -o $@ $(COMPILER_RT_FLAGS_ramstage) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) $(ramstage-libs) --no-whole-archive $(COMPILER_RT_ramstage) --end-group +$(objcbfs)/ramstage.debug: $$(ramstage-objs) + @printf " LINK $(subst $(obj)/,,$(@))\n" + $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) $(COMPILER_RT_FLAGS_ramstage) --whole-archive --start-group $(filter-out %.ld,$^) --no-whole-archive $(COMPILER_RT_ramstage) --end-group -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE))
endif # CONFIG_ARCH_RAMSTAGE_X86_32 / CONFIG_ARCH_RAMSTAGE_X86_64