Changeset 1391 for branches/GNU/src/gcc/INSTALL/build.html
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (22 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
INSTALL/build.html (modified) (12 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 dir.info 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/INSTALL/build.html
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r1390 r1391 1 <html lang="en"><head> 1 <html lang="en"> 2 <head> 2 3 <title>Installing GCC: Building</title> 3 4 <meta http-equiv="Content-Type" content="text/html"> 4 <meta name=description content="Installing GCC: Building"> 5 <meta name=generator content="makeinfo 4.0"> 6 <link href="http://texinfo.org/" rel=generator-home> 7 </head><body> 8 9 <p>N<p>ow that GCC is configured, you are ready to build the compiler and 5 <meta name="description" content="Installing GCC: Building"> 6 <meta name="generator" content="makeinfo 4.6"> 7 <!-- 8 Copyright © 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 9 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 10 <br><p> 11 <p>Permission is granted to copy, distribute and/or modify this document 12 under the terms of the GNU Free Documentation License, Version 1.2 or 13 any later version published by the Free Software Foundation; with no 14 Invariant Sections, the Front-Cover texts being (a) (see below), and 15 with the Back-Cover Texts being (b) (see below). A copy of the 16 license is included in the section entitled "<a href="./gfdl.html">GNU Free Documentation License</a>". 17 18 <p>(a) The FSF's Front-Cover Text is: 19 20 <p>A GNU Manual 21 22 <p>(b) The FSF's Back-Cover Text is: 23 24 <p>You have freedom to copy and modify this GNU Manual, like GNU 25 software. Copies published by the Free Software Foundation raise 26 funds for GNU development.--> 27 <meta http-equiv="Content-Style-Type" content="text/css"> 28 <style type="text/css"><!-- 29 pre.display { font-family:inherit } 30 pre.format { font-family:inherit } 31 pre.smalldisplay { font-family:inherit; font-size:smaller } 32 pre.smallformat { font-family:inherit; font-size:smaller } 33 pre.smallexample { font-size:smaller } 34 pre.smalllisp { font-size:smaller } 35 --></style> 36 </head> 37 <body> 38 <h1 class="settitle">Installing GCC: Building</h1> 39 Now that GCC is configured, you are ready to build the compiler and 10 40 runtime libraries. 11 41 12 <p>We <strong>highly</strong> recommend that GCC be built using GNU make;42 <p>We <strong>highly</strong> recommend that GCC be built using GNU make; 13 43 other versions may work, then again they might not. 14 44 GNU make is required for compiling GNAT (the Ada compiler) and the Java 15 45 runtime library. 16 46 17 <p>(For example, many broken versions of make will fail if you use the47 <p>(For example, many broken versions of make will fail if you use the 18 48 recommended setup where <var>objdir</var> is different from <var>srcdir</var>. 19 49 Other broken versions may recompile parts of the compiler when 20 50 installing the compiler.) 21 51 22 <p>Some commands executed when making the compiler may fail (return a52 <p>Some commands executed when making the compiler may fail (return a 23 53 nonzero status) and be ignored by <code>make</code>. These failures, which 24 54 are often due to files that were not found, are expected, and can safely 25 55 be ignored. 26 56 27 <p>It is normal to have compiler warnings when compiling certain files.57 <p>It is normal to have compiler warnings when compiling certain files. 28 58 Unless you are a GCC developer, you can generally ignore these warnings 29 59 unless they cause compilation to fail. 30 60 31 <p>On certain old systems, defining certain environment variables such as61 <p>On certain old systems, defining certain environment variables such as 32 62 <code>CC</code> can interfere with the functioning of <code>make</code>. 33 63 34 <p>If you encounter seemingly strange errors when trying to build the64 <p>If you encounter seemingly strange errors when trying to build the 35 65 compiler in a directory other than the source directory, it could be 36 66 because you have previously configured the compiler in the source 37 67 directory. Make sure you have done all the necessary preparations. 38 68 39 <p>If you build GCC on a BSD system using a directory stored in an old System69 <p>If you build GCC on a BSD system using a directory stored in an old System 40 70 V file system, problems may occur in running <code>fixincludes</code> if the 41 71 System V file system doesn't support symbolic links. These problems … … 44 74 that type mismatches occur, this could be the cause. 45 75 46 <p>The solution is not to use such a directory for building GCC.47 48 <p>When building from CVS or snapshots, or if you modify parser sources,76 <p>The solution is not to use such a directory for building GCC. 77 78 <p>When building from CVS or snapshots, or if you modify parser sources, 49 79 you need the Bison parser generator installed. Any version 1.25 or 50 80 later should work; older versions may also work. If you do not modify … … 52 82 not need Bison installed to build them. 53 83 54 <p>When building from CVS or snapshots, or if you modify Texinfo55 documentation, you need version 4. 1or later of Texinfo installed if you84 <p>When building from CVS or snapshots, or if you modify Texinfo 85 documentation, you need version 4.2 or later of Texinfo installed if you 56 86 want Info documentation to be regenerated. Releases contain Info 57 87 documentation pre-built for the unmodified documentation in the release. 58 88 59 <h 2><a name="TOC0">Building a native compiler</h2>89 <h3 class="section"><a name="TOC0"></a>Building a native compiler</h3> 60 90 61 91 <p>For a native build issue the command <code>make bootstrap</code>. This 62 92 will build the entire GCC system, which includes the following steps: 63 93 64 <ul>94 <ul> 65 95 <li>Build host tools necessary to build the compiler such as texinfo, bison, 66 96 gperf. 67 97 68 <li>Build target tools for use by the compiler such as binutils (bfd,98 <li>Build target tools for use by the compiler such as binutils (bfd, 69 99 binutils, gas, gprof, ld, and opcodes) 70 100 if they have been individually linked 71 101 or moved into the top level GCC source tree before configuring. 72 102 73 <li>Perform a 3-stage bootstrap of the compiler.74 75 <li>Perform a comparison test of the stage2 and stage3 compilers.76 77 <li>Build runtime libraries using the stage3 compiler from the previous step.78 79 </ul>80 81 <p>If you are short on disk space you might consider <code>make103 <li>Perform a 3-stage bootstrap of the compiler. 104 105 <li>Perform a comparison test of the stage2 and stage3 compilers. 106 107 <li>Build runtime libraries using the stage3 compiler from the previous step. 108 109 </ul> 110 111 <p>If you are short on disk space you might consider <code>make 82 112 bootstrap-lean</code> instead. This is identical to <code>make 83 113 bootstrap</code> except that object files from the stage1 and … … 85 115 soon as they are no longer needed. 86 116 87 <p>If you want to save additional space during the bootstrap and in117 <p>If you want to save additional space during the bootstrap and in 88 118 the final installation as well, you can build the compiler binaries 89 119 without debugging information as in the following example. This will save … … 91 121 (Libraries will still contain debugging information.) 92 122 93 <pre >make CFLAGS='-O' LIBCFLAGS='-g -O2' \94 LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap95 </pre>96 97 <p>If you wish to use non-default GCC flags when compiling the stage2 and123 <pre class="example"> make CFLAGS='-O' LIBCFLAGS='-g -O2' \ 124 LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap 125 </pre> 126 127 <p>If you wish to use non-default GCC flags when compiling the stage2 and 98 128 stage3 compilers, set <code>BOOT_CFLAGS</code> on the command line when doing 99 129 <code>make bootstrap</code>. Non-default optimization flags are less well … … 106 136 bootstrap4</code> to increase the number of stages of bootstrap. 107 137 108 <p>If you used the flag <code>--enable-languages=<small>...</small></code> to restrict138 <p>If you used the flag <code>--enable-languages=...</code> to restrict 109 139 the compilers to be built, only those you've actually enabled will be 110 140 built. This will of course only build those runtime libraries, for … … 113 143 <strong>does not</strong> work anymore! 114 144 115 <p>If the comparison of stage2 and stage3 fails, this normally indicates145 <p>If the comparison of stage2 and stage3 fails, this normally indicates 116 146 that the stage2 compiler has compiled GCC incorrectly, and is therefore 117 147 a potentially serious bug which you should investigate and report. (On … … 120 150 need to disable comparison in the <code>Makefile</code>.) 121 151 122 <h 2><a name="TOC1">Building a cross compiler</h2>152 <h3 class="section"><a name="TOC1"></a>Building a cross compiler</h3> 123 153 124 154 <p>We recommend reading the … … 126 156 for information about building cross compilers. 127 157 128 <p>When building a cross compiler, it is not generally possible to do a158 <p>When building a cross compiler, it is not generally possible to do a 129 159 3-stage bootstrap of the compiler. This makes for an interesting problem 130 160 as parts of GCC can only be built with GCC. 131 161 132 <p>To build a cross compiler, we first recommend building and installing a162 <p>To build a cross compiler, we first recommend building and installing a 133 163 native compiler. You can then use the native GCC compiler to build the 134 164 cross compiler. The installed native compiler needs to be GCC version 135 165 2.95 or later. 136 166 137 <p>Assuming you have already installed a native copy of GCC and configured167 <p>Assuming you have already installed a native copy of GCC and configured 138 168 your cross compiler, issue the command <code>make</code>, which performs the 139 169 following steps: 140 170 141 <ul>171 <ul> 142 172 <li>Build host tools necessary to build the compiler such as texinfo, bison, 143 173 gperf. 144 174 145 <li>Build target tools for use by the compiler such as binutils (bfd,175 <li>Build target tools for use by the compiler such as binutils (bfd, 146 176 binutils, gas, gprof, ld, and opcodes) 147 177 if they have been individually linked or moved into the top level GCC source 148 178 tree before configuring. 149 179 150 <li>Build the compiler (single stage only).151 152 <li>Build runtime libraries using the compiler from the previous step.180 <li>Build the compiler (single stage only). 181 182 <li>Build runtime libraries using the compiler from the previous step. 153 183 </ul> 154 184 155 <p>Note that if an error occurs in any step the make process will exit. 156 157 <h2><a name="TOC2">Building in parallel</h2> 158 159 <p>If you have a multiprocessor system you can use <code>make bootstrap 160 MAKE="make -j 2" -j 2</code> or just <code>make -j 2 bootstrap</code> 161 for GNU Make 3.79 and above instead of just <code>make bootstrap</code> 162 when building GCC. You can use a bigger number instead of two if 163 you like. In most cases, it won't help to use a number bigger than 164 the number of processors in your machine. 165 166 <h2><a name="TOC3">Building the Ada compiler</h2> 185 <p>Note that if an error occurs in any step the make process will exit. 186 187 <h3 class="section"><a name="TOC2"></a>Building in parallel</h3> 188 189 <p>You can use <code>make bootstrap MAKE="make -j 2" -j 2</code>, or just 190 <code>make -j 2 bootstrap</code> for GNU Make 3.79 and above, instead of 191 <code>make bootstrap</code> to build GCC in parallel. 192 You can also specify a bigger number, and in most cases using a value 193 greater than the number of processors in your machine will result in 194 fewer and shorter I/O latency hits, thus improving overall throughput; 195 this is especially true for slow drives and network filesystems. 196 197 <h3 class="section"><a name="TOC3"></a>Building the Ada compiler</h3> 167 198 168 199 <p>In order to build GNAT, the Ada compiler, you need a working GNAT … … 171 202 GNAT-specific extensions), and GNU make. 172 203 173 <p>However, you do not need a full installation of GNAT, just the GNAT204 <p>However, you do not need a full installation of GNAT, just the GNAT 174 205 binary <code>gnat1</code>, a copy of <code>gnatbind</code>, and a compiler driver 175 206 which can deal with Ada input (by invoking the <code>gnat1</code> binary). … … 184 215 used to disable building the Ada front end. 185 216 186 <p>Additional build tools (such as <code>gnatmake</code>) or a working GNAT217 <p>Additional build tools (such as <code>gnatmake</code>) or a working GNAT 187 218 run-time library installation are usually <em>not</em> required. However, 188 219 if you want to bootstrap the compiler using a minimal version of GNAT, … … 191 222 source distribution): 192 223 193 <pre >cd <var>srcdir</var>/gcc/ada194 touch treeprs.ads [es]info.h nmake.ad[bs]195 </pre>196 197 <p>At the moment, the GNAT library and several tools for GNAT are not built224 <pre class="example"> cd <var>srcdir</var>/gcc/ada 225 touch treeprs.ads [es]info.h nmake.ad[bs] 226 </pre> 227 228 <p>At the moment, the GNAT library and several tools for GNAT are not built 198 229 by <code>make bootstrap</code>. You have to invoke 199 <code>make gnatlib_and_tools</code> in the <code>< var>objdir</var>/gcc</code>230 <code>make gnatlib_and_tools</code> in the <code></code><var>objdir</var><code>/gcc</code> 200 231 subdirectory before proceeding with the next steps. 201 232 202 <p>For example, you can build a native Ada compiler by issuing the233 <p>For example, you can build a native Ada compiler by issuing the 203 234 following commands (assuming <code>make</code> is GNU make): 204 235 205 <pre >cd <var>objdir</var>206 <var>srcdir</var>/configure --enable-languages=c,ada207 cd <var>srcdir</var>/gcc/ada208 touch treeprs.ads [es]info.h nmake.ad[bs]209 cd <var>objdir</var>210 make bootstrap211 cd gcc212 make gnatlib_and_tools213 cd ..214 </pre>215 216 <p>Currently, when compiling the Ada front end, you cannot use the parallel236 <pre class="example"> cd <var>objdir</var> 237 <var>srcdir</var>/configure --enable-languages=c,ada 238 cd <var>srcdir</var>/gcc/ada 239 touch treeprs.ads [es]info.h nmake.ad[bs] 240 cd <var>objdir</var> 241 make bootstrap 242 cd gcc 243 make gnatlib_and_tools 244 cd .. 245 </pre> 246 247 <p>Currently, when compiling the Ada front end, you cannot use the parallel 217 248 build feature described in the previous section. 218 249 219 <hr />250 <hr /> 220 251 <p> 221 252 <a href="./index.html">Return to the GCC Installation page</a> 222 253 223 </body></html>224 254 </body></html> 255 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
