[distcc] gcc bootstraps with distcc

Alexandre Oliva oliva@lsd.ic.unicamp.br
Wed Jul 2 04:46:00 GMT 2003


On Jun 19, 2003, mbp@sourcefrog.net wrote:

> On 18 Jun 2003, Dara Hazeghi <dhazeghi@yahoo.com> wrote:

>> it's good to see that distcc just keeps improving! I
>> had one question. In the known problems list, it is
>> mentioned (or rather implied) that distcc can't be
>> used for gcc bootstraps. Is this still the case? If
>> so, perhaps a bug can be opened against gcc?

> I haven't tried it.  My impression was that you could make it work by
> excluding localhost from the list, though you might also need to put
> the build directory on a shared filesystem so that the later compilers
> can be found.  I think Alexandre might know.

Here's a patch for GCC that I've just tested, that was enough to get
GCC to bootstrap using distcc, using distccrel (attached) as per the
instructions in it.

It seems like the other problem I had before, of getting different
line numbers depending on whether separate or integrated preprocessing
is done is no longer present.  Wheee!

So, arranging for the directory where preprocessing happened (before
distcc ships the preprocessed code to the remote machine which starts
gcc in a potentially-different cwd) made it to the debugging info was
the only remaining issue, and this issue is fixed with the patch
below.

The patch introduces -Mpwd, that causes GCC to output the
preprocessing directory in the preprocessed output.  This means you
have to add -Mpwd to BOOT_CFLAGS to get a successful bootstrap, as
well as to get gdb to find source files in their original location,
even if using only ccache but using several different yet similar
source and build trees.  The reasons -Mpwd is not enabled by default
are backward compatibility (the <directory> directive might be
unexpected, even though it's in a format that is entirely
backward-compatible), efficiency and to enable ccache caches to be
shared by multiple build trees.

Anyway, here's the patch and the scripts I'm using for the build.

Note that, without this patch, distccrel still works for GCC
bootstraps, as long as every distcc in the network is started from a
pwd that expands to the same directory name (even if physically
different directories), and DISTCC_LOCALHOST is set to the local
machine's name, such that distcc doesn't use the integrated
preprocessor.

Bootstrapped in mainline on athlon-pc-linux-gnu.  Ok to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: distcc-preproc-directory-updated.patch
Type: text/x-patch
Size: 14954 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030702/ab0dfaaa/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: distccrel
Type: application/octet-stream
Size: 4150 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030702/ab0dfaaa/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netpwd
Type: application/octet-stream
Size: 803 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030702/ab0dfaaa/attachment-0001.obj>
-------------- next part --------------

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


More information about the Gcc-patches mailing list