Changeset 3663 for trunk/coreboot-v2

Show
Ignore:
Timestamp:
10/17/08 01:44:21 (3 months ago)
Author:
hailfinger
Message:

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@…>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/coreboot-v2/src/config/Config.lb

    r3564 r3663  
    163163end 
    164164 
     165# Yes, the rule doesn't seem to make sense, but multiple images could try to 
     166# create a romcc binary at the same time, clobbering each other. 
     167# Our makefile architecture won't allow us to easily have the romcc target 
     168# in the main makefile, so keep it here and move the race condition winner 
     169# in place. That way, romcc may get compiled twice, but the binary will always 
     170# be in a correct and valid state if it exists because the move is atomic. 
    165171makerule ../romcc    
    166172        depends "$(TOP)/util/romcc/romcc.c"  
    167         action  "$(HOSTCC) -g $(HOSTCFLAGS) $< -o $@" 
     173        action  "$(HOSTCC) -g $(HOSTCFLAGS) $< -o romcc.tmpfile" 
     174        action  "mv romcc.tmpfile $@" 
    168175end 
    169176