diff options
-rw-r--r-- | src/arch/x86/Makefile.mk | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/arch/x86/Makefile.mk b/src/arch/x86/Makefile.mk index f19866c274..cf5b2bbb57 100644 --- a/src/arch/x86/Makefile.mk +++ b/src/arch/x86/Makefile.mk @@ -54,7 +54,7 @@ endif # CONFIG_SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA # common support for early assembly includes ############################################################################### -define early_x86_stage +define x86_stage # $1 stage name # $2 oformat @@ -95,9 +95,9 @@ bootblock-y += car.ld $(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-y += car.ld 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-srcs += $(wildcard $(src)/mainboard/$(MAINBOARDDIR)/romstage.c) 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 @@ postcar-$(CONFIG_HAVE_CF9_RESET) += cf9_reset.c 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 $< $@ @@ -309,14 +311,15 @@ endif 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) $(COMPILER_RT_ramstage) $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) $$(ramstage-libs) - @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 |