[distcc] Preprocessed output to make's stdout instead of to remote distccd

Terry Griffin terryg at axian.com
Tue Oct 1 18:09:00 GMT 2002


> On 30 Sep 2002, Terry Griffin <terryg at axian.com> wrote:
>
>> In the mean time, building distcc with distcc exhibits the exact same
>> problem. Can we work it from that angle?
>
> Sure.
>
>> Is that a known issue or is it just me? That would suggest something
>> in my environment.
>
> Yes, I think it is.
>
> The log looks normal to me, except for the .i file being 0 bytes.  Why
> that is happening I don't know.  Are you sure that "cc" on the path is
> really gcc, not something else?
>
> Perhaps you could run strace on the client, and look at the output to
> make of which compiler is being invoked, and that the arguments are as
> they should be.
>
>> Below is make's stderr from trying to build just
>> clinet.o from distcc-0.11/src with this command:
>>
>>         make -j2 CC=distcc clinet.o
>
> Does it work with CC='distcc gcc'?
>

Got it. It's the -MMD switch on the compiler (-MD also). This causes
preprocessed output to go to stdout instead of to the file specified
by the -o switch.

Unlike the plain -M switch, -MM and -MMD do not inhibit normal compilation.
Because of this the -o switch is reserved to specify the location of the
object file, but since the -E switch is also specified no object file is
produced, and hence no .i file (which would have been the wrong file type
anyway). Since -o is meant for the object file when -MM or -MMD are used,
preprocessed output is sent to stdout. Also, the .d files produced by
-MM and -MMD end up in the wrong place. They're getting written to distcc's
tmp directory instead of the intended location.

So -MM and -MMD switches need special handling. And distcc needs to verify
that the .i file actually exists before bothering to send it to distccd.
That would have made this problem easier to figure out.

That was the common thread between distcc and my client's project. They
both use -MMD.

Terry

-- 
Terry Griffin
Axian Inc.
http://www.axian.com/




More information about the distcc mailing list