summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2009-02-19 23:50:38 +0000
committerRonald G. Minnich <rminnich@gmail.com>2009-02-19 23:50:38 +0000
commit41bb62d112be32c57fc36fedbc2ac4108e88ba1c (patch)
treea9bcc766e3a9ebd250f49dc10de9690057b8e34c
parent2fe48ba7d566e7f0a2b2c62837ce659ebad6365e (diff)
downloadcoreboot-41bb62d112be32c57fc36fedbc2ac4108e88ba1c.tar.gz
coreboot-41bb62d112be32c57fc36fedbc2ac4108e88ba1c.tar.bz2
coreboot-41bb62d112be32c57fc36fedbc2ac4108e88ba1c.zip
The initram build allows you to -fcombine the source. But if you put a
.S into the source file list, for reasons unknown, gcc only builds a .o with the .S symbols/code in it; all the .c bits disappear. So, a few changes: 1. add a rule for secondary.o, we're going to need it. I like the fact that adding a .S file is inconvenient. Good. Adding assembly should be hard. 2. Make two steps to initram .o building: first, the .c files, then any extra .o files as specified by the mainboard Makefile I realize this is a bit ugly, if there is a better solution, I'll take it. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://coreboot.org/repository/coreboot-v3@1135 f3766cd6-281f-0410-b1cd-43a5c92072e9
-rw-r--r--arch/x86/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index be56a80c9af0..93914db03fad 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -282,9 +282,18 @@ $(obj)/arch/x86/%/stage0.o: $(src)/arch/x86/%/stage0.S $(src)/arch/x86/stage0_co
$(Q)printf " AS $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(AS) $(obj)/arch/x86/stage0_asm.s -o $@
-$(obj)/coreboot.initram $(obj)/coreboot.initram.map: $(obj)/stage0.init $(obj)/stage0-prefixed.o $(INITRAM_SRC)
+$(obj)/arch/x86/secondary.o: $(src)/arch/x86/secondary.S
+ $(Q)mkdir -p $(dir $@)
+ $(Q)printf " CC $(subst $(shell pwd)/,,$(@))\n"
+ $(Q)$(CC) -E $(COREBOOTINCLUDE) $< \
+ -o $(obj)/arch/x86/secondary.s
+ $(Q)printf " AS $(subst $(shell pwd)/,,$(@))\n"
+ $(Q)$(AS) $(obj)/arch/x86/secondary.s -o $@
+
+$(obj)/coreboot.initram $(obj)/coreboot.initram.map: $(obj)/stage0.init $(obj)/stage0-prefixed.o $(INITRAM_SRC) $(INITRAM_OBJ)
$(Q)printf " CC $(subst $(shell pwd)/,,$(@)) (XIP)\n"
- $(Q)$(CC) $(INITCFLAGS) -fPIE -c -combine $(COMBINEFLAGS) $(INITRAM_SRC) -o $(obj)/coreboot.initram_partiallylinked.o
+ $(Q)$(CC) $(INITCFLAGS) -fPIE -c -combine $(COMBINEFLAGS) $(INITRAM_SRC) -o $(obj)/coreboot.initram_csource.o
+ $(Q)$(LD) -r $(obj)/coreboot.initram_csource.o $(INITRAM_OBJ) -o $(obj)/coreboot.initram_partiallylinked.o
$(Q)# .data and .bss must be empty because they aren't handled
$(Q)printf " CHECK initram (non-empty writable/allocatable sections)\n"