Attention is currently required from: Jérémy Compostella.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83562?usp=email )
Change subject: arch/x86: Build all stages using the same function ......................................................................
arch/x86: Build all stages using the same function
There is no difference in how early and later stages are linked so rename the same function.
Change-Id: I458c7c6822b310847e7ab32519fd8d66a90f88f7 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/x86/Makefile.mk 1 file changed, 18 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/83562/1
diff --git a/src/arch/x86/Makefile.mk b/src/arch/x86/Makefile.mk index 1a59ee9..fa3b6f8 100644 --- a/src/arch/x86/Makefile.mk +++ b/src/arch/x86/Makefile.mk @@ -54,7 +54,7 @@ # common support for early assembly includes ###############################################################################
-define early_x86_stage +define x86_stage # $1 stage name # $2 oformat
@@ -95,9 +95,9 @@ $(call src-to-obj,bootblock,$(dir)/id.S): $(obj)/build.h
ifeq ($(CONFIG_ARCH_BOOTBLOCK_X86_32),y) -$(eval $(call early_x86_stage,bootblock,elf32-i386)) +$(eval $(call x86_stage,bootblock,elf32-i386)) else -$(eval $(call early_x86_stage,bootblock,elf64-x86-64)) +$(eval $(call x86_stage,bootblock,elf64-x86-64)) endif
ifeq ($(CONFIG_BOOTBLOCK_IN_CBFS),y) @@ -148,9 +148,9 @@ verstage-libs ?=
ifeq ($(CONFIG_ARCH_VERSTAGE_X86_32),y) -$(eval $(call early_x86_stage,verstage,elf32-i386)) +$(eval $(call x86_stage,verstage,elf32-i386)) else -$(eval $(call early_x86_stage,verstage,elf64-x86-64)) +$(eval $(call x86_stage,verstage,elf64-x86-64)) endif
endif # CONFIG_ARCH_VERSTAGE_X86_32 / CONFIG_ARCH_VERSTAGE_X86_64 @@ -187,9 +187,9 @@ romstage-libs ?=
ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y) -$(eval $(call early_x86_stage,romstage,elf32-i386)) +$(eval $(call x86_stage,romstage,elf32-i386)) else -$(eval $(call early_x86_stage,romstage,elf64-x86-64)) +$(eval $(call x86_stage,romstage,elf64-x86-64)) endif
# Compiling crt0 with -g seems to trigger https://sourceware.org/bugzilla/show_bug.cgi?id=6428 @@ -228,9 +228,11 @@
LDFLAGS_postcar += -Map $(objcbfs)/postcar.map
-$(objcbfs)/postcar.debug: $$(postcar-objs) - @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_postcar) $(LDFLAGS_postcar) -o $@ -L$(obj) $(COMPILER_RT_FLAGS_postcar) --whole-archive --start-group $(filter-out %.ld,$^) --no-whole-archive $(COMPILER_RT_postcar) --end-group -T $(call src-to-obj,postcar,$(CONFIG_MEMLAYOUT_LD_FILE)) +ifeq ($(CONFIG_ARCH_POSTCAR_X86_32),y) +$(eval $(call x86_stage,postcar,elf32-i386)) +else +$(eval $(call x86_stage,postcar,elf64-x86-64)) +endif
$(objcbfs)/postcar.elf: $(objcbfs)/postcar.debug.rmod cp $< $@ @@ -311,14 +313,15 @@
ramstage-libs ?=
-# The rmodule_link definition creates an elf file with .rmod extension. +ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) +$(eval $(call x86_stage,ramstage,elf32-i386)) +else +$(eval $(call x86_stage,ramstage,elf64-x86-64)) +endif + $(objcbfs)/ramstage.elf: $(objcbfs)/ramstage.debug.rmod cp $< $@
-$(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
smm-$(CONFIG_DEBUG_HW_BREAKPOINTS_IN_ALL_STAGES) += breakpoint.c