You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/07/22 17:13:41 UTC
incubator-mynewt-newt git commit: newt - Don't link when there are no
dep changes.
Repository: incubator-mynewt-newt
Updated Branches:
refs/heads/develop 4c8ed1cf2 -> 05b357d14
newt - Don't link when there are no dep changes.
This fixes a bug that was introduced in
a996d13f7d971ad6f4d35a8d2ee066002c55b5ae
As a consequence of that change, the link step was performed for every
build, even if there were no changes among dependencies. The problem
was that build flags from the compiler package were not applied to the
link command when it was checked against the previous link command.
This caused it to appear that the command line invocation had changed
since the previous link.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/05b357d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/05b357d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/05b357d1
Branch: refs/heads/develop
Commit: 05b357d145395c5fb085336ec60f839b759e2d71
Parents: 4c8ed1c
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Jul 22 10:09:53 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Fri Jul 22 10:09:53 2016 -0700
----------------------------------------------------------------------
newt/toolchain/compiler.go | 3 +++
newt/toolchain/deps.go | 6 ++++++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/05b357d1/newt/toolchain/compiler.go
----------------------------------------------------------------------
diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index 85fbedb..b77add7 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -724,6 +724,9 @@ func (c *Compiler) CompileElf(binFile string, objFiles []string) error {
options := map[string]bool{"mapFile": c.ldMapFile,
"listFile": true, "binFile": true}
+ // Make sure the compiler package info is added to the global set.
+ c.ensureLclInfoAdded()
+
linkRequired, err := c.depTracker.LinkRequired(binFile, options, objFiles)
if err != nil {
return err
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/05b357d1/newt/toolchain/deps.go
----------------------------------------------------------------------
diff --git a/newt/toolchain/deps.go b/newt/toolchain/deps.go
index 138533c..7b340d3 100644
--- a/newt/toolchain/deps.go
+++ b/newt/toolchain/deps.go
@@ -287,6 +287,8 @@ func (tracker *DepTracker) LinkRequired(dstFile string,
// rebuild is required.
cmd := tracker.compiler.CompileBinaryCmd(dstFile, options, objFiles)
if commandHasChanged(dstFile, cmd) {
+ util.StatusMessage(util.VERBOSITY_VERBOSE, "%s - link required; "+
+ "different command\n", dstFile)
return true, nil
}
@@ -299,6 +301,8 @@ func (tracker *DepTracker) LinkRequired(dstFile string,
// Check timestamp of each .o file in the project.
if tracker.MostRecent.After(dstModTime) {
+ util.StatusMessage(util.VERBOSITY_VERBOSE, "%s - link required; "+
+ "source newer than elf\n", dstFile)
return true, nil
}
@@ -313,6 +317,8 @@ func (tracker *DepTracker) LinkRequired(dstFile string,
}
if objModTime.After(dstModTime) {
+ util.StatusMessage(util.VERBOSITY_VERBOSE, "%s - rebuild "+
+ "required; obj older than dependency (%s)\n", dstFile, obj)
return true, nil
}
}