diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2015-04-04 15:50:20 +0200 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-04-06 19:14:00 +0200 |
commit | 828e0e86f3b7ddb7cde5daddc83be4386a4d43b1 (patch) | |
tree | bd8573ffb53ff1acc6d9c7b8fac86c876f4e04e3 /src/arch/mips | |
parent | d126a749b86504a6f4c3a6c572fc8a3b14de6df9 (diff) | |
download | coreboot-staging-828e0e86f3b7ddb7cde5daddc83be4386a4d43b1.zip coreboot-staging-828e0e86f3b7ddb7cde5daddc83be4386a4d43b1.tar.gz |
build system: run linker scripts through the preprocessor
This allows combining and simplifying linker scripts.
This is inspired by the commit listed below, but rewritten to match
upstream, and split in smaller pieces to keep intent clear.
Change-Id: Ie5c11bd8495a399561cefde2f3e8dd300f4feb98
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Based-On-Change-Id: I50af7dacf616e0f8ff4c43f4acc679089ad7022b
Based-On-Signed-off-by: Julius Werner <jwerner@chromium.org>
Based-On-Reviewed-on: https://chromium-review.googlesource.com/219170
Reviewed-on: http://review.coreboot.org/9303
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/mips')
-rw-r--r-- | src/arch/mips/Makefile.inc | 16 | ||||
-rw-r--r-- | src/arch/mips/bootblock.ld | 1 | ||||
-rw-r--r-- | src/arch/mips/ramstage.ld | 1 | ||||
-rw-r--r-- | src/arch/mips/romstage.ld | 1 |
4 files changed, 10 insertions, 9 deletions
diff --git a/src/arch/mips/Makefile.inc b/src/arch/mips/Makefile.inc index 159d0e0..969a03d 100644 --- a/src/arch/mips/Makefile.inc +++ b/src/arch/mips/Makefile.inc @@ -51,9 +51,9 @@ bootblock-y += bootblock.ld # prevent that. bootblock-S-ccopts += -undef -$(objcbfs)/bootblock.debug: $(src)/arch/mips/bootblock.ld $$(bootblock-objs) $(obj)/config.h $(obj)/ldoptions +$(objcbfs)/bootblock.debug: $(obj)/arch/mips/bootblock.bootblock.ld $$(bootblock-objs) $(obj)/config.h @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) -T $(src)/arch/mips/bootblock.ld --start-group $(bootblock-objs) --end-group + $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) -T $(obj)/arch/mips/bootblock.bootblock.ld --start-group $(bootblock-objs) --end-group endif # CONFIG_ARCH_BOOTBLOCK_MIPS @@ -71,9 +71,11 @@ romstage-y += ../../lib/memcpy.c romstage-y += ../../lib/memmove.c romstage-y += ../../lib/memset.c -$(objcbfs)/romstage.debug: $$(romstage-objs) $(src)/arch/mips/romstage.ld $(obj)/ldoptions +romstage-y += romstage.ld + +$(objcbfs)/romstage.debug: $$(romstage-objs) $(obj)/arch/mips/romstage.romstage.ld @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_romstage) --gc-sections -static -o $@ -L$(obj) -T $(src)/arch/mips/romstage.ld --start-group $(romstage-objs) --end-group + $(LD_romstage) --gc-sections -static -o $@ -L$(obj) -T $(obj)/arch/mips/romstage.romstage.ld --start-group $(romstage-objs) --end-group endif # CONFIG_ARCH_ROMSTAGE_MIPS @@ -93,8 +95,10 @@ ramstage-y += ../../lib/memmove.c ramstage-y += ../../lib/memset.c ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) -$(objcbfs)/ramstage.debug: $$(ramstage-objs) $(src)/arch/mips/ramstage.ld $(obj)/ldoptions +ramstage-y += ramstage.ld + +$(objcbfs)/ramstage.debug: $$(ramstage-objs) $(obj)/arch/mips/ramstage.ramstage.ld @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) --gc-sections -static -o $@ -L$(obj) -T $(src)/arch/mips/ramstage.ld --start-group $(ramstage-objs) --end-group + $(LD_ramstage) --gc-sections -static -o $@ -L$(obj) -T $(obj)/arch/mips/ramstage.ramstage.ld --start-group $(ramstage-objs) --end-group endif # CONFIG_ARCH_RAMSTAGE_MIPS diff --git a/src/arch/mips/bootblock.ld b/src/arch/mips/bootblock.ld index 8e1b1e3..3721f85 100644 --- a/src/arch/mips/bootblock.ld +++ b/src/arch/mips/bootblock.ld @@ -20,7 +20,6 @@ */ OUTPUT_ARCH(mips) -INCLUDE ldoptions ENTRY(_start) diff --git a/src/arch/mips/ramstage.ld b/src/arch/mips/ramstage.ld index cba90eb..4052444 100644 --- a/src/arch/mips/ramstage.ld +++ b/src/arch/mips/ramstage.ld @@ -24,7 +24,6 @@ */ OUTPUT_ARCH(mips) -INCLUDE ldoptions ENTRY(stage_entry) diff --git a/src/arch/mips/romstage.ld b/src/arch/mips/romstage.ld index f776bc8..8964285 100644 --- a/src/arch/mips/romstage.ld +++ b/src/arch/mips/romstage.ld @@ -20,7 +20,6 @@ */ OUTPUT_ARCH(mips) -INCLUDE ldoptions ENTRY(stage_entry) |