Changeset 6e41459 for chapter05/gcc-pass1.xml
- Timestamp:
- 08/08/2004 02:10:39 AM (20 years ago)
- Branches:
- 6.0
- Children:
- ef13657
- Parents:
- 78349b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/gcc-pass1.xml
r78349b7 r6e41459 28 28 <title>Installation of GCC</title> 29 29 30 <para>Unpack only the GCC-core tarball, as we won't be needing the C++ compiler31 nor the test suitehere.</para>30 <para>Unpack only the gcc-core tarball because neither the C++ 31 compiler nor the test suite will be needed here.</para> 32 32 33 <para>This package is known to behave badly when you change itsdefault33 <para>This package is known to have issues when the default 34 34 optimization flags (including the <parameter>-march</parameter> and 35 <parameter>-mcpu</parameter> options). Therefore, if you have defined any 36 environment variables that override default optimizations, such as CFLAGS and 37 CXXFLAGS, we recommend un-setting them when building GCC.</para> 35 <parameter>-mcpu</parameter> options) are changed. Therefore, if any 36 environment variables that override default optimizations have been 37 defined, such as <emphasis>CFLAGS</emphasis> and 38 <emphasis>CXXFLAGS</emphasis>, we recommend un-setting them when 39 building GCC.</para> 38 40 39 <para>The GCC documentation recommends building GCC outside of the source40 directory in a dedicated build directory:</para>41 <para>The GCC documentation recommends building GCC outside of the 42 source directory in a dedicated build directory:</para> 41 43 42 44 <screen><userinput>mkdir ../gcc-build … … 56 58 <listitem><para>The purpose of this switch is to remove <filename class="directory">/usr/local/include</filename> 57 59 from <command>gcc</command>'s include search path. This is not absolutely 58 essential ; however, we want to tryto minimize the influence of the host59 system , so this a sensible thing to do.</para></listitem>60 essential, however, this helps to minimize the influence of the host 61 system.</para></listitem> 60 62 </varlistentry> 61 63 62 64 <varlistentry> 63 65 <term><parameter>--enable-shared</parameter></term> 64 <listitem><para>This switch may 65 seem counter-intuitive at first. But using it allows the building of 66 <filename>libgcc_s.so.1</filename> and <filename>libgcc_eh.a</filename>, and 67 having <filename>libgcc_eh.a</filename> available ensures that the configure 68 script for Glibc (the next package we compile) produces the proper results. 69 Note that the GCC binaries will still be linked 70 statically, as this is controlled by the <parameter>-static</parameter> 71 value of BOOT_LDFLAGS in the next step.</para></listitem> 66 <listitem><para>This switch may seem counter-intuitive at first. 67 However, this switch allows the building of 68 <filename>libgcc_s.so.1</filename> and 69 <filename>libgcc_eh.a</filename>, and having 70 <filename>libgcc_eh.a</filename> available ensures that the configure 71 script for Glibc (the next package we compile) produces the proper 72 results. Note that the GCC binaries will still be linked statically, 73 as this is controlled by the <parameter>-static</parameter> value of 74 the <emphasis>BOOT_LDFLAGS</emphasis> variable in the next 75 step.</para></listitem> 72 76 </varlistentry> 73 77 … … 75 79 <term><parameter>--enable-languages=c</parameter></term> 76 80 <listitem><para>This option 77 ensures that only the C compiler is built. The option is only needed when you 78 have downloaded and unpacked the full GCC tarball.</para></listitem> 81 ensures that only the C compiler is built. This option is only needed when you 82 have downloaded and unpacked the full GCC tarball, as opposed to just 83 having unpacked the gcc-core tarball.</para></listitem> 79 84 </varlistentry> 80 85 </variablelist> … … 94 99 <varlistentry> 95 100 <term><parameter>bootstrap</parameter></term> 96 <listitem><para>This target does n't just97 compile GCC, but compiles it several times. It uses the programs compiled in 98 a first round to compile itself a second time, and then again a third time. 99 It then compares these second and third compiles to make sure it can 100 reproduce itself flawlessly, which most probably means that it was 101 co mpiled correctly.</para></listitem>101 <listitem><para>This target does not just compile GCC, but compiles it 102 several times. It uses the programs compiled in a first round to 103 compile itself a second time, and then again a third time. It then 104 compares these second and third compiles to make sure it can reproduce 105 itself flawlessly. This also implies that it was compiled 106 correctly.</para></listitem> 102 107 </varlistentry> 103 108 </variablelist> 104 109 105 <para>Compilation is now complete, and at this point we would normally run the 106 test suite. But, as mentioned before, the test suite framework is not in place 107 yet. And there would be little point in running the tests anyhow, since the 108 programs from this first pass will soon be replaced.</para> 110 <para>Compilation is now complete. At this point, the test suite would 111 normally be run, but, as mentioned before, the test suite framework is 112 not in place yet. The benefits of running the tests at this point 113 would be minimal since the programs from this first pass will soon be 114 replaced.</para> 109 115 110 <para> Now install the package:</para>116 <para>Install the package:</para> 111 117 112 118 <screen><userinput>make install</userinput></screen> 113 119 114 <para>As a finishing touch we'll create a symlink. Many programs and scripts 115 run <command>cc</command> instead of <command>gcc</command>, 116 a thing meant to keep programs generic and therefore usable on all kinds of 117 Unix systems. Not everybody has the GNU C compiler installed. Simply running 118 <command>cc</command> leaves the system administrator free to decide what 119 C compiler to install, as long as there's a symlink pointing to it:</para> 120 <para>As a finishing touch, create a symlink. Many programs and 121 scripts run <command>cc</command> instead of <command>gcc</command>, which is used to keep programs generic 122 and therefore usable on all kinds of UNIX systems where the GNU C compiler 123 is not always installed. Running <command>cc</command> leaves the system administrator 124 free to decide what C compiler to install.</para> 120 125 121 126 <screen><userinput>ln -s gcc /tools/bin/cc</userinput></screen> … … 128 133 129 134 </sect1> 135
Note:
See TracChangeset
for help on using the changeset viewer.