[coreboot-gerrit] New patch to review for coreboot: Makefile: Fix dependency tracking for linker scripts

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Fri Oct 23 13:25:45 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12139

-gerrit

commit 165d0d4cce663489ed9235141b87b882df6bc48b
Author: Julius Werner <jwerner at chromium.org>
Date:   Tue Sep 29 16:41:11 2015 -0700

    Makefile: Fix dependency tracking for linker scripts
    
    When the memlayout framework was initially developed in the Chromium OS
    tree, the accompanying build system changes unified handling for all
    file types (including .ld and .asl) in a single template. This had the
    advantage that compiler invocation options pertaining to the build
    system itself could be centralized in a single place.
    
    On upstreaming this was reverted for some reason, keeping the old
    special handling for ASL files and writing a custom template for LD. The
    duplicated compiler invocation code for the latter was missing the -MMD
    flag required for dependency tracking. It was also missing at least one
    $-sign which causes the $(<class>-ld-ccopts) variable to be evaluated at
    the time it's parsing the template generator (before the subdirectory
    pass). This should not cause any issues with current code, but all the
    ccopts variables were meant to be evaluated after the subdirectory pass
    (so things like archs and SoCs can manipulate them if needed), so this
    patch fixes both issues.
    
    BRANCH=None
    BUG=None
    TEST='make; touch src/soc/.../memlayout.ld; make' re-links all stages
    and includes the changed symbol addresses from the new address map.
    
    Change-Id: I4be458112908380268229b3220cfa0062add5c5d
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: e8a36f994ef6a819ded7bf6b39b1e0fce8e52279
    Original-Change-Id: If2310b46b53d888975cb2113edce20a896be39ef
    Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/303054
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
    Original-Reviewed-by: Patrick Georgi <pgeorgi at chromium.org>
---
 Makefile.inc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index 3a0d0bc..d82ae18 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -169,8 +169,7 @@ define generic-objs_ld_template_gen
 de$(EMPTY)fine $(1)-objs_ld_template
 $$(call src-to-obj,$1,$$(1).ld): $$(1).ld $(obj)/config.h
 	@printf "    CP         $$$$(subst $$$$(obj)/,,$$$$(@))\n"
-	$$(CC_$(1)) $$(CPPFLAGS_$(1)) $($(1)-ld-ccopts) $(PREPROCESS_ONLY) -include $(obj)/config.h $$$$< > $$$$@.tmp
-	mv $$$$@.tmp $$$$@
+	$$(CC_$(1)) -MMD $$(CPPFLAGS_$(1)) $$($(1)-ld-ccopts) $(PREPROCESS_ONLY) -include $(obj)/config.h -MT $$$$@ -o $$$$@ $$$$<
 en$(EMPTY)def
 endef
 



More information about the coreboot-gerrit mailing list