summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--Makefile.inc2
-rw-r--r--src/arch/x86/Makefile.inc13
3 files changed, 7 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index f6f9a605ad..3ad19dffed 100644
--- a/Makefile
+++ b/Makefile
@@ -230,7 +230,7 @@ define create_cc_template
# $4 additional dependencies
ifn$(EMPTY)def $(1)-objs_$(2)_template
de$(EMPTY)fine $(1)-objs_$(2)_template
-$(obj)/$$(1).$(1).o: src/$$(1).$(2) $(obj)/config.h $(4)
+$$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $(obj)/config.h $(4)
@printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
$(CC_$(1)) -MMD $$$$(CPPFLAGS_$(1)) $$$$(CFLAGS_$(1)) -MT $$$$(@) $(3) -c -o $$$$@ $$$$<
en$(EMPTY)def
@@ -244,7 +244,7 @@ $(foreach class,$(classes), \
$(if $(generic-objs_$(type)_template_gen),$(eval $(call generic-objs_$(type)_template_gen,$(class))),\
$(eval $(call create_cc_template,$(class),$(type),$($(class)-$(type)-ccopts),$($(class)-$(type)-deps))))))
-foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(subst src/,,$(basename $(file))))))
+foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(basename $(file)))))
$(eval $(foreach class,$(classes),$(call foreach-src,$(class))))
DEPENDENCIES = $(addsuffix .d,$(basename $(allobjs)))
diff --git a/Makefile.inc b/Makefile.inc
index d18acfccad..0e34577683 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -147,7 +147,7 @@ endef
#######################################################################
# Add handler to compile ACPI's ASL
define ramstage-objs_asl_template
-$(obj)/$(1).ramstage.asl: src/$(1).asl $(obj)/config.h
+$$(call src-to-obj,ramstage,$(1).asl): $(1).asl $(obj)/config.h
@printf " IASL $$(subst $(top)/,,$$(@))\n"
$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-ramstage-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$@
cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$@)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index fe92a22723..e2170f5d40 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -233,17 +233,12 @@ $(objcbfs)/base_xip.txt: $(obj)/coreboot.pre1 $(objcbfs)/romstage_null.bin
|| { echo "The romstage is larger than XIP size. Please expand the CONFIG_XIP_ROM_SIZE" ; exit 1; }
mv $@.tmp $@
-$(objgenerated)/crt0.romstage.S: $$(crt0s)
+$(objgenerated)/crt0.S: $$(crt0s)
@printf " GEN $(subst $(obj)/,,$(@))\n"
- printf '$(foreach crt0,$(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@
+ printf '$(foreach crt0,$(crt0s),#include "$(crt0)"\n)' > $@
-$(objgenerated)/crt0.romstage.o: $(objgenerated)/crt0.S
- @printf " CC $(subst $(obj)/,,$(@))\n"
- $(CC_romstage) $(CFLAGS_x86_32) $(DISASSEMBLY) -c -o $@ $< > $(basename $@).disasm
-
-$(objgenerated)/crt0.S: $(objgenerated)/crt0.romstage.S $(obj)/config.h $(obj)/build.h
- @printf " CC $(subst $(obj)/,,$(@))\n"
- $(CC_romstage) $(CPPFLAGS_romstage) -MMD -x assembler-with-cpp -E -I$(src)/include -I$(src)/arch/x86/include -I$(obj) -include $(obj)/config.h -include $(obj)/build.h -I. -I$(src) $< -o $@
+# Compiling crt0 with -g seems to trigger https://sourceware.org/bugzilla/show_bug.cgi?id=6428
+romstage-S-ccopts += -I. -g0
endif # CONFIG_ARCH_ROMSTAGE_X86_32