Changeset 8374

Show
Ignore:
Timestamp:
09/15/07 14:45:13 (8 months ago)
Author:
jhuntwork
Message:

Upgrade to GCC-4.2.1. Fixes #2002. Merged from jh branch, thanks to Matthew Burgess for preparing a discrete patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/BOOK/chapter01/changelog.xml

    r8373 r8374  
    4141      <itemizedlist> 
    4242        <listitem> 
     43          <para>[jhuntwork] - Upgrade to GCC-4.2.1. Fixes 
     44          <ulink url="&lfs-ticket-root;2002">#2002</ulink>. 
     45          Thanks to Matthew Burgess for preparing a discrete patch.</para> 
     46        </listitem> 
     47        <listitem> 
    4348          <para>[matthew] - Upgrade to DB-4.6.19. Fixes 
    4449          <ulink url="&lfs-ticket-root;2051">#2051</ulink>.</para> 
  • trunk/BOOK/chapter01/whatsnew.xml

    r8373 r8374  
    7878      <para>Gawk &gawk-version;</para> 
    7979    </listitem>--> 
    80     <!--<listitem> 
     80    <listitem> 
    8181      <para>GCC &gcc-version;</para> 
    8282    </listitem> 
    83     <listitem> 
     83    <!--<listitem> 
    8484      <para>Gettext &gettext-version;</para> 
    8585    </listitem>--> 
     
    226226    </listitem> 
    227227 
     228    <listitem> 
     229      <para>gcc-4.1.2-specs-1.patch</para> 
     230    </listitem> 
     231 
    228232  </itemizedlist> 
    229233 
  • trunk/BOOK/chapter03/patches.xml

    r8373 r8374  
    8484 
    8585    <varlistentry> 
    86       <term>GCC Specs Patch - <token>&gcc-specs-patch-size;</token>:</term> 
    87       <listitem> 
    88         <para>Download: <ulink url="&patches-root;&gcc-specs-patch;"/></para> 
    89         <para>MD5 sum: <literal>&gcc-specs-patch-md5;</literal></para> 
    90       </listitem> 
    91     </varlistentry> 
    92  
    93     <varlistentry> 
    9486      <term>Grep RedHat Fixes Patch - <token>&grep-fixes-patch-size;</token>:</term> 
    9587      <listitem> 
  • trunk/BOOK/chapter05/adjusting.xml

    r8242 r8374  
    4949 
    5050<!-- Ampersands are needed to allow copy and paste --> 
    51 <screen><userinput>gcc -dumpspecs | sed 's@^/lib/ld-linux.so.2@/tools&amp;@g' \ 
     51<screen><userinput>gcc -dumpspecs | sed 's@/lib/ld-linux.so.2@/tools&amp;@g' \ 
    5252  > `dirname $(gcc -print-libgcc-file-name)`/specs</userinput></screen> 
    5353 
  • trunk/BOOK/chapter05/gcc-pass1.xml

    r8366 r8374  
    102102    </variablelist> 
    103103 
    104     <para>Continue with compiling the package:</para> 
     104    <para>The following command will compile GCC not once, but several times. It 
     105    uses the programs compiled in a first round to compile itself a second time, 
     106    and then again a third time. It then compares these second and third compiles 
     107    to make sure it can reproduce itself flawlessly. This is called 
     108    <quote>bootstrapping</quote>. Building GCC in this way ensures that it was 
     109    compiled correctly and is now the default configuration for the released 
     110    package. Continue with compiling by running:</para> 
    105111 
    106 <screen><userinput>make bootstrap</userinput></screen> 
    107  
    108     <variablelist> 
    109       <title>The meaning of the make parameter:</title> 
    110  
    111       <varlistentry> 
    112         <term><parameter>bootstrap</parameter></term> 
    113         <listitem> 
    114           <para>This target does not just compile GCC, but compiles it 
    115           several times. It uses the programs compiled in a first round 
    116           to compile itself a second time, and then again a third time. 
    117           It then compares these second and third compiles to make sure 
    118           it can reproduce itself flawlessly. This also implies that it 
    119           was compiled correctly.</para> 
    120         </listitem> 
    121       </varlistentry> 
    122  
    123     </variablelist> 
     112<screen><userinput>make</userinput></screen> 
    124113 
    125114    <para>Compilation is now complete. At this point, the test suite would 
  • trunk/BOOK/chapter05/gcc-pass2.xml

    r8366 r8374  
    9191  &gt; gcc/Makefile.in</userinput></screen> 
    9292 
    93     <para>Apply the following patch to change the location of GCC's default 
    94     dynamic linker (typically <filename 
    95     class="libraryfile">ld-linux.so.2</filename>):</para> 
    96  
    97 <screen><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen> 
    98  
    99     <para>The above patch also removes <filename 
     93    <para>The following command will change the location of GCC's default 
     94    dynamic linker to use the one we installed in 
     95    <filename class="directory">/tools</filename>. It also removes <filename 
    10096    class="directory">/usr/include</filename> from GCC's include search path. 
    101     Patching now rather than adjusting the specs file after installation 
     97    Doing this now rather than adjusting the specs file after installation 
    10298    ensures that the new dynamic linker is used during the actual build of 
    10399    GCC. That is, all of the binaries created during the build will link 
    104     against the new Glibc.</para> 
    105  
    106     <important> 
    107       <para>The above patch is critical in ensuring a successful overall 
    108       build. Do not forget to apply it.</para> 
    109     </important> 
     100    against the new Glibc. Issue:</para> 
     101 
     102<screen><userinput>for file in $(find gcc/config -name linux64.h -o -name linux.h) 
     103do 
     104  cp -uv $file{,.orig} 
     105  sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \ 
     106  -e 's@/usr@/tools@g' $file.orig &gt; $file 
     107  echo " 
     108#undef STANDARD_INCLUDE_DIR 
     109#define STANDARD_INCLUDE_DIR 0" &gt;&gt; $file 
     110  touch $file.orig 
     111done</userinput></screen> 
     112 
     113    <para>In case the above seems hard to follow, let's break it down a bit. 
     114    First we find all the files under the gcc/config directory that are named 
     115    either <filename>linux.h</filename> or <filename>linux64.h</filename>. 
     116    For each file found, we copy it to a file of the same name but with an added 
     117    suffix of <quote>.orig</quote>. Then the first sed expression prepends 
     118    <quote>/tools</quote> to every instance of <quote>/lib/ld</quote>, 
     119    <quote>/lib64/ld</quote> or <quote>/lib32/ld</quote>, while the second one 
     120    replaces hard-coded instances of <quote>/usr</quote>. Then we add our define 
     121    statements which alter the include search path to the end of the file. Finally, 
     122    we use <command>touch</command> to update the timestamp on the copied files. 
     123    When used in conjunction with <command>cp -u</command>, this prevents unexpected 
     124    changes to the original files in case the command is inadvertently run twice. 
     125    </para> 
    110126 
    111127    <para>Create a separate build directory again:</para> 
     
    123139    --enable-shared --enable-threads=posix \ 
    124140    --enable-__cxa_atexit --enable-languages=c,c++ \ 
    125     --disable-libstdcxx-pch</userinput></screen> 
     141    --disable-libstdcxx-pch --disable-bootstrap</userinput></screen> 
    126142 
    127143    <variablelist> 
     
    178194      </varlistentry> 
    179195 
     196      <varlistentry> 
     197        <term><parameter>--disable-bootstrap</parameter></term> 
     198        <listitem> 
     199          <para>Bootstrapping the compiler is now the default for GCC. However, 
     200          our build method should provide us with a solid compiler without the 
     201          need to bootstrap each time.</para> 
     202        </listitem> 
     203      </varlistentry> 
     204 
    180205    </variablelist> 
    181206 
  • trunk/BOOK/chapter05/perl.xml

    r8366 r8374  
    4949<screen><userinput>patch -Np1 -i ../&perl-libc-patch;</userinput></screen> 
    5050 
     51    <para>Fix an incompatibility with gcc-&gcc-version;:</para> 
     52 
     53<screen><userinput>mv -v makedepend.SH{,.orig} 
     54sed 's/command /command[ -]/' makedepend.SH.orig &gt; makedepend.SH</userinput></screen> 
     55 
    5156    <para>Prepare Perl for compilation (make sure to get the 
    5257    'Data/Dumper Fcntl IO POSIX' part of the command correct&mdash;they are all 
  • trunk/BOOK/chapter06/gcc.xml

    r8366 r8374  
    8484    --libexecdir=/usr/lib --enable-shared \ 
    8585    --enable-threads=posix --enable-__cxa_atexit \ 
    86     --enable-clocale=gnu --enable-languages=c,c++</userinput></screen> 
     86    --enable-clocale=gnu --enable-languages=c,c++ \ 
     87    --disable-bootstrap</userinput></screen> 
    8788 
    8889    <para>Compile the package:</para> 
  • trunk/BOOK/chapter06/perl.xml

    r8366 r8374  
    4747 
    4848<screen><userinput>echo "127.0.0.1 localhost $(hostname)" &gt; /etc/hosts</userinput></screen> 
     49 
     50    <para>Fix an incompatibility with gcc-&gcc-version;:</para> 
     51 
     52<screen><userinput>sed -i 's/command /command[ -]/' makedepend.SH</userinput></screen> 
    4953 
    5054    <para>To have full control over the way Perl is set up, you can run the 
  • trunk/BOOK/packages.ent

    r8373 r8374  
    169169<!ENTITY gawk-ch6-sbu "0.2 SBU"> 
    170170 
    171 <!ENTITY gcc-version "4.1.2"> 
    172 <!ENTITY gcc-size "38,777 KB"> 
     171<!ENTITY gcc-version "4.2.1"> 
     172<!ENTITY gcc-size "43,029 KB"> 
    173173<!ENTITY gcc-url "&gnu;gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2"> 
    174 <!ENTITY gcc-md5 "a4a3eb15c96030906d8494959eeda23c"> 
     174<!ENTITY gcc-md5 "cba410e6ff70f7d7f4be7a0267707fd0"> 
    175175<!ENTITY gcc-home "http://gcc.gnu.org/"> 
    176176<!ENTITY gcc-ch5p1-du "655 MB"> 
  • trunk/BOOK/patches.ent

    r8373 r8374  
    3939<!ENTITY gawk-segfault-patch-size "1.3 KB"> 
    4040 
    41  
    42 <!ENTITY gcc-specs-patch "gcc-&gcc-version;-specs-1.patch"> 
    43 <!ENTITY gcc-specs-patch-md5 "a17be8ccfb978e73f382be5093dd8abd"> 
    44 <!ENTITY gcc-specs-patch-size "14.8 KB"> 
    4541 
    4642<!ENTITY grep-fixes-patch "grep-&grep-version;-redhat_fixes-2.patch">