Fuad Tabba | c588ecf | 2021-02-04 13:59:53 +0000 | [diff] [blame^] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 | <html> |
| 3 | <!-- Copyright (C) 1988-2015 Free Software Foundation, Inc. |
| 4 | |
| 5 | Permission is granted to copy, distribute and/or modify this document |
| 6 | under the terms of the GNU Free Documentation License, Version 1.3 or |
| 7 | any later version published by the Free Software Foundation; with no |
| 8 | Invariant Sections, the Front-Cover texts being (a) (see below), and |
| 9 | with the Back-Cover Texts being (b) (see below). A copy of the |
| 10 | license is included in the section entitled "GNU |
| 11 | Free Documentation License". |
| 12 | |
| 13 | (a) The FSF's Front-Cover Text is: |
| 14 | |
| 15 | A GNU Manual |
| 16 | |
| 17 | (b) The FSF's Back-Cover Text is: |
| 18 | |
| 19 | You have freedom to copy and modify this GNU Manual, like GNU |
| 20 | software. Copies published by the Free Software Foundation raise |
| 21 | funds for GNU development. --> |
| 22 | <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ --> |
| 23 | <head> |
| 24 | <title>Installing GCC</title> |
| 25 | |
| 26 | <meta name="description" content="Installing GCC"> |
| 27 | <meta name="keywords" content="Installing GCC"> |
| 28 | <meta name="resource-type" content="document"> |
| 29 | <meta name="distribution" content="global"> |
| 30 | <meta name="Generator" content="makeinfo"> |
| 31 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 32 | <style type="text/css"> |
| 33 | <!-- |
| 34 | a.summary-letter {text-decoration: none} |
| 35 | blockquote.smallquotation {font-size: smaller} |
| 36 | div.display {margin-left: 3.2em} |
| 37 | div.example {margin-left: 3.2em} |
| 38 | div.indentedblock {margin-left: 3.2em} |
| 39 | div.lisp {margin-left: 3.2em} |
| 40 | div.smalldisplay {margin-left: 3.2em} |
| 41 | div.smallexample {margin-left: 3.2em} |
| 42 | div.smallindentedblock {margin-left: 3.2em; font-size: smaller} |
| 43 | div.smalllisp {margin-left: 3.2em} |
| 44 | kbd {font-style:oblique} |
| 45 | pre.display {font-family: inherit} |
| 46 | pre.format {font-family: inherit} |
| 47 | pre.menu-comment {font-family: serif} |
| 48 | pre.menu-preformatted {font-family: serif} |
| 49 | pre.smalldisplay {font-family: inherit; font-size: smaller} |
| 50 | pre.smallexample {font-size: smaller} |
| 51 | pre.smallformat {font-family: inherit; font-size: smaller} |
| 52 | pre.smalllisp {font-size: smaller} |
| 53 | span.nocodebreak {white-space:nowrap} |
| 54 | span.nolinebreak {white-space:nowrap} |
| 55 | span.roman {font-family:serif; font-weight:normal} |
| 56 | span.sansserif {font-family:sans-serif; font-weight:normal} |
| 57 | ul.no-bullet {list-style: none} |
| 58 | --> |
| 59 | </style> |
| 60 | |
| 61 | |
| 62 | </head> |
| 63 | |
| 64 | <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> |
| 65 | <h1 class="settitle" align="center">Installing GCC</h1> |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | <a name="index-Installing-GCC_003a-Building"></a> |
| 87 | |
| 88 | <p>Now that GCC is configured, you are ready to build the compiler and |
| 89 | runtime libraries. |
| 90 | </p> |
| 91 | <p>Some commands executed when making the compiler may fail (return a |
| 92 | nonzero status) and be ignored by <code>make</code>. These failures, which |
| 93 | are often due to files that were not found, are expected, and can safely |
| 94 | be ignored. |
| 95 | </p> |
| 96 | <p>It is normal to have compiler warnings when compiling certain files. |
| 97 | Unless you are a GCC developer, you can generally ignore these warnings |
| 98 | unless they cause compilation to fail. Developers should attempt to fix |
| 99 | any warnings encountered, however they can temporarily continue past |
| 100 | warnings-as-errors by specifying the configure flag |
| 101 | <samp>--disable-werror</samp>. |
| 102 | </p> |
| 103 | <p>On certain old systems, defining certain environment variables such as |
| 104 | <code>CC</code> can interfere with the functioning of <code>make</code>. |
| 105 | </p> |
| 106 | <p>If you encounter seemingly strange errors when trying to build the |
| 107 | compiler in a directory other than the source directory, it could be |
| 108 | because you have previously configured the compiler in the source |
| 109 | directory. Make sure you have done all the necessary preparations. |
| 110 | </p> |
| 111 | <p>If you build GCC on a BSD system using a directory stored in an old System |
| 112 | V file system, problems may occur in running <code>fixincludes</code> if the |
| 113 | System V file system doesn’t support symbolic links. These problems |
| 114 | result in a failure to fix the declaration of <code>size_t</code> in |
| 115 | <samp>sys/types.h</samp>. If you find that <code>size_t</code> is a signed type and |
| 116 | that type mismatches occur, this could be the cause. |
| 117 | </p> |
| 118 | <p>The solution is not to use such a directory for building GCC. |
| 119 | </p> |
| 120 | <p>Similarly, when building from SVN or snapshots, or if you modify |
| 121 | <samp>*.l</samp> files, you need the Flex lexical analyzer generator |
| 122 | installed. If you do not modify <samp>*.l</samp> files, releases contain |
| 123 | the Flex-generated files and you do not need Flex installed to build |
| 124 | them. There is still one Flex-based lexical analyzer (part of the |
| 125 | build machinery, not of GCC itself) that is used even if you only |
| 126 | build the C front end. |
| 127 | </p> |
| 128 | <p>When building from SVN or snapshots, or if you modify Texinfo |
| 129 | documentation, you need version 4.7 or later of Texinfo installed if you |
| 130 | want Info documentation to be regenerated. Releases contain Info |
| 131 | documentation pre-built for the unmodified documentation in the release. |
| 132 | </p> |
| 133 | <a name="Building-a-native-compiler"></a> |
| 134 | <h3 class="section">Building a native compiler</h3> |
| 135 | |
| 136 | <p>For a native build, the default configuration is to perform |
| 137 | a 3-stage bootstrap of the compiler when ‘<samp>make</samp>’ is invoked. |
| 138 | This will build the entire GCC system and ensure that it compiles |
| 139 | itself correctly. It can be disabled with the <samp>--disable-bootstrap</samp> |
| 140 | parameter to ‘<samp>configure</samp>’, but bootstrapping is suggested because |
| 141 | the compiler will be tested more completely and could also have |
| 142 | better performance. |
| 143 | </p> |
| 144 | <p>The bootstrapping process will complete the following steps: |
| 145 | </p> |
| 146 | <ul> |
| 147 | <li> Build tools necessary to build the compiler. |
| 148 | |
| 149 | </li><li> Perform a 3-stage bootstrap of the compiler. This includes building |
| 150 | three times the target tools for use by the compiler such as binutils |
| 151 | (bfd, binutils, gas, gprof, ld, and opcodes) if they have been |
| 152 | individually linked or moved into the top level GCC source tree before |
| 153 | configuring. |
| 154 | |
| 155 | </li><li> Perform a comparison test of the stage2 and stage3 compilers. |
| 156 | |
| 157 | </li><li> Build runtime libraries using the stage3 compiler from the previous step. |
| 158 | |
| 159 | </li></ul> |
| 160 | |
| 161 | <p>If you are short on disk space you might consider ‘<samp>make |
| 162 | bootstrap-lean</samp>’ instead. The sequence of compilation is the |
| 163 | same described above, but object files from the stage1 and |
| 164 | stage2 of the 3-stage bootstrap of the compiler are deleted as |
| 165 | soon as they are no longer needed. |
| 166 | </p> |
| 167 | <p>If you wish to use non-default GCC flags when compiling the stage2 |
| 168 | and stage3 compilers, set <code>BOOT_CFLAGS</code> on the command line when |
| 169 | doing ‘<samp>make</samp>’. For example, if you want to save additional space |
| 170 | during the bootstrap and in the final installation as well, you can |
| 171 | build the compiler binaries without debugging information as in the |
| 172 | following example. This will save roughly 40% of disk space both for |
| 173 | the bootstrap and the final installation. (Libraries will still contain |
| 174 | debugging information.) |
| 175 | </p> |
| 176 | <div class="smallexample"> |
| 177 | <pre class="smallexample">make BOOT_CFLAGS='-O' bootstrap |
| 178 | </pre></div> |
| 179 | |
| 180 | <p>You can place non-default optimization flags into <code>BOOT_CFLAGS</code>; they |
| 181 | are less well tested here than the default of ‘<samp>-g -O2</samp>’, but should |
| 182 | still work. In a few cases, you may find that you need to specify special |
| 183 | flags such as <samp>-msoft-float</samp> here to complete the bootstrap; or, |
| 184 | if the native compiler miscompiles the stage1 compiler, you may need |
| 185 | to work around this, by choosing <code>BOOT_CFLAGS</code> to avoid the parts |
| 186 | of the stage1 compiler that were miscompiled, or by using ‘<samp>make |
| 187 | bootstrap4</samp>’ to increase the number of stages of bootstrap. |
| 188 | </p> |
| 189 | <p><code>BOOT_CFLAGS</code> does not apply to bootstrapped target libraries. |
| 190 | Since these are always compiled with the compiler currently being |
| 191 | bootstrapped, you can use <code>CFLAGS_FOR_TARGET</code> to modify their |
| 192 | compilation flags, as for non-bootstrapped target libraries. |
| 193 | Again, if the native compiler miscompiles the stage1 compiler, you may |
| 194 | need to work around this by avoiding non-working parts of the stage1 |
| 195 | compiler. Use <code>STAGE1_TFLAGS</code> to this end. |
| 196 | </p> |
| 197 | <p>If you used the flag <samp>--enable-languages=…</samp> to restrict |
| 198 | the compilers to be built, only those you’ve actually enabled will be |
| 199 | built. This will of course only build those runtime libraries, for |
| 200 | which the particular compiler has been built. Please note, |
| 201 | that re-defining <code>LANGUAGES</code> when calling ‘<samp>make</samp>’ |
| 202 | <strong>does not</strong> work anymore! |
| 203 | </p> |
| 204 | <p>If the comparison of stage2 and stage3 fails, this normally indicates |
| 205 | that the stage2 compiler has compiled GCC incorrectly, and is therefore |
| 206 | a potentially serious bug which you should investigate and report. (On |
| 207 | a few systems, meaningful comparison of object files is impossible; they |
| 208 | always appear “different”. If you encounter this problem, you will |
| 209 | need to disable comparison in the <samp>Makefile</samp>.) |
| 210 | </p> |
| 211 | <p>If you do not want to bootstrap your compiler, you can configure with |
| 212 | <samp>--disable-bootstrap</samp>. In particular cases, you may want to |
| 213 | bootstrap your compiler even if the target system is not the same as |
| 214 | the one you are building on: for example, you could build a |
| 215 | <code>powerpc-unknown-linux-gnu</code> toolchain on a |
| 216 | <code>powerpc64-unknown-linux-gnu</code> host. In this case, pass |
| 217 | <samp>--enable-bootstrap</samp> to the configure script. |
| 218 | </p> |
| 219 | <p><code>BUILD_CONFIG</code> can be used to bring in additional customization |
| 220 | to the build. It can be set to a whitespace-separated list of names. |
| 221 | For each such <code>NAME</code>, top-level <samp>config/<code>NAME</code>.mk</samp> will |
| 222 | be included by the top-level <samp>Makefile</samp>, bringing in any settings |
| 223 | it contains. The default <code>BUILD_CONFIG</code> can be set using the |
| 224 | configure option <samp>--with-build-config=<code>NAME</code>...</samp>. Some |
| 225 | examples of supported build configurations are: |
| 226 | </p> |
| 227 | <dl compact="compact"> |
| 228 | <dt>‘<samp>bootstrap-O1</samp>’</dt> |
| 229 | <dd><p>Removes any <samp>-O</samp>-started option from <code>BOOT_CFLAGS</code>, and adds |
| 230 | <samp>-O1</samp> to it. ‘<samp>BUILD_CONFIG=bootstrap-O1</samp>’ is equivalent to |
| 231 | ‘<samp>BOOT_CFLAGS='-g -O1'</samp>’. |
| 232 | </p> |
| 233 | </dd> |
| 234 | <dt>‘<samp>bootstrap-O3</samp>’</dt> |
| 235 | <dd><p>Analogous to <code>bootstrap-O1</code>. |
| 236 | </p> |
| 237 | </dd> |
| 238 | <dt>‘<samp>bootstrap-lto</samp>’</dt> |
| 239 | <dd><p>Enables Link-Time Optimization for host tools during bootstrapping. |
| 240 | ‘<samp>BUILD_CONFIG=bootstrap-lto</samp>’ is equivalent to adding |
| 241 | <samp>-flto</samp> to ‘<samp>BOOT_CFLAGS</samp>’. This option assumes that the host |
| 242 | supports the linker plugin (e.g. GNU ld version 2.21 or later or GNU gold |
| 243 | version 2.21 or later). |
| 244 | </p> |
| 245 | </dd> |
| 246 | <dt>‘<samp>bootstrap-lto-noplugin</samp>’</dt> |
| 247 | <dd><p>This option is similar to <code>bootstrap-lto</code>, but is intended for |
| 248 | hosts that do not support the linker plugin. Without the linker plugin |
| 249 | static libraries are not compiled with link-time optimizations. Since |
| 250 | the GCC middle end and back end are in <samp>libbackend.a</samp> this means |
| 251 | that only the front end is actually LTO optimized. |
| 252 | </p> |
| 253 | </dd> |
| 254 | <dt>‘<samp>bootstrap-debug</samp>’</dt> |
| 255 | <dd><p>Verifies that the compiler generates the same executable code, whether |
| 256 | or not it is asked to emit debug information. To this end, this |
| 257 | option builds stage2 host programs without debug information, and uses |
| 258 | <samp>contrib/compare-debug</samp> to compare them with the stripped stage3 |
| 259 | object files. If <code>BOOT_CFLAGS</code> is overridden so as to not enable |
| 260 | debug information, stage2 will have it, and stage3 won’t. This option |
| 261 | is enabled by default when GCC bootstrapping is enabled, if |
| 262 | <code>strip</code> can turn object files compiled with and without debug |
| 263 | info into identical object files. In addition to better test |
| 264 | coverage, this option makes default bootstraps faster and leaner. |
| 265 | </p> |
| 266 | </dd> |
| 267 | <dt>‘<samp>bootstrap-debug-big</samp>’</dt> |
| 268 | <dd><p>Rather than comparing stripped object files, as in |
| 269 | <code>bootstrap-debug</code>, this option saves internal compiler dumps |
| 270 | during stage2 and stage3 and compares them as well, which helps catch |
| 271 | additional potential problems, but at a great cost in terms of disk |
| 272 | space. It can be specified in addition to ‘<samp>bootstrap-debug</samp>’. |
| 273 | </p> |
| 274 | </dd> |
| 275 | <dt>‘<samp>bootstrap-debug-lean</samp>’</dt> |
| 276 | <dd><p>This option saves disk space compared with <code>bootstrap-debug-big</code>, |
| 277 | but at the expense of some recompilation. Instead of saving the dumps |
| 278 | of stage2 and stage3 until the final compare, it uses |
| 279 | <samp>-fcompare-debug</samp> to generate, compare and remove the dumps |
| 280 | during stage3, repeating the compilation that already took place in |
| 281 | stage2, whose dumps were not saved. |
| 282 | </p> |
| 283 | </dd> |
| 284 | <dt>‘<samp>bootstrap-debug-lib</samp>’</dt> |
| 285 | <dd><p>This option tests executable code invariance over debug information |
| 286 | generation on target libraries, just like <code>bootstrap-debug-lean</code> |
| 287 | tests it on host programs. It builds stage3 libraries with |
| 288 | <samp>-fcompare-debug</samp>, and it can be used along with any of the |
| 289 | <code>bootstrap-debug</code> options above. |
| 290 | </p> |
| 291 | <p>There aren’t <code>-lean</code> or <code>-big</code> counterparts to this option |
| 292 | because most libraries are only build in stage3, so bootstrap compares |
| 293 | would not get significant coverage. Moreover, the few libraries built |
| 294 | in stage2 are used in stage3 host programs, so we wouldn’t want to |
| 295 | compile stage2 libraries with different options for comparison purposes. |
| 296 | </p> |
| 297 | </dd> |
| 298 | <dt>‘<samp>bootstrap-debug-ckovw</samp>’</dt> |
| 299 | <dd><p>Arranges for error messages to be issued if the compiler built on any |
| 300 | stage is run without the option <samp>-fcompare-debug</samp>. This is |
| 301 | useful to verify the full <samp>-fcompare-debug</samp> testing coverage. It |
| 302 | must be used along with <code>bootstrap-debug-lean</code> and |
| 303 | <code>bootstrap-debug-lib</code>. |
| 304 | </p> |
| 305 | </dd> |
| 306 | <dt>‘<samp>bootstrap-time</samp>’</dt> |
| 307 | <dd><p>Arranges for the run time of each program started by the GCC driver, |
| 308 | built in any stage, to be logged to <samp>time.log</samp>, in the top level of |
| 309 | the build tree. |
| 310 | </p> |
| 311 | </dd> |
| 312 | </dl> |
| 313 | |
| 314 | <a name="Building-a-cross-compiler"></a> |
| 315 | <h3 class="section">Building a cross compiler</h3> |
| 316 | |
| 317 | <p>When building a cross compiler, it is not generally possible to do a |
| 318 | 3-stage bootstrap of the compiler. This makes for an interesting problem |
| 319 | as parts of GCC can only be built with GCC. |
| 320 | </p> |
| 321 | <p>To build a cross compiler, we recommend first building and installing a |
| 322 | native compiler. You can then use the native GCC compiler to build the |
| 323 | cross compiler. The installed native compiler needs to be GCC version |
| 324 | 2.95 or later. |
| 325 | </p> |
| 326 | <p>If the cross compiler is to be built with support for the Java |
| 327 | programming language and the ability to compile .java source files is |
| 328 | desired, the installed native compiler used to build the cross |
| 329 | compiler needs to be the same GCC version as the cross compiler. In |
| 330 | addition the cross compiler needs to be configured with |
| 331 | <samp>--with-ecj-jar=…</samp>. |
| 332 | </p> |
| 333 | <p>Assuming you have already installed a native copy of GCC and configured |
| 334 | your cross compiler, issue the command <code>make</code>, which performs the |
| 335 | following steps: |
| 336 | </p> |
| 337 | <ul> |
| 338 | <li> Build host tools necessary to build the compiler. |
| 339 | |
| 340 | </li><li> Build target tools for use by the compiler such as binutils (bfd, |
| 341 | binutils, gas, gprof, ld, and opcodes) |
| 342 | if they have been individually linked or moved into the top level GCC source |
| 343 | tree before configuring. |
| 344 | |
| 345 | </li><li> Build the compiler (single stage only). |
| 346 | |
| 347 | </li><li> Build runtime libraries using the compiler from the previous step. |
| 348 | </li></ul> |
| 349 | |
| 350 | <p>Note that if an error occurs in any step the make process will exit. |
| 351 | </p> |
| 352 | <p>If you are not building GNU binutils in the same source tree as GCC, |
| 353 | you will need a cross-assembler and cross-linker installed before |
| 354 | configuring GCC. Put them in the directory |
| 355 | <samp><var>prefix</var>/<var>target</var>/bin</samp>. Here is a table of the tools |
| 356 | you should put in this directory: |
| 357 | </p> |
| 358 | <dl compact="compact"> |
| 359 | <dt><samp>as</samp></dt> |
| 360 | <dd><p>This should be the cross-assembler. |
| 361 | </p> |
| 362 | </dd> |
| 363 | <dt><samp>ld</samp></dt> |
| 364 | <dd><p>This should be the cross-linker. |
| 365 | </p> |
| 366 | </dd> |
| 367 | <dt><samp>ar</samp></dt> |
| 368 | <dd><p>This should be the cross-archiver: a program which can manipulate |
| 369 | archive files (linker libraries) in the target machine’s format. |
| 370 | </p> |
| 371 | </dd> |
| 372 | <dt><samp>ranlib</samp></dt> |
| 373 | <dd><p>This should be a program to construct a symbol table in an archive file. |
| 374 | </p></dd> |
| 375 | </dl> |
| 376 | |
| 377 | <p>The installation of GCC will find these programs in that directory, |
| 378 | and copy or link them to the proper place to for the cross-compiler to |
| 379 | find them when run later. |
| 380 | </p> |
| 381 | <p>The easiest way to provide these files is to build the Binutils package. |
| 382 | Configure it with the same <samp>--host</samp> and <samp>--target</samp> |
| 383 | options that you use for configuring GCC, then build and install |
| 384 | them. They install their executables automatically into the proper |
| 385 | directory. Alas, they do not support all the targets that GCC |
| 386 | supports. |
| 387 | </p> |
| 388 | <p>If you are not building a C library in the same source tree as GCC, |
| 389 | you should also provide the target libraries and headers before |
| 390 | configuring GCC, specifying the directories with |
| 391 | <samp>--with-sysroot</samp> or <samp>--with-headers</samp> and |
| 392 | <samp>--with-libs</samp>. Many targets also require “start files” such |
| 393 | as <samp>crt0.o</samp> and |
| 394 | <samp>crtn.o</samp> which are linked into each executable. There may be several |
| 395 | alternatives for <samp>crt0.o</samp>, for use with profiling or other |
| 396 | compilation options. Check your target’s definition of |
| 397 | <code>STARTFILE_SPEC</code> to find out what start files it uses. |
| 398 | </p> |
| 399 | <a name="Building-in-parallel"></a> |
| 400 | <h3 class="section">Building in parallel</h3> |
| 401 | |
| 402 | <p>GNU Make 3.80 and above, which is necessary to build GCC, support |
| 403 | building in parallel. To activate this, you can use ‘<samp>make -j 2</samp>’ |
| 404 | instead of ‘<samp>make</samp>’. You can also specify a bigger number, and |
| 405 | in most cases using a value greater than the number of processors in |
| 406 | your machine will result in fewer and shorter I/O latency hits, thus |
| 407 | improving overall throughput; this is especially true for slow drives |
| 408 | and network filesystems. |
| 409 | </p> |
| 410 | <a name="Building-the-Ada-compiler"></a> |
| 411 | <h3 class="section">Building the Ada compiler</h3> |
| 412 | |
| 413 | <p>In order to build GNAT, the Ada compiler, you need a working GNAT |
| 414 | compiler (GCC version 4.0 or later). |
| 415 | This includes GNAT tools such as <code>gnatmake</code> and |
| 416 | <code>gnatlink</code>, since the Ada front end is written in Ada and |
| 417 | uses some GNAT-specific extensions. |
| 418 | </p> |
| 419 | <p>In order to build a cross compiler, it is suggested to install |
| 420 | the new compiler as native first, and then use it to build the cross |
| 421 | compiler. |
| 422 | </p> |
| 423 | <p><code>configure</code> does not test whether the GNAT installation works |
| 424 | and has a sufficiently recent version; if too old a GNAT version is |
| 425 | installed, the build will fail unless <samp>--enable-languages</samp> is |
| 426 | used to disable building the Ada front end. |
| 427 | </p> |
| 428 | <p><code>ADA_INCLUDE_PATH</code> and <code>ADA_OBJECT_PATH</code> environment variables |
| 429 | must not be set when building the Ada compiler, the Ada tools, or the |
| 430 | Ada runtime libraries. You can check that your build environment is clean |
| 431 | by verifying that ‘<samp>gnatls -v</samp>’ lists only one explicit path in each |
| 432 | section. |
| 433 | </p> |
| 434 | <a name="Building-with-profile-feedback"></a> |
| 435 | <h3 class="section">Building with profile feedback</h3> |
| 436 | |
| 437 | <p>It is possible to use profile feedback to optimize the compiler itself. This |
| 438 | should result in a faster compiler binary. Experiments done on x86 using gcc |
| 439 | 3.3 showed approximately 7 percent speedup on compiling C programs. To |
| 440 | bootstrap the compiler with profile feedback, use <code>make profiledbootstrap</code>. |
| 441 | </p> |
| 442 | <p>When ‘<samp>make profiledbootstrap</samp>’ is run, it will first build a <code>stage1</code> |
| 443 | compiler. This compiler is used to build a <code>stageprofile</code> compiler |
| 444 | instrumented to collect execution counts of instruction and branch |
| 445 | probabilities. Then runtime libraries are compiled with profile collected. |
| 446 | Finally a <code>stagefeedback</code> compiler is built using the information collected. |
| 447 | </p> |
| 448 | <p>Unlike standard bootstrap, several additional restrictions apply. The |
| 449 | compiler used to build <code>stage1</code> needs to support a 64-bit integral type. |
| 450 | It is recommended to only use GCC for this. |
| 451 | </p> |
| 452 | <hr /> |
| 453 | <p><p><a href="./index.html">Return to the GCC Installation page</a> |
| 454 | </p> |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | <hr> |
| 463 | |
| 464 | |
| 465 | |
| 466 | </body> |
| 467 | </html> |