The gcc configuration instructions *highly* recommend building outside the gcc source tree, and often, following the gcc-help list, I see that doing so causes problems. I propose that the build process be modified so as to default to *failing* to build under those circumstances. Add a configuration variable, if necessary, to allow such a build. In the meantime, I recommend that the "highly" recommendation be changed to some more mandatory language unless the user is a gcc developer.
Well it is not prohibited, it is supported to do the build in the src directory, just not recommended as it is not tested really and can (I think 4.3.x has a bug dealing with fixed includes) be broken even for releases.
Andrew, you're right--it's not prohibited, but my argument is that it should be prohibited as the default build (but have a specific configure variable to allow it), at least until it is tested. Over the years I've watched people have a build problem, and the first thing the gurus tell them is *don't* build in the gcc tree, so this enhancement would at least get newbies' attention instead of continuing to waste help bandwidth. Note the recommendation to not build in the tree has been around I'll guess for at least ten years. And with the complexity of the build I doubt that the tested in-tree build will ever be a requirement for a release. I envision a short but succinct message telling about the prohibition and adding a link to more detail. The installation instructions should perhaps have text enhancement or other edits to highlight the reason for the prohibition.
I think this is a great idea. A good error with a long explanation will save a lot of time for a lot of people. I don't think you even need the configure option to allow it. I cannot see why anyone would need to build in the source directory. Care to provide a patch?
With PR 35619 fixed in trunk it works fine for me to build in the source tree. Feel free to Cc: me on new bugs arising from an in-tree build. (Leaving bug open as it addresses 4.4 not trunk.)
status update: <http://gcc.gnu.org/ml/gcc-patches/2010-09/msg02033.html>.
I'm going to confirm this with a slightly modified title
(In reply to Eric Gallager from comment #6) > I'm going to confirm this with a slightly modified title Oops, I didn't actually confirm this when I said so; hopefully it'll do it this time.