Unify OBJCOPY arguments throughout various x86 stages
Instead of having to have an ifeq() all across the code base, use $(target-objcopy). And correct target-objcopy to a value that objcopy actually understands. Change-Id: Id5dea6420bee02a044dc488b5086d109e806d605 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/11090 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
62477931c8
commit
593f5c8a48
|
@ -251,16 +251,16 @@ endif # CONFIG_ARCH_ROMSTAGE_X86_32 / CONFIG_ARCH_ROMSTAGE_X86_64
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
|
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
|
||||||
|
|
||||||
ifeq ($(CONFIG_COMPILE_IN_DSDT),y)
|
|
||||||
ramstage-srcs += $(obj)/dsdt.aml
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
|
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
|
||||||
target-objcopy=-O elf32-i386 -B i386
|
target-objcopy=-O elf32-i386 -B i386
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_64),y)
|
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_64),y)
|
||||||
target-objcopy=-O elf64-x86_64 -B x86_64
|
target-objcopy=-O elf64-x86-64 -B i386:x86-64
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_COMPILE_IN_DSDT),y)
|
||||||
|
ramstage-srcs += $(obj)/dsdt.aml
|
||||||
|
|
||||||
define ramstage-objs_aml_template
|
define ramstage-objs_aml_template
|
||||||
$(call src-to-obj,ramstage,$(1).aml): $(1).aml
|
$(call src-to-obj,ramstage,$(1).aml): $(1).aml
|
||||||
@printf " OBJCOPY $$(subst $$(obj)/,,$$(@))\n"
|
@printf " OBJCOPY $$(subst $$(obj)/,,$$(@))\n"
|
||||||
|
|
|
@ -30,8 +30,4 @@ $(SIPI_BIN): $(SIPI_RMOD)
|
||||||
|
|
||||||
$(SIPI_BIN).ramstage.manual: $(SIPI_BIN)
|
$(SIPI_BIN).ramstage.manual: $(SIPI_BIN)
|
||||||
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
||||||
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
|
cd $(dir $@); $(OBJCOPY_rmodules_$(ARCH-ramstage-y)) -I binary $(notdir $<) $(target-objcopy) $(notdir $@)
|
||||||
cd $(dir $@); $(OBJCOPY_rmodules_$(ARCH-ramstage-y)) -I binary $(notdir $<) -O elf32-i386 -B i386 $(notdir $@)
|
|
||||||
else
|
|
||||||
cd $(dir $@); $(OBJCOPY_rmodules_$(ARCH-ramstage-y)) -I binary $(notdir $<) -O elf64-x86_64 -B x86_64 $(notdir $@)
|
|
||||||
endif
|
|
||||||
|
|
|
@ -34,11 +34,7 @@ $(obj)/cpu/x86/smm/smm.o: $$(smm-objs) $(COMPILER_RT_smm)
|
||||||
# ELF symbol names.
|
# ELF symbol names.
|
||||||
$(obj)/cpu/x86/smm/smm.ramstage.manual: $(obj)/cpu/x86/smm/smm
|
$(obj)/cpu/x86/smm/smm.ramstage.manual: $(obj)/cpu/x86/smm/smm
|
||||||
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
||||||
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
|
cd $(dir $@); $(OBJCOPY_smm) -I binary $(notdir $<) $(target-objcopy) $(notdir $@)
|
||||||
cd $(dir $@); $(OBJCOPY_smm) -I binary $(notdir $<) -O elf32-i386 -B i386 $(notdir $@)
|
|
||||||
else
|
|
||||||
cd $(dir $@); $(OBJCOPY_smm) -I binary $(notdir $<) -O elf64-x86_64 -B x86_64 $(notdir $@)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_SMM_TSEG),y)
|
ifeq ($(CONFIG_SMM_TSEG),y)
|
||||||
|
|
||||||
|
@ -68,11 +64,7 @@ $(obj)/cpu/x86/smm/smmstub: $(obj)/cpu/x86/smm/smmstub.elf.rmod
|
||||||
|
|
||||||
$(obj)/cpu/x86/smm/smmstub.ramstage.manual: $(obj)/cpu/x86/smm/smmstub
|
$(obj)/cpu/x86/smm/smmstub.ramstage.manual: $(obj)/cpu/x86/smm/smmstub
|
||||||
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
||||||
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
|
cd $(dir $@); $(OBJCOPY_smmstub) -I binary $(notdir $<) $(target-objcopy) $(notdir $@)
|
||||||
cd $(dir $@); $(OBJCOPY_smmstub) -I binary $(notdir $<) -O elf32-i386 -B i386 $(notdir $@)
|
|
||||||
else
|
|
||||||
cd $(dir $@); $(OBJCOPY_smmstub) -I binary $(notdir $<) -O elf64-x86_64 -B x86_64 $(notdir $@)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# C-based SMM handler.
|
# C-based SMM handler.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue