[llvm-commits] [llvm-gcc-4.2] r99412 - /llvm-gcc-4.2/trunk/libgomp/Makefile.in

Bob Wilson bob.wilson at apple.com
Wed Mar 24 11:59:49 PDT 2010


Author: bwilson
Date: Wed Mar 24 13:59:49 2010
New Revision: 99412

URL: http://llvm.org/viewvc/llvm-project?rev=99412&view=rev
Log:
Add comments for race condition fix, now that I'm reasonably confident that I
understand the problem.  I had been assuming that "mv" was implemented with
rename(2) when not crossing file system boundaries.  It used to be so.  On
Darwin, at least, the man page says that it is implemented using "rm" and "cp".
That leaves a brief time when the files in $(DEPDIR) do not exist.

Modified:
    llvm-gcc-4.2/trunk/libgomp/Makefile.in

Modified: llvm-gcc-4.2/trunk/libgomp/Makefile.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libgomp/Makefile.in?rev=99412&r1=99411&r2=99412&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/libgomp/Makefile.in (original)
+++ llvm-gcc-4.2/trunk/libgomp/Makefile.in Wed Mar 24 13:59:49 2010
@@ -457,8 +457,14 @@
 distclean-libtool:
 	-rm -f libtool
 
-# LLVM LOCAL: Try to avoid a mysterious race condition by adding a dependency.
+# LLVM LOCAL begin
+# Avoid a race condition: On systems where "mv" is implemented as "rm+cp",
+# even when not crossing a file system boundary, the files in $(DEPDIR) will
+# be momentarily absent when they are updated.  If the recursive make for
+# multilibs starts up when one of those files is missing, it will fail.
+# Add a dependency to prevent that.
 all-multi: $(LTLIBRARIES)
+# LLVM LOCAL end
 
 # GNU Make needs to see an explicit $(MAKE) variable in the command it
 # runs to enable its job server during parallel builds.  Hence the





More information about the llvm-commits mailing list