Prevent GCC's fixincludes from running during chapter 5 pass2 and chapter 6

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@6959 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Matthew Burgess 2005-10-04 19:56:35 +00:00
parent cad7b50152
commit 27ced84613
5 changed files with 38 additions and 22 deletions

View File

@ -122,6 +122,11 @@ First a summary, then a detailed log.</para>
</itemizedlist> </itemizedlist>
</listitem> </listitem>
<listitem><para>October 4, 2005 [matt]: Prevent GCC from running the
<command>fixincludes</command> script in chapter5 pass2 and chapter 6 (fixes bug
1636). Thanks to Tushar and Greg for their contributions on this issue.</para>
</listitem>
<listitem><para>September 29, 2005 [matt]: Add more explicit reader <listitem><para>September 29, 2005 [matt]: Add more explicit reader
prerequisites (fixes bug 1629).</para></listitem> prerequisites (fixes bug 1629).</para></listitem>

View File

@ -61,10 +61,18 @@ dynamic linker in the above commands. Refer back to <xref
linkend="ch-tools-toolchaintechnotes" role=","/> if linkend="ch-tools-toolchaintechnotes" role=","/> if
necessary.</para></important> necessary.</para></important>
<para>There is a possibility that some header files from the host system have <para>During the build process, GCC runs a script
found their way into GCC's private include dir. This can happen as a result of (<command>fixincludes</command>) that scans the system for header files that may
GCC's <quote>fixincludes</quote> process, which runs as part of the GCC build. need to be fixed (they might contain syntax errors, for example), and installs
This is explained in more detail later in this chapter. Run the following commands to remove those header files (you may find it easier to copy and paste these commands, rather than typing them by hand, due to their length):</para> the fixed versions in a private include directory. There is a possibility that,
as a result of this process, some header files from the host system have found
their way into GCC's private include dir. As the rest of this chapter only
requires the headers from GCC and Glibc, which have both been installed at this
point, any &quot;fixed&quot; headers can safely be removed. This helps to avoid
any host headers polluting the build environment. Run the following commands to
remove the header files in GCC's private include directory (you may find it
easier to copy and paste these commands, rather than typing them by hand, due to
their length):</para>
<!-- && used to ease copy and pasting --> <!-- && used to ease copy and pasting -->
<screen><userinput>GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include &amp;&amp; <screen><userinput>GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include &amp;&amp;

View File

@ -58,24 +58,19 @@ Binutils until this issue is resolved. Please consult the LFS FAQ at <ulink
url="&lfs-root;/lfs/faq.html#no-ptys"/> for more information on how to get PTYs url="&lfs-root;/lfs/faq.html#no-ptys"/> for more information on how to get PTYs
working.</para> working.</para>
<para>Under normal circumstances, the GCC <command>fixincludes</command> script <para>As previously explained in <xref linkend="ch-tools-adjusting"/>, under
scans the system for header files that need to be fixed (they may contain syntax normal circumstances the GCC <command>fixincludes</command> script is run in
errors, for example). The script might find that some Glibc header files on the order to fix potentially broken header files. As GCC-&gcc-version; and
host system need to be fixed, so fixes them and puts them in the GCC private Glibc-&glibc-version; have already been installed at this point, and their
include directory. In <xref linkend="chapter-building-system"/>, after the respective header files are known not to require fixing, the
newer Glibc has been installed, this private include directory will be searched <command>fixincludes</command> script is not required. As mentioned previously,
before the system include directory. This may result in GCC finding the fixed the script may in fact pollute the build environment by installing fixed headers
headers from the host system, which most likely will not match the Glibc version from the host system into GCC's private include directory. The running of the
used for the LFS system.</para> <command>fixincludes</command> script can be suppressed by issuing the following
commands:</para>
<para>The following command adjusts where the GCC <command>fixincludes</command>
script searches for headers, so that it fixes only the new headers under
<filename class="directory">/tools</filename>, not the ones from your host
system.</para>
<screen><userinput>cp -v gcc/Makefile.in{,.orig} &amp;&amp; <screen><userinput>cp -v gcc/Makefile.in{,.orig} &amp;&amp;
sed 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \ sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
<para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/> <para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
built GCC with the <option>-fomit-frame-pointer</option> compiler flag. built GCC with the <option>-fomit-frame-pointer</option> compiler flag.

View File

@ -53,6 +53,14 @@ Non-bootstrap builds omit this flag by default, so apply the following
<screen><userinput>sed -i 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in</userinput></screen> <screen><userinput>sed -i 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in</userinput></screen>
<para>The <command>fixincludes</command> script is known to occasionally
erroneously attempt to &quot;fix&quot; the system headers installed so far. As
the headers installed by GCC-&gcc-version; and Glibc-&glibc-version; are known
to not require fixing, issue the following command to prevent the
<command>fixincludes</command> script from running:</para>
<screen><userinput>sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen>
<para>The GCC documentation recommends building GCC outside of the source <para>The GCC documentation recommends building GCC outside of the source
directory in a dedicated build directory:</para> directory in a dedicated build directory:</para>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!ENTITY version "SVN-20051001"> <!ENTITY version "SVN-20051004">
<!ENTITY releasedate "October 1, 2005"> <!ENTITY releasedate "October 4, 2005">
<!ENTITY milestone "6.2"> <!ENTITY milestone "6.2">
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" --> <!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->