This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Build generator programs in a build directory
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Kelley Cook <kcook at gcc dot gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>, Paolo Bonzini <bonzini at gnu dot org>
- Date: Thu, 26 Aug 2004 10:33:40 -0700
- Subject: Re: [patch] Build generator programs in a build directory
- References: <412DF2A0.9050804@gcc.gnu.org>
Kelley Cook <kcook@gcc.gnu.org> writes:
> Zack Weinberg said:
>> You can correct this by leaving the (elaborated) definition of
>> fancy_abort in gcov.c, or by adding rules to the Makefile to buld
>> two copies of errors.o, one for build one for host (see the existing
>> treatment of rtl.c) And if you like to rename all the object files
>> that are built only for the build machine, so that it's harder to
>> mak this mistake in the future, that would be nice.
>
> This patch takes Zack's suggestion and goes one step further and puts
> all the generated programs into a separate build/ directory. The only
> slight loss is that the few dozen gen* files will no longer be part of
> the bootstrap comparison process as they are no longer copied into the
> stageN directories.
>
> It should be mostly uncontroversial, though I would like Paolo to peruse
> it in case it has some ramifications for his toplevel bootstrap plan.
I agree that this should be mostly uncontroversial; I have no
objection, but would also like to hear Paolo's comment. I'd also like
to suggest that if this goes through, you remove the "build-" prefix
from the basenames of various object files, as this is now redundant.
> Doing this has some additional future benefits, since the gen*.o files
> are in a separate directory with a few tweaks they no longer would be
> required to be deleted and thereby forcibly rebuilt for each stage.
...
> The only disadvantage that I foresee will be that we will miss the case
> of a hypothetical complier bug that causes it to only miscompile one of
> the gen*.c in such a way that it generates a different insn-* file, but
> not end up misgenerating anything else in the rest of the compiler or
> the testsuite. That seems to be is a remote possibilty. I think that
> potential loss will be seen as a fair trade for greater developer
> efficiency.
There *have* been bugs in the past where the gen*.c have been
miscompiled, but like you, I doubt that those bugs would have failed
to show up elsewhere. And I certainly like the idea of making
bootstrap go faster.
zw