Fix romstage creation with gcc 4.6 and CAR targets
[coreboot.git] / src / arch / x86 / Makefile.inc
old mode 100644 (file)
new mode 100755 (executable)
index bf2393c..65c2a92
@@ -61,7 +61,7 @@ prebuild-files = \
                $(CBFSTOOL) $@ add $(call extract_nth,1,$(file)) $(call extract_nth,2,$(file)) $(call extract_nth,3,$(file)) $(call extract_nth,4,$(file)); )
 prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
 
-$(obj)/coreboot.pre1: $(obj)/coreboot.bootblock $(prebuilt-files) $(CBFSTOOL)
+$(obj)/coreboot.pre1: $(obj)/coreboot.bootblock $$(prebuilt-files) $(CBFSTOOL)
        rm -f $@
        $(CBFSTOOL) $@ create $(CONFIG_COREBOOT_ROMSIZE_KB)K $(obj)/coreboot.bootblock
        $(prebuild-files)
@@ -98,6 +98,13 @@ ifeq ($(CONFIG_GEODE_VSA_FILE),y)
        $(OBJCOPY) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(CONFIG_VSA_FILENAME) $(obj)/vsa.o
        $(LD) -m elf_i386 -e 0x60020 --section-start .data=0x60000 $(obj)/vsa.o -o $(obj)/vsa.elf
        $(CBFSTOOL) $@.tmp add-stage $(obj)/vsa.elf vsa
+endif
+ifeq ($(CONFIG_INCLUDE_CONFIG_FILE),y)
+       @printf "    CONFIG     $(DOTCONFIG)\n"
+       if [ -f $(DOTCONFIG) ]; then \
+       echo "# This image was built using git revision" `git rev-parse HEAD` > $(obj)/config.tmp ; \
+       sed -e '/^#/d' -e '/^ *$$/d' $(DOTCONFIG) >> $(obj)/config.tmp ; \
+       $(CBFSTOOL) $@.tmp add $(obj)/config.tmp config raw; rm -f $(obj)/config.tmp ; fi
 endif
        mv $@.tmp $@
        @printf "    CBFSPRINT  $(subst $(obj)/,,$(@))\n\n"
@@ -240,7 +247,8 @@ $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDD
 
 $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc
        @printf "    POST       romstage.inc\n"
-       sed -e 's/\.rodata/.rom.data/g' -e 's/\.text/.section .rom.text/g' $^ > $@.tmp
+       sed -e 's/\.rodata/.rom.data/g' -e 's/\^\.text/.section .rom.text/g' \
+               -e 's/\^\.section \.text/.section .rom.text/g' $^ > $@.tmp
        mv $@.tmp $@
 endif