bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tweak for documentation of how to create universal binaries


From: Bruno Haible
Subject: Re: tweak for documentation of how to create universal binaries
Date: Sat, 11 Apr 2009 12:29:10 +0200
User-agent: KMail/1.9.9

Ralf Wildenhues wrote:
> 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.

Yes, the command that I ran 1000 times was the gcc command that produces
the *.TPo file.

> AIUI, the nature of the issue seems to be that one process scribbles
> into the file already written to by another process.

Yes. Or that two processes (or two threads) write to the same file at the
same time, through two different file descriptors.

> 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,

I don't see such a flag in Apple gcc's documentation.

> then we may 
> still be able to exploit the fact that the output by the second process
> ends in a newline without backslash.

Yes, this should be possible.

Other alternatives would be to run the gcc command twice, once with a
single -arch option only to produce the .TPo file, and once with all
-arch options and without -MD, to produce the object file. But doubling
the compilation times will not sit with most people. Then people will
really prefer --disable-dependency-tracking.

Or to repeat the gcc command if and only if the generated .TPo file is
malformed. The performance overhead of doing this should be small.

> +      -e 's/^['$alpha']:\/[^:]*: / /' \
> +      -e '$!s/[^\\]$/&\\/' '< "$tmpdepfile" >> "$depfile"

The last line has an odd number of single-quotes. If I remove the last
extraneous single-quote, what it does in my particular case is to produce
a file that ends in

  /usr/include/string.h unictype/test-predicate-part2.h\
lib/string.h \
  /usr/include/string.h unictype/test-predicate-part2.h

which will cause "make" to complain about a nonexistent file
'lib/string.h':

make[3]: *** No rule to make target `lib/string.h', needed by 
`unictype/test-categ_Nl.o'.  Stop.

IMO, depcomp must ignore everything past the first non-backslashed
newline - or must ignore the generated .TPo file altogether.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]