[distcc] distcc won't output assembly to stdout; ccache loses also

Martin Pool mbp at samba.org
Fri Sep 27 05:04:01 GMT 2002


On 26 Sep 2002, Alexandre Oliva <aoliva at redhat.com> wrote:
> I've finally been able to find out why my distcc-accelerated builds of
> glibc sometimes failed, and why they created a file named `-' in
> stdio-common in the source tree.  It was distcc's fault.
> 
> glibc's Makefile asks gcc to compile a C program to assembly in the
> standard output (gcc -S foo.c -o -), but when distcc runs such a
> compilation remotely, it ends up storing the output sent back by the
> remote compiler in a file named ./-, instead of to the stdout.

Thanks, merged.  

Incidentally, gcc-3.2's manual does not mention "-o -".  It might be
good if it did.  Of course I know about it as a Unix/GNU convention,
but I didn't think of it because it's not there.

> Unfortunately, it's not easy to tell when the compiler output is
> supposed to go to stdout and when it should go to a file.  

Why?  Can't we just treat it as normal up until we open the file, and
then point "-" at stdout?

I think this is probably rare enough that it doesn't matter if it's
not distributed, though.

> Instead of trying to second-guess the compiler, I think it's
> reasonable and safe enough to simply defer compilations that output
> to `-' for the compiler to decide, which I've implemented in the
> patch below.

Thanks, I applied that and added a ScanArgs test sub-case.  

> ccache turns things a bit more confusing: with `-S -o -', we get
> assembly code in the standard output, but `-S -c -o -' and `-c -S -o
> -' will link a cached file to `-', even though gcc itself would have
> generated assembly to stdout.  Looks like a ccache bug to me, but I'm
> not sure whether to change ccache like I did to distcc, or to adjust
> its heuristics so as to match that of gcc (at the risk of making it
> incompatible with some other compiler).  After inspecting the ccache
> sources for a few seconds, I don't see immediately where to make any
> of these changes, so I'll wait for comments before doing anything.

If tridge doesn't fix it (famous slacker that he is :-) then I will
try later.

-- 
Martin 



More information about the distcc mailing list