* Eric Blake wrote on Sat, Apr 11, 2009 at 02:49:51AM CEST: > According to Bruno Haible on 4/10/2009 5:21 PM: > > Ralf Wildenhues wrote: > >> How about trying to fix it instead of this? > > > > You want to know the "root of the problem"?
Yes. The actual root of the problem. > > source='unictype/test-categ_Nl.c' object='unictype/test-categ_Nl.o' > > libtool=no \ > > DEPDIR=.deps depmode=gcc /bin/sh ../build-aux/depcomp \ > > gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64 -DHAVE_CONFIG_H \ > > -I. -I.. -I. -I. -I.. -I./.. -I../lib -I./../lib -g -O2 -c \ > > -o unictype/test-categ_Nl.o unictype/test-categ_Nl.c > > > > which invokes the command > > > > gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64 -DHAVE_CONFIG_H \ > > -I. -I.. -I. -I. -I.. -I./.. -I../lib -I./../lib -g -O2 -c \ > > -o unictype/test-categ_Nl.o unictype/test-categ_Nl.c \ > > -Wp,-MD,unictype/.deps/test-categ_Nl.TPo > > It looks like there is a bug in depcomp (or maybe in gcc) Well, if Bruno has run the latter command only (without going through the depcomp wrapper), and got inconsistent results, then that indicates a bug in this gcc. Peter, would you file a bug report with Apple for us? > Are we sure we can't rule out a depcomp fix (or at > least a workaround in depcomp), AIUI, the nature of the issue seems to be that one process scribbles into the file already written to by another process. Unless this particular gcc version has a switch to disable -MD for one of the two compilations, or direct the output elsewhere without a race, then we may still be able to exploit the fact that the output by the second process ends in a newline without backslash. Can you try this patch against Automake (untested)? I must add that this patch will likely require quite a bit of testing on weird systems, as I'm not sure whether all compilers which currently are classified as having depmode "gcc" will produce one long list without repeating the target. Also, unfortunately the produced file still has unreliable semantics (as the dependency list still depends upon a race). Removing everything past a non-backslash-newline would be an alternative, but when that causes breakage with other compilers, it could be very ugly (and silent). Cheers, Ralf 2009-04-11 Ralf Wildenhues <[email protected]> Avoid gcc depmode breakage due to Apple gcc in universal mode. * lib/depcomp: With depmode 'gcc', add backslashes to lines missing them, to avoid bogus racy output from Apple GCC in universal mode. Report by Bruno Haible and Peter O'Gorman. diff --git a/lib/depcomp b/lib/depcomp index 0fb633e..f215e21 100755 --- a/lib/depcomp +++ b/lib/depcomp @@ -147,7 +147,8 @@ gcc) alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" + -e 's/^['$alpha']:\/[^:]*: / /' \ + -e '$!s/[^\\]$/&\\/' '< "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is
