From 8a3ad59653c2ecb9de0ffc91714855748f8a22b9 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Thu, 16 Oct 2008 23:44:21 +0000 Subject: 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 Acked-by: Carl-Daniel Hailfinger git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3663 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/config/Config.lb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3