aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.inc
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-05-07 22:24:41 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-05-20 08:03:06 +0200
commiteec8dfb5e7eec7d837005ce97eb09d18386fabdd (patch)
tree2170dde304c59736a58cf3a698e20baef6edd3f8 /Makefile.inc
parent18fed3dda68a29abf8bee987bc60a64258d2a83f (diff)
downloadcoreboot-eec8dfb5e7eec7d837005ce97eb09d18386fabdd.tar.gz
coreboot-eec8dfb5e7eec7d837005ce97eb09d18386fabdd.tar.xz
coreboot-eec8dfb5e7eec7d837005ce97eb09d18386fabdd.zip
build system: use archives, not linker action to shorten command lines
Intermediate linking may distort linker behavior (in particular related to weak symbols). The idea is that archives are closer to 'just a list of object files', and ideally makes the linker more predictable. Using --whole-archive, the linker doesn't optimize out object files just because their symbols were already provided by weak versions. However it shouldn't be used for libgcc, because that one has some unexpected side-effects. Change-Id: Ie226c198a93bcdca2d82c02431c72108a1c6ea60 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10139 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.inc b/Makefile.inc
index a8961cc41..277408f78 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -115,8 +115,8 @@ files-in-dir=$(filter-out $(call dir-wildcards,$(call filter-out-dirs,$(1),$(sor
# directory into an intermediate file
ramstage-postprocess=$$(eval DEPENDENCIES+=$$(addsuffix .d,$$(basename $(1)))) \
$(foreach d,$(sort $(dir $(filter-out %.ld,$(1)))), \
- $(eval $(d)ramstage.o: $(call files-in-dir,$(d),$(filter-out %.ld,$(1))); $$(LD_ramstage) -o $$@ -r $$^ ) \
- $(eval ramstage-objs:=$(d)ramstage.o $(filter-out $(filter-out %.ld, $(call files-in-dir,$(d),$(1))),$(ramstage-objs))))
+ $(eval $(d)ramstage.a: $(call files-in-dir,$(d),$(filter-out %.ld,$(1))); rm -f $$@ && $(AR_ramstage) rcsT $$@ $$^ ) \
+ $(eval ramstage-objs:=$(d)ramstage.a $(filter-out $(filter-out %.ld, $(call files-in-dir,$(d),$(1))),$(ramstage-objs))))
bootblock-generic-ccopts += -D__PRE_RAM__ -D__BOOTBLOCK__
romstage-generic-ccopts += -D__PRE_RAM__ -D__ROMSTAGE__