On 9/28/05, Matthew Burgess <[EMAIL PROTECTED]> wrote:
>
> Trying to build using gcc-4.x would fail because glibc-2.3.5 installed
> headers that had syntax errors that the new compiler complained about.
> We obviously can't trust the host during early chapter 5, because it
> could contain anything.  Once glibc has been installed, with all its
> associated headers (and the ones from the earlier gcc pass), we know
> exactly what state the environment will be in.  Therefore, we used to
> prevent the fixincludes process from running, but as we've just
> installed known broken headers again this will stop anything that
> includes it (I think it was "pthread.h") from compiling.

It makes sense to run fixincludes in Ch 5 GCC Pass 1. But by the time
Ch 5 GCC Pass 2 is installed, we have control over the files that are
installed. So if there is something wrong in an header installed by a
previous pkg, we can patch the offending package rather than relying
on gcc fixincludes script (which does not have a very good history of
'fixing' errors).

>
> I therefore adopted the approach of letting fixincludes do its thing
> (after all, it will know far better than we do
> what needs fixing and what doesn't).  Testing showed that nothing used
> any headers that may be broken in our early chapter 5 environment, so we
> simply delete anything that may have come across from the host (that is
> anything in a subdirectory) and also anything with the magic string
> added by the fixinclude process.  In chapter 6, where we know
> fixincludes will only operate on our chrooted environment, we let it run
> simply because I'm fairly confident that fixincludes knows better than
> most of us on this list what may need fixing.

Based on past experience, the last statement may not be that accurate:)

There is another hidden problem in running fixincludes. Since
fixincludes does not fix the original copy but makes a copy of the
header in its internal directory and fixes the copy, even if the
package that contains the headers gets upgraded, gcc will still use
the fixed (and old) header while compiling. This may lead to some
strange errors.

--
Tushar Teredesai
   mailto:[EMAIL PROTECTED]
   http://www.linuxfromscratch.org/~tushar/
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to