summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-10-16 23:44:21 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-10-16 23:44:21 +0000
commit8a3ad59653c2ecb9de0ffc91714855748f8a22b9 (patch)
tree060c93f79ebe7667ac7955d08513c8e31272a972
parent4727c0744615d7b49c843197433937721ce9acd1 (diff)
Revision 3564 improved compilation time, but it also introduced a
dependency bug which hit people running parallel make instances. With our current makefile architecture, the "right" fix is impossible. However, we can still kill the race conditions leading to arbitrary compilation failures. That trick depends on the atomicity of the mv command. Extensive comments explain what the workaround does. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3663 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--src/config/Config.lb9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/config/Config.lb b/src/config/Config.lb
index eb37b1e5c2..43d6ecdeb0 100644
--- a/src/config/Config.lb
+++ b/src/config/Config.lb
@@ -162,9 +162,16 @@ makerule documentation
action "doxygen corebootDoc.config"
end
+# Yes, the rule doesn't seem to make sense, but multiple images could try to
+# create a romcc binary at the same time, clobbering each other.
+# Our makefile architecture won't allow us to easily have the romcc target
+# in the main makefile, so keep it here and move the race condition winner
+# in place. That way, romcc may get compiled twice, but the binary will always
+# be in a correct and valid state if it exists because the move is atomic.
makerule ../romcc
depends "$(TOP)/util/romcc/romcc.c"
- action "$(HOSTCC) -g $(HOSTCFLAGS) $< -o $@"
+ action "$(HOSTCC) -g $(HOSTCFLAGS) $< -o romcc.tmpfile"
+ action "mv romcc.tmpfile $@"
end
makerule build_opt_tbl