configure.html revision 1.13
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-2020 Free Software Foundation, Inc.
4
5Permission is granted to copy, distribute and/or modify this document
6under the terms of the GNU Free Documentation License, Version 1.3 or
7any later version published by the Free Software Foundation; with no
8Invariant Sections, the Front-Cover texts being (a) (see below), and
9with the Back-Cover Texts being (b) (see below).  A copy of the
10license is included in the section entitled "GNU
11Free Documentation License".
12
13(a) The FSF's Front-Cover Text is:
14
15A GNU Manual
16
17(b) The FSF's Back-Cover Text is:
18
19You 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 6.5, http://www.gnu.org/software/texinfo/ -->
23<head>
24<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25<title>Installing GCC: Configuration</title>
26
27<meta name="description" content="Installing GCC: Configuration">
28<meta name="keywords" content="Installing GCC: Configuration">
29<meta name="resource-type" content="document">
30<meta name="distribution" content="global">
31<meta name="Generator" content="makeinfo">
32<style type="text/css">
33<!--
34a.summary-letter {text-decoration: none}
35blockquote.indentedblock {margin-right: 0em}
36blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
37blockquote.smallquotation {font-size: smaller}
38div.display {margin-left: 3.2em}
39div.example {margin-left: 3.2em}
40div.lisp {margin-left: 3.2em}
41div.smalldisplay {margin-left: 3.2em}
42div.smallexample {margin-left: 3.2em}
43div.smalllisp {margin-left: 3.2em}
44kbd {font-style: oblique}
45pre.display {font-family: inherit}
46pre.format {font-family: inherit}
47pre.menu-comment {font-family: serif}
48pre.menu-preformatted {font-family: serif}
49pre.smalldisplay {font-family: inherit; font-size: smaller}
50pre.smallexample {font-size: smaller}
51pre.smallformat {font-family: inherit; font-size: smaller}
52pre.smalllisp {font-size: smaller}
53span.nolinebreak {white-space: nowrap}
54span.roman {font-family: initial; font-weight: normal}
55span.sansserif {font-family: sans-serif; font-weight: normal}
56ul.no-bullet {list-style: none}
57-->
58</style>
59
60
61</head>
62
63<body lang="en">
64<h1 class="settitle" align="center">Installing GCC: Configuration</h1>
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84<a name="index-Configuration"></a>
85<a name="index-Installing-GCC_003a-Configuration"></a>
86
87<p>Like most GNU software, GCC must be configured before it can be built.
88This document describes the recommended configuration procedure
89for both native and cross targets.
90</p>
91<p>We use <var>srcdir</var> to refer to the toplevel source directory for
92GCC; we use <var>objdir</var> to refer to the toplevel build/object directory.
93</p>
94<p>If you obtained the sources by cloning the repository, <var>srcdir</var>
95must refer to the top <samp>gcc</samp> directory, the one where the
96<samp>MAINTAINERS</samp> file can be found, and not its <samp>gcc</samp>
97subdirectory, otherwise the build will fail.
98</p>
99<p>If either <var>srcdir</var> or <var>objdir</var> is located on an automounted NFS
100file system, the shell&rsquo;s built-in <code>pwd</code> command will return
101temporary pathnames.  Using these can lead to various sorts of build
102problems.  To avoid this issue, set the <code>PWDCMD</code> environment
103variable to an automounter-aware <code>pwd</code> command, e.g.,
104<code>pawd</code> or &lsquo;<samp>amq -w</samp>&rsquo;, during the configuration and build
105phases.
106</p>
107<p>First, we <strong>highly</strong> recommend that GCC be built into a
108separate directory from the sources which does <strong>not</strong> reside
109within the source tree.  This is how we generally build GCC; building
110where <var>srcdir</var> == <var>objdir</var> should still work, but doesn&rsquo;t
111get extensive testing; building where <var>objdir</var> is a subdirectory
112of <var>srcdir</var> is unsupported.
113</p>
114<p>If you have previously built GCC in the same directory for a
115different target machine, do &lsquo;<samp>make distclean</samp>&rsquo; to delete all files
116that might be invalid.  One of the files this deletes is <samp>Makefile</samp>;
117if &lsquo;<samp>make distclean</samp>&rsquo; complains that <samp>Makefile</samp> does not exist
118or issues a message like &ldquo;don&rsquo;t know how to make distclean&rdquo; it probably
119means that the directory is already suitably clean.  However, with the
120recommended method of building in a separate <var>objdir</var>, you should
121simply use a different <var>objdir</var> for each target.
122</p>
123<p>Second, when configuring a native system, either <code>cc</code> or
124<code>gcc</code> must be in your path or you must set <code>CC</code> in
125your environment before running configure.  Otherwise the configuration
126scripts may fail.
127</p>
128
129<p>To configure GCC:
130</p>
131<div class="smallexample">
132<pre class="smallexample">% mkdir <var>objdir</var>
133% cd <var>objdir</var>
134% <var>srcdir</var>/configure [<var>options</var>] [<var>target</var>]
135</pre></div>
136
137<a name="Distributor-options"></a>
138<h3 class="heading">Distributor options</h3>
139
140<p>If you will be distributing binary versions of GCC, with modifications
141to the source code, you should use the options described in this
142section to make clear that your version contains modifications.
143</p>
144<dl compact="compact">
145<dt><code>--with-pkgversion=<var>version</var></code></dt>
146<dd><p>Specify a string that identifies your package.  You may wish
147to include a build number or build date.  This version string will be
148included in the output of <code>gcc --version</code>.  This suffix does
149not replace the default version string, only the &lsquo;<samp>GCC</samp>&rsquo; part.
150</p>
151<p>The default value is &lsquo;<samp>GCC</samp>&rsquo;.
152</p>
153</dd>
154<dt><code>--with-bugurl=<var>url</var></code></dt>
155<dd><p>Specify the URL that users should visit if they wish to report a bug.
156You are of course welcome to forward bugs reported to you to the FSF,
157if you determine that they are not bugs in your modifications.
158</p>
159<p>The default value refers to the FSF&rsquo;s GCC bug tracker.
160</p>
161</dd>
162<dt><code>--with-documentation-root-url=<var>url</var></code></dt>
163<dd><p>Specify the URL root that contains GCC option documentation.  The <var>url</var>
164should end with a <code>/</code> character.
165</p>
166<p>The default value is <a href="https://gcc.gnu.org/onlinedocs/">https://gcc.gnu.org/onlinedocs/</a>.
167</p>
168</dd>
169<dt><code>--with-changes-root-url=<var>url</var></code></dt>
170<dd><p>Specify the URL root that contains information about changes in GCC
171releases like <code>gcc-<var>version</var>/changes.html</code>.
172The <var>url</var> should end with a <code>/</code> character.
173</p>
174<p>The default value is <a href="https://gcc.gnu.org/">https://gcc.gnu.org/</a>.
175</p>
176</dd>
177</dl>
178
179<a name="Target-specification"></a>
180<h3 class="heading">Target specification</h3>
181<ul>
182<li> GCC has code to correctly determine the correct value for <var>target</var>
183for nearly all native systems.  Therefore, we highly recommend you do
184not provide a configure target when configuring a native compiler.
185
186</li><li> <var>target</var> must be specified as <samp>--target=<var>target</var></samp>
187when configuring a cross compiler; examples of valid targets would be
188m68k-elf, sh-elf, etc.
189
190</li><li> Specifying just <var>target</var> instead of <samp>--target=<var>target</var></samp>
191implies that the host defaults to <var>target</var>.
192</li></ul>
193
194
195<a name="Options-specification"></a>
196<h3 class="heading">Options specification</h3>
197
198<p>Use <var>options</var> to override several configure time options for
199GCC.  A list of supported <var>options</var> follows; &lsquo;<samp>configure
200--help</samp>&rsquo; may list other options, but those not listed below may not
201work and should not normally be used.
202</p>
203<p>Note that each <samp>--enable</samp> option has a corresponding
204<samp>--disable</samp> option and that each <samp>--with</samp> option has a
205corresponding <samp>--without</samp> option.
206</p>
207<dl compact="compact">
208<dt><code>--prefix=<var>dirname</var></code></dt>
209<dd><p>Specify the toplevel installation
210directory.  This is the recommended way to install the tools into a directory
211other than the default.  The toplevel installation directory defaults to
212<samp>/usr/local</samp>.
213</p>
214<p>We <strong>highly</strong> recommend against <var>dirname</var> being the same or a
215subdirectory of <var>objdir</var> or vice versa.  If specifying a directory
216beneath a user&rsquo;s home directory tree, some shells will not expand
217<var>dirname</var> correctly if it contains the &lsquo;<samp>~</samp>&rsquo; metacharacter; use
218<code>$HOME</code> instead.
219</p>
220<p>The following standard <code>autoconf</code> options are supported.  Normally you
221should not need to use these options.
222</p><dl compact="compact">
223<dt><code>--exec-prefix=<var>dirname</var></code></dt>
224<dd><p>Specify the toplevel installation directory for architecture-dependent
225files.  The default is <samp><var>prefix</var></samp>.
226</p>
227</dd>
228<dt><code>--bindir=<var>dirname</var></code></dt>
229<dd><p>Specify the installation directory for the executables called by users
230(such as <code>gcc</code> and <code>g++</code>).  The default is
231<samp><var>exec-prefix</var>/bin</samp>.
232</p>
233</dd>
234<dt><code>--libdir=<var>dirname</var></code></dt>
235<dd><p>Specify the installation directory for object code libraries and
236internal data files of GCC.  The default is <samp><var>exec-prefix</var>/lib</samp>.
237</p>
238</dd>
239<dt><code>--libexecdir=<var>dirname</var></code></dt>
240<dd><p>Specify the installation directory for internal executables of GCC.
241The default is <samp><var>exec-prefix</var>/libexec</samp>.
242</p>
243</dd>
244<dt><code>--with-slibdir=<var>dirname</var></code></dt>
245<dd><p>Specify the installation directory for the shared libgcc library.  The
246default is <samp><var>libdir</var></samp>.
247</p>
248</dd>
249<dt><code>--datarootdir=<var>dirname</var></code></dt>
250<dd><p>Specify the root of the directory tree for read-only architecture-independent
251data files referenced by GCC.  The default is <samp><var>prefix</var>/share</samp>.
252</p>
253</dd>
254<dt><code>--infodir=<var>dirname</var></code></dt>
255<dd><p>Specify the installation directory for documentation in info format.
256The default is <samp><var>datarootdir</var>/info</samp>.
257</p>
258</dd>
259<dt><code>--datadir=<var>dirname</var></code></dt>
260<dd><p>Specify the installation directory for some architecture-independent
261data files referenced by GCC.  The default is <samp><var>datarootdir</var></samp>.
262</p>
263</dd>
264<dt><code>--docdir=<var>dirname</var></code></dt>
265<dd><p>Specify the installation directory for documentation files (other
266than Info) for GCC.  The default is <samp><var>datarootdir</var>/doc</samp>.
267</p>
268</dd>
269<dt><code>--htmldir=<var>dirname</var></code></dt>
270<dd><p>Specify the installation directory for HTML documentation files.
271The default is <samp><var>docdir</var></samp>.
272</p>
273</dd>
274<dt><code>--pdfdir=<var>dirname</var></code></dt>
275<dd><p>Specify the installation directory for PDF documentation files.
276The default is <samp><var>docdir</var></samp>.
277</p>
278</dd>
279<dt><code>--mandir=<var>dirname</var></code></dt>
280<dd><p>Specify the installation directory for manual pages.  The default is
281<samp><var>datarootdir</var>/man</samp>.  (Note that the manual pages are only extracts
282from the full GCC manuals, which are provided in Texinfo format.  The manpages
283are derived by an automatic conversion process from parts of the full
284manual.)
285</p>
286</dd>
287<dt><code>--with-gxx-include-dir=<var>dirname</var></code></dt>
288<dd><p>Specify
289the installation directory for G++ header files.  The default depends
290on other configuration options, and differs between cross and native
291configurations.
292</p>
293</dd>
294<dt><code>--with-specs=<var>specs</var></code></dt>
295<dd><p>Specify additional command line driver SPECS.
296This can be useful if you need to turn on a non-standard feature by
297default without modifying the compiler&rsquo;s source code, for instance
298<samp>--with-specs=%{!fcommon:%{!fno-common:-fno-common}}</samp>.
299See &ldquo;Spec Files&rdquo; in the main manual
300</p>
301</dd>
302</dl>
303
304</dd>
305<dt><code>--program-prefix=<var>prefix</var></code></dt>
306<dd><p>GCC supports some transformations of the names of its programs when
307installing them.  This option prepends <var>prefix</var> to the names of
308programs to install in <var>bindir</var> (see above).  For example, specifying
309<samp>--program-prefix=foo-</samp> would result in &lsquo;<samp>gcc</samp>&rsquo;
310being installed as <samp>/usr/local/bin/foo-gcc</samp>.
311</p>
312</dd>
313<dt><code>--program-suffix=<var>suffix</var></code></dt>
314<dd><p>Appends <var>suffix</var> to the names of programs to install in <var>bindir</var>
315(see above).  For example, specifying <samp>--program-suffix=-3.1</samp>
316would result in &lsquo;<samp>gcc</samp>&rsquo; being installed as
317<samp>/usr/local/bin/gcc-3.1</samp>.
318</p>
319</dd>
320<dt><code>--program-transform-name=<var>pattern</var></code></dt>
321<dd><p>Applies the &lsquo;<samp>sed</samp>&rsquo; script <var>pattern</var> to be applied to the names
322of programs to install in <var>bindir</var> (see above).  <var>pattern</var> has to
323consist of one or more basic &lsquo;<samp>sed</samp>&rsquo; editing commands, separated by
324semicolons.  For example, if you want the &lsquo;<samp>gcc</samp>&rsquo; program name to be
325transformed to the installed program <samp>/usr/local/bin/myowngcc</samp> and
326the &lsquo;<samp>g++</samp>&rsquo; program name to be transformed to
327<samp>/usr/local/bin/gspecial++</samp> without changing other program names,
328you could use the pattern
329<samp>--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/'</samp>
330to achieve this effect.
331</p>
332<p>All three options can be combined and used together, resulting in more
333complex conversion patterns.  As a basic rule, <var>prefix</var> (and
334<var>suffix</var>) are prepended (appended) before further transformations
335can happen with a special transformation script <var>pattern</var>.
336</p>
337<p>As currently implemented, this option only takes effect for native
338builds; cross compiler binaries&rsquo; names are not transformed even when a
339transformation is explicitly asked for by one of these options.
340</p>
341<p>For native builds, some of the installed programs are also installed
342with the target alias in front of their name, as in
343&lsquo;<samp>i686-pc-linux-gnu-gcc</samp>&rsquo;.  All of the above transformations happen
344before the target alias is prepended to the name&mdash;so, specifying
345<samp>--program-prefix=foo-</samp> and <samp>program-suffix=-3.1</samp>, the
346resulting binary would be installed as
347<samp>/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1</samp>.
348</p>
349<p>As a last shortcoming, none of the installed Ada programs are
350transformed yet, which will be fixed in some time.
351</p>
352</dd>
353<dt><code>--with-local-prefix=<var>dirname</var></code></dt>
354<dd><p>Specify the
355installation directory for local include files.  The default is
356<samp>/usr/local</samp>.  Specify this option if you want the compiler to
357search directory <samp><var>dirname</var>/include</samp> for locally installed
358header files <em>instead</em> of <samp>/usr/local/include</samp>.
359</p>
360<p>You should specify <samp>--with-local-prefix</samp> <strong>only</strong> if your
361site has a different convention (not <samp>/usr/local</samp>) for where to put
362site-specific files.
363</p>
364<p>The default value for <samp>--with-local-prefix</samp> is <samp>/usr/local</samp>
365regardless of the value of <samp>--prefix</samp>.  Specifying
366<samp>--prefix</samp> has no effect on which directory GCC searches for
367local header files.  This may seem counterintuitive, but actually it is
368logical.
369</p>
370<p>The purpose of <samp>--prefix</samp> is to specify where to <em>install
371GCC</em>.  The local header files in <samp>/usr/local/include</samp>&mdash;if you put
372any in that directory&mdash;are not part of GCC.  They are part of other
373programs&mdash;perhaps many others.  (GCC installs its own header files in
374another directory which is based on the <samp>--prefix</samp> value.)
375</p>
376<p>Both the local-prefix include directory and the GCC-prefix include
377directory are part of GCC&rsquo;s &ldquo;system include&rdquo; directories.  Although these
378two directories are not fixed, they need to be searched in the proper
379order for the correct processing of the include_next directive.  The
380local-prefix include directory is searched before the GCC-prefix
381include directory.  Another characteristic of system include directories
382is that pedantic warnings are turned off for headers in these directories.
383</p>
384<p>Some autoconf macros add <samp>-I <var>directory</var></samp> options to the
385compiler command line, to ensure that directories containing installed
386packages&rsquo; headers are searched.  When <var>directory</var> is one of GCC&rsquo;s
387system include directories, GCC will ignore the option so that system
388directories continue to be processed in the correct order.  This
389may result in a search order different from what was specified but the
390directory will still be searched.
391</p>
392<p>GCC automatically searches for ordinary libraries using
393<code>GCC_EXEC_PREFIX</code>.  Thus, when the same installation prefix is
394used for both GCC and packages, GCC will automatically search for
395both headers and libraries.  This provides a configuration that is
396easy to use.  GCC behaves in a manner similar to that when it is
397installed as a system compiler in <samp>/usr</samp>.
398</p>
399<p>Sites that need to install multiple versions of GCC may not want to
400use the above simple configuration.  It is possible to use the
401<samp>--program-prefix</samp>, <samp>--program-suffix</samp> and
402<samp>--program-transform-name</samp> options to install multiple versions
403into a single directory, but it may be simpler to use different prefixes
404and the <samp>--with-local-prefix</samp> option to specify the location of the
405site-specific files for each version.  It will then be necessary for
406users to specify explicitly the location of local site libraries
407(e.g., with <code>LIBRARY_PATH</code>).
408</p>
409<p>The same value can be used for both <samp>--with-local-prefix</samp> and
410<samp>--prefix</samp> provided it is not <samp>/usr</samp>.  This can be used
411to avoid the default search of <samp>/usr/local/include</samp>.
412</p>
413<p><strong>Do not</strong> specify <samp>/usr</samp> as the <samp>--with-local-prefix</samp>!
414The directory you use for <samp>--with-local-prefix</samp> <strong>must not</strong>
415contain any of the system&rsquo;s standard header files.  If it did contain
416them, certain programs would be miscompiled (including GNU Emacs, on
417certain targets), because this would override and nullify the header
418file corrections made by the <code>fixincludes</code> script.
419</p>
420<p>Indications are that people who use this option use it based on mistaken
421ideas of what it is for.  People use it as if it specified where to
422install part of GCC.  Perhaps they make this assumption because
423installing GCC creates the directory.
424</p>
425</dd>
426<dt><code>--with-gcc-major-version-only</code></dt>
427<dd><p>Specifies that GCC should use only the major number rather than
428<var>major</var>.<var>minor</var>.<var>patchlevel</var> in filesystem paths.
429</p>
430</dd>
431<dt><code>--with-native-system-header-dir=<var>dirname</var></code></dt>
432<dd><p>Specifies that <var>dirname</var> is the directory that contains native system
433header files, rather than <samp>/usr/include</samp>.  This option is most useful
434if you are creating a compiler that should be isolated from the system
435as much as possible.  It is most commonly used with the
436<samp>--with-sysroot</samp> option and will cause GCC to search
437<var>dirname</var> inside the system root specified by that option.
438</p>
439</dd>
440<dt><code>--enable-shared[=<var>package</var>[,&hellip;]]</code></dt>
441<dd><p>Build shared versions of libraries, if shared libraries are supported on
442the target platform.  Unlike GCC 2.95.x and earlier, shared libraries
443are enabled by default on all platforms that support shared libraries.
444</p>
445<p>If a list of packages is given as an argument, build shared libraries
446only for the listed packages.  For other packages, only static libraries
447will be built.  Package names currently recognized in the GCC tree are
448&lsquo;<samp>libgcc</samp>&rsquo; (also known as &lsquo;<samp>gcc</samp>&rsquo;), &lsquo;<samp>libstdc++</samp>&rsquo; (not
449&lsquo;<samp>libstdc++-v3</samp>&rsquo;), &lsquo;<samp>libffi</samp>&rsquo;, &lsquo;<samp>zlib</samp>&rsquo;, &lsquo;<samp>boehm-gc</samp>&rsquo;,
450&lsquo;<samp>ada</samp>&rsquo;, &lsquo;<samp>libada</samp>&rsquo;, &lsquo;<samp>libgo</samp>&rsquo;, &lsquo;<samp>libobjc</samp>&rsquo;, and &lsquo;<samp>libphobos</samp>&rsquo;.
451Note &lsquo;<samp>libiberty</samp>&rsquo; does not support shared libraries at all.
452</p>
453<p>Use <samp>--disable-shared</samp> to build only static libraries.  Note that
454<samp>--disable-shared</samp> does not accept a list of package names as
455argument, only <samp>--enable-shared</samp> does.
456</p>
457<p>Contrast with <samp>--enable-host-shared</samp>, which affects <em>host</em>
458code.
459</p>
460</dd>
461<dt><code>--enable-host-shared</code></dt>
462<dd><p>Specify that the <em>host</em> code should be built into position-independent
463machine code (with -fPIC), allowing it to be used within shared libraries,
464but yielding a slightly slower compiler.
465</p>
466<p>This option is required when building the libgccjit.so library.
467</p>
468<p>Contrast with <samp>--enable-shared</samp>, which affects <em>target</em>
469libraries.
470</p>
471</dd>
472<dt><code><a name="with-gnu-as"></a>--with-gnu-as</code></dt>
473<dd><p>Specify that the compiler should assume that the
474assembler it finds is the GNU assembler.  However, this does not modify
475the rules to find an assembler and will result in confusion if the
476assembler found is not actually the GNU assembler.  (Confusion may also
477result if the compiler finds the GNU assembler but has not been
478configured with <samp>--with-gnu-as</samp>.)  If you have more than one
479assembler installed on your system, you may want to use this option in
480connection with <samp>--with-as=<var>pathname</var></samp> or
481<samp>--with-build-time-tools=<var>pathname</var></samp>.
482</p>
483<p>The following systems are the only ones where it makes a difference
484whether you use the GNU assembler.  On any other system,
485<samp>--with-gnu-as</samp> has no effect.
486</p>
487<ul>
488<li> &lsquo;<samp>hppa1.0-<var>any</var>-<var>any</var></samp>&rsquo;
489</li><li> &lsquo;<samp>hppa1.1-<var>any</var>-<var>any</var></samp>&rsquo;
490</li><li> &lsquo;<samp>sparc-sun-solaris2.<var>any</var></samp>&rsquo;
491</li><li> &lsquo;<samp>sparc64-<var>any</var>-solaris2.<var>any</var></samp>&rsquo;
492</li></ul>
493
494</dd>
495<dt><code><a name="with-as"></a>--with-as=<var>pathname</var></code></dt>
496<dd><p>Specify that the compiler should use the assembler pointed to by
497<var>pathname</var>, rather than the one found by the standard rules to find
498an assembler, which are:
499</p><ul>
500<li> Unless GCC is being built with a cross compiler, check the
501<samp><var>libexec</var>/gcc/<var>target</var>/<var>version</var></samp> directory.
502<var>libexec</var> defaults to <samp><var>exec-prefix</var>/libexec</samp>;
503<var>exec-prefix</var> defaults to <var>prefix</var>, which
504defaults to <samp>/usr/local</samp> unless overridden by the
505<samp>--prefix=<var>pathname</var></samp> switch described above.  <var>target</var>
506is the target system triple, such as &lsquo;<samp>sparc-sun-solaris2.7</samp>&rsquo;, and
507<var>version</var> denotes the GCC version, such as 3.0.
508
509</li><li> If the target system is the same that you are building on, check
510operating system specific directories (e.g. <samp>/usr/ccs/bin</samp> on
511Solaris 2).
512
513</li><li> Check in the <code>PATH</code> for a tool whose name is prefixed by the
514target system triple.
515
516</li><li> Check in the <code>PATH</code> for a tool whose name is not prefixed by the
517target system triple, if the host and target system triple are
518the same (in other words, we use a host tool if it can be used for
519the target as well).
520</li></ul>
521
522<p>You may want to use <samp>--with-as</samp> if no assembler
523is installed in the directories listed above, or if you have multiple
524assemblers installed and want to choose one that is not found by the
525above rules.
526</p>
527</dd>
528<dt><code><a name="with-gnu-ld"></a>--with-gnu-ld</code></dt>
529<dd><p>Same as <a href="#with-gnu-as"><samp>--with-gnu-as</samp></a>
530but for the linker.
531</p>
532</dd>
533<dt><code>--with-ld=<var>pathname</var></code></dt>
534<dd><p>Same as <a href="#with-as"><samp>--with-as</samp></a>
535but for the linker.
536</p>
537</dd>
538<dt><code>--with-stabs</code></dt>
539<dd><p>Specify that stabs debugging
540information should be used instead of whatever format the host normally
541uses.  Normally GCC uses the same debug format as the host system.
542</p>
543</dd>
544<dt><code>--with-tls=<var>dialect</var></code></dt>
545<dd><p>Specify the default TLS dialect, for systems were there is a choice.
546For ARM targets, possible values for <var>dialect</var> are <code>gnu</code> or
547<code>gnu2</code>, which select between the original GNU dialect and the GNU TLS
548descriptor-based dialect.
549</p>
550</dd>
551<dt><code>--enable-multiarch</code></dt>
552<dd><p>Specify whether to enable or disable multiarch support.  The default is
553to check for glibc start files in a multiarch location, and enable it
554if the files are found.  The auto detection is enabled for native builds,
555and for cross builds configured with <samp>--with-sysroot</samp>, and without
556<samp>--with-native-system-header-dir</samp>.
557More documentation about multiarch can be found at
558<a href="https://wiki.debian.org/Multiarch">https://wiki.debian.org/Multiarch</a>.
559</p>
560</dd>
561<dt><code>--enable-sjlj-exceptions</code></dt>
562<dd><p>Force use of the <code>setjmp</code>/<code>longjmp</code>-based scheme for exceptions.
563&lsquo;<samp>configure</samp>&rsquo; ordinarily picks the correct value based on the platform.
564Only use this option if you are sure you need a different setting.
565</p>
566</dd>
567<dt><code>--enable-vtable-verify</code></dt>
568<dd><p>Specify whether to enable or disable the vtable verification feature.
569Enabling this feature causes libstdc++ to be built with its virtual calls
570in verifiable mode.  This means that, when linked with libvtv, every
571virtual call in libstdc++ will verify the vtable pointer through which the
572call will be made before actually making the call.  If not linked with libvtv,
573the verifier will call stub functions (in libstdc++ itself) and do nothing.
574If vtable verification is disabled, then libstdc++ is not built with its
575virtual calls in verifiable mode at all.  However the libvtv library will
576still be built (see <samp>--disable-libvtv</samp> to turn off building libvtv).
577<samp>--disable-vtable-verify</samp> is the default.
578</p>
579</dd>
580<dt><code>--disable-gcov</code></dt>
581<dd><p>Specify that the run-time library used for coverage analysis
582and associated host tools should not be built.
583</p>
584</dd>
585<dt><code>--disable-multilib</code></dt>
586<dd><p>Specify that multiple target
587libraries to support different target variants, calling
588conventions, etc. should not be built.  The default is to build a
589predefined set of them.
590</p>
591<p>Some targets provide finer-grained control over which multilibs are built
592(e.g., <samp>--disable-softfloat</samp>):
593</p><dl compact="compact">
594<dt><code>arm-*-*</code></dt>
595<dd><p>fpu, 26bit, underscore, interwork, biendian, nofmult.
596</p>
597</dd>
598<dt><code>m68*-*-*</code></dt>
599<dd><p>softfloat, m68881, m68000, m68020.
600</p>
601</dd>
602<dt><code>mips*-*-*</code></dt>
603<dd><p>single-float, biendian, softfloat.
604</p>
605</dd>
606<dt><code>msp430-*-*</code></dt>
607<dd><p>no-exceptions
608</p>
609</dd>
610<dt><code>powerpc*-*-*, rs6000*-*-*</code></dt>
611<dd><p>aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian,
612sysv, aix.
613</p>
614</dd>
615</dl>
616
617</dd>
618<dt><code>--with-multilib-list=<var>list</var></code></dt>
619<dt><code>--without-multilib-list</code></dt>
620<dd><p>Specify what multilibs to build.  <var>list</var> is a comma separated list of
621values, possibly consisting of a single value.  Currently only implemented
622for aarch64*-*-*, arm*-*-*, riscv*-*-*, sh*-*-* and x86-64-*-linux*.  The
623accepted values and meaning for each target is given below.
624</p>
625<dl compact="compact">
626<dt><code>aarch64*-*-*</code></dt>
627<dd><p><var>list</var> is a comma separated list of <code>ilp32</code>, and <code>lp64</code>
628to enable ILP32 and LP64 run-time libraries, respectively.  If
629<var>list</var> is empty, then there will be no multilibs and only the
630default run-time library will be built.  If <var>list</var> is
631<code>default</code> or &ndash;with-multilib-list= is not specified, then the
632default set of libraries is selected based on the value of
633<samp>--target</samp>.
634</p>
635</dd>
636<dt><code>arm*-*-*</code></dt>
637<dd><p><var>list</var> is a comma separated list of <code>aprofile</code> and
638<code>rmprofile</code> to build multilibs for A or R and M architecture
639profiles respectively.  Note that, due to some limitation of the current
640multilib framework, using the combined <code>aprofile,rmprofile</code>
641multilibs selects in some cases a less optimal multilib than when using
642the multilib profile for the architecture targetted.  The special value
643<code>default</code> is also accepted and is equivalent to omitting the
644option, i.e., only the default run-time library will be enabled.
645</p>
646<p><var>list</var> may instead contain <code>@name</code>, to use the multilib
647configuration Makefile fragment <samp>name</samp> in <samp>gcc/config/arm</samp> in
648the source tree (it is part of the corresponding sources, after all).
649It is recommended, but not required, that files used for this purpose to
650be named starting with <samp>t-ml-</samp>, to make their intended purpose
651self-evident, in line with GCC conventions.  Such files enable custom,
652user-chosen multilib lists to be configured.  Whether multiple such
653files can be used together depends on the contents of the supplied
654files.  See <samp>gcc/config/arm/t-multilib</samp> and its supplementary
655<samp>gcc/config/arm/t-*profile</samp> files for an example of what such
656Makefile fragments might look like for this version of GCC.  The macros
657expected to be defined in these fragments are not stable across GCC
658releases, so make sure they define the <code>MULTILIB</code>-related macros
659expected by the version of GCC you are building.
660See &ldquo;Target Makefile Fragments&rdquo; in the internals manual.
661</p>
662<p>The table below gives the combination of ISAs, architectures, FPUs and
663floating-point ABIs for which multilibs are built for each predefined
664profile.  The union of these options is considered when specifying both
665<code>aprofile</code> and <code>rmprofile</code>.
666</p>
667<table>
668<tr><td width="15%">Option</td><td width="28%">aprofile</td><td width="30%">rmprofile</td></tr>
669<tr><td width="15%">ISAs</td><td width="28%"><code>-marm</code> and <code>-mthumb</code></td><td width="30%"><code>-mthumb</code></td></tr>
670<tr><td width="15%">Architectures<br><br><br><br><br><br></td><td width="28%">default architecture<br>
671<code>-march=armv7-a</code><br>
672<code>-march=armv7ve</code><br>
673<code>-march=armv8-a</code><br><br><br></td><td width="30%">default architecture<br>
674<code>-march=armv6s-m</code><br>
675<code>-march=armv7-m</code><br>
676<code>-march=armv7e-m</code><br>
677<code>-march=armv8-m.base</code><br>
678<code>-march=armv8-m.main</code><br>
679<code>-march=armv7</code></td></tr>
680<tr><td width="15%">FPUs<br><br><br><br><br></td><td width="28%">none<br>
681<code>-mfpu=vfpv3-d16</code><br>
682<code>-mfpu=neon</code><br>
683<code>-mfpu=vfpv4-d16</code><br>
684<code>-mfpu=neon-vfpv4</code><br>
685<code>-mfpu=neon-fp-armv8</code></td><td width="30%">none<br>
686<code>-mfpu=vfpv3-d16</code><br>
687<code>-mfpu=fpv4-sp-d16</code><br>
688<code>-mfpu=fpv5-sp-d16</code><br>
689<code>-mfpu=fpv5-d16</code><br></td></tr>
690<tr><td width="15%">floating-point ABIs<br><br></td><td width="28%"><code>-mfloat-abi=soft</code><br>
691<code>-mfloat-abi=softfp</code><br>
692<code>-mfloat-abi=hard</code></td><td width="30%"><code>-mfloat-abi=soft</code><br>
693<code>-mfloat-abi=softfp</code><br>
694<code>-mfloat-abi=hard</code></td></tr>
695</table>
696
697</dd>
698<dt><code>riscv*-*-*</code></dt>
699<dd><p><var>list</var> is a single ABI name.  The target architecture must be either
700<code>rv32gc</code> or <code>rv64gc</code>.  This will build a single multilib for the
701specified architecture and ABI pair.  If <code>--with-multilib-list</code> is not
702given, then a default set of multilibs is selected based on the value of
703<samp>--target</samp>.  This is usually a large set of multilibs.
704</p>
705</dd>
706<dt><code>sh*-*-*</code></dt>
707<dd><p><var>list</var> is a comma separated list of CPU names.  These must be of the
708form <code>sh*</code> or <code>m*</code> (in which case they match the compiler option
709for that processor).  The list should not contain any endian options -
710these are handled by <samp>--with-endian</samp>.
711</p>
712<p>If <var>list</var> is empty, then there will be no multilibs for extra
713processors.  The multilib for the secondary endian remains enabled.
714</p>
715<p>As a special case, if an entry in the list starts with a <code>!</code>
716(exclamation point), then it is added to the list of excluded multilibs.
717Entries of this sort should be compatible with &lsquo;<samp>MULTILIB_EXCLUDES</samp>&rsquo;
718(once the leading <code>!</code> has been stripped).
719</p>
720<p>If <samp>--with-multilib-list</samp> is not given, then a default set of
721multilibs is selected based on the value of <samp>--target</samp>.  This is
722usually the complete set of libraries, but some targets imply a more
723specialized subset.
724</p>
725<p>Example 1: to configure a compiler for SH4A only, but supporting both
726endians, with little endian being the default:
727</p><div class="smallexample">
728<pre class="smallexample">--with-cpu=sh4a --with-endian=little,big --with-multilib-list=
729</pre></div>
730
731<p>Example 2: to configure a compiler for both SH4A and SH4AL-DSP, but with
732only little endian SH4AL:
733</p><div class="smallexample">
734<pre class="smallexample">--with-cpu=sh4a --with-endian=little,big \
735--with-multilib-list=sh4al,!mb/m4al
736</pre></div>
737
738</dd>
739<dt><code>x86-64-*-linux*</code></dt>
740<dd><p><var>list</var> is a comma separated list of <code>m32</code>, <code>m64</code> and
741<code>mx32</code> to enable 32-bit, 64-bit and x32 run-time libraries,
742respectively.  If <var>list</var> is empty, then there will be no multilibs
743and only the default run-time library will be enabled.
744</p>
745<p>If <samp>--with-multilib-list</samp> is not given, then only 32-bit and
74664-bit run-time libraries will be enabled.
747</p></dd>
748</dl>
749
750</dd>
751<dt><code>--with-endian=<var>endians</var></code></dt>
752<dd><p>Specify what endians to use.
753Currently only implemented for sh*-*-*.
754</p>
755<p><var>endians</var> may be one of the following:
756</p><dl compact="compact">
757<dt><code>big</code></dt>
758<dd><p>Use big endian exclusively.
759</p></dd>
760<dt><code>little</code></dt>
761<dd><p>Use little endian exclusively.
762</p></dd>
763<dt><code>big,little</code></dt>
764<dd><p>Use big endian by default.  Provide a multilib for little endian.
765</p></dd>
766<dt><code>little,big</code></dt>
767<dd><p>Use little endian by default.  Provide a multilib for big endian.
768</p></dd>
769</dl>
770
771</dd>
772<dt><code>--enable-threads</code></dt>
773<dd><p>Specify that the target
774supports threads.  This affects the Objective-C compiler and runtime
775library, and exception handling for other languages like C++.
776On some systems, this is the default.
777</p>
778<p>In general, the best (and, in many cases, the only known) threading
779model available will be configured for use.  Beware that on some
780systems, GCC has not been taught what threading models are generally
781available for the system.  In this case, <samp>--enable-threads</samp> is an
782alias for <samp>--enable-threads=single</samp>.
783</p>
784</dd>
785<dt><code>--disable-threads</code></dt>
786<dd><p>Specify that threading support should be disabled for the system.
787This is an alias for <samp>--enable-threads=single</samp>.
788</p>
789</dd>
790<dt><code>--enable-threads=<var>lib</var></code></dt>
791<dd><p>Specify that
792<var>lib</var> is the thread support library.  This affects the Objective-C
793compiler and runtime library, and exception handling for other languages
794like C++.  The possibilities for <var>lib</var> are:
795</p>
796<dl compact="compact">
797<dt><code>aix</code></dt>
798<dd><p>AIX thread support.
799</p></dd>
800<dt><code>dce</code></dt>
801<dd><p>DCE thread support.
802</p></dd>
803<dt><code>lynx</code></dt>
804<dd><p>LynxOS thread support.
805</p></dd>
806<dt><code>mipssde</code></dt>
807<dd><p>MIPS SDE thread support.
808</p></dd>
809<dt><code>no</code></dt>
810<dd><p>This is an alias for &lsquo;<samp>single</samp>&rsquo;.
811</p></dd>
812<dt><code>posix</code></dt>
813<dd><p>Generic POSIX/Unix98 thread support.
814</p></dd>
815<dt><code>rtems</code></dt>
816<dd><p>RTEMS thread support.
817</p></dd>
818<dt><code>single</code></dt>
819<dd><p>Disable thread support, should work for all platforms.
820</p></dd>
821<dt><code>tpf</code></dt>
822<dd><p>TPF thread support.
823</p></dd>
824<dt><code>vxworks</code></dt>
825<dd><p>VxWorks thread support.
826</p></dd>
827<dt><code>win32</code></dt>
828<dd><p>Microsoft Win32 API thread support.
829</p></dd>
830</dl>
831
832</dd>
833<dt><code>--enable-tls</code></dt>
834<dd><p>Specify that the target supports TLS (Thread Local Storage).  Usually
835configure can correctly determine if TLS is supported.  In cases where
836it guesses incorrectly, TLS can be explicitly enabled or disabled with
837<samp>--enable-tls</samp> or <samp>--disable-tls</samp>.  This can happen if
838the assembler supports TLS but the C library does not, or if the
839assumptions made by the configure test are incorrect.
840</p>
841</dd>
842<dt><code>--disable-tls</code></dt>
843<dd><p>Specify that the target does not support TLS.
844This is an alias for <samp>--enable-tls=no</samp>.
845</p>
846</dd>
847<dt><code>--disable-tm-clone-registry</code></dt>
848<dd><p>Disable TM clone registry in libgcc. It is enabled in libgcc by default.
849This option helps to reduce code size for embedded targets which do
850not use transactional memory.
851</p>
852</dd>
853<dt><code>--with-cpu=<var>cpu</var></code></dt>
854<dt><code>--with-cpu-32=<var>cpu</var></code></dt>
855<dt><code>--with-cpu-64=<var>cpu</var></code></dt>
856<dd><p>Specify which cpu variant the compiler should generate code for by default.
857<var>cpu</var> will be used as the default value of the <samp>-mcpu=</samp> switch.
858This option is only supported on some targets, including ARC, ARM, i386, M68k,
859PowerPC, and SPARC.  It is mandatory for ARC.  The <samp>--with-cpu-32</samp> and
860<samp>--with-cpu-64</samp> options specify separate default CPUs for
86132-bit and 64-bit modes; these options are only supported for aarch64, i386,
862x86-64, PowerPC, and SPARC.
863</p>
864</dd>
865<dt><code>--with-schedule=<var>cpu</var></code></dt>
866<dt><code>--with-arch=<var>cpu</var></code></dt>
867<dt><code>--with-arch-32=<var>cpu</var></code></dt>
868<dt><code>--with-arch-64=<var>cpu</var></code></dt>
869<dt><code>--with-tune=<var>cpu</var></code></dt>
870<dt><code>--with-tune-32=<var>cpu</var></code></dt>
871<dt><code>--with-tune-64=<var>cpu</var></code></dt>
872<dt><code>--with-abi=<var>abi</var></code></dt>
873<dt><code>--with-fpu=<var>type</var></code></dt>
874<dt><code>--with-float=<var>type</var></code></dt>
875<dd><p>These configure options provide default values for the <samp>-mschedule=</samp>,
876<samp>-march=</samp>, <samp>-mtune=</samp>, <samp>-mabi=</samp>, and <samp>-mfpu=</samp>
877options and for <samp>-mhard-float</samp> or <samp>-msoft-float</samp>.  As with
878<samp>--with-cpu</samp>, which switches will be accepted and acceptable values
879of the arguments depend on the target.
880</p>
881</dd>
882<dt><code>--with-mode=<var>mode</var></code></dt>
883<dd><p>Specify if the compiler should default to <samp>-marm</samp> or <samp>-mthumb</samp>.
884This option is only supported on ARM targets.
885</p>
886</dd>
887<dt><code>--with-stack-offset=<var>num</var></code></dt>
888<dd><p>This option sets the default for the -mstack-offset=<var>num</var> option,
889and will thus generally also control the setting of this option for
890libraries.  This option is only supported on Epiphany targets.
891</p>
892</dd>
893<dt><code>--with-fpmath=<var>isa</var></code></dt>
894<dd><p>This options sets <samp>-mfpmath=sse</samp> by default and specifies the default
895ISA for floating-point arithmetics.  You can select either &lsquo;<samp>sse</samp>&rsquo; which
896enables <samp>-msse2</samp> or &lsquo;<samp>avx</samp>&rsquo; which enables <samp>-mavx</samp> by default.
897This option is only supported on i386 and x86-64 targets.
898</p>
899</dd>
900<dt><code>--with-fp-32=<var>mode</var></code></dt>
901<dd><p>On MIPS targets, set the default value for the <samp>-mfp</samp> option when using
902the o32 ABI.  The possibilities for <var>mode</var> are:
903</p><dl compact="compact">
904<dt><code>32</code></dt>
905<dd><p>Use the o32 FP32 ABI extension, as with the <samp>-mfp32</samp> command-line
906option.
907</p></dd>
908<dt><code>xx</code></dt>
909<dd><p>Use the o32 FPXX ABI extension, as with the <samp>-mfpxx</samp> command-line
910option.
911</p></dd>
912<dt><code>64</code></dt>
913<dd><p>Use the o32 FP64 ABI extension, as with the <samp>-mfp64</samp> command-line
914option.
915</p></dd>
916</dl>
917<p>In the absence of this configuration option the default is to use the o32
918FP32 ABI extension.
919</p>
920</dd>
921<dt><code>--with-odd-spreg-32</code></dt>
922<dd><p>On MIPS targets, set the <samp>-modd-spreg</samp> option by default when using
923the o32 ABI.
924</p>
925</dd>
926<dt><code>--without-odd-spreg-32</code></dt>
927<dd><p>On MIPS targets, set the <samp>-mno-odd-spreg</samp> option by default when using
928the o32 ABI.  This is normally used in conjunction with
929<samp>--with-fp-32=64</samp> in order to target the o32 FP64A ABI extension.
930</p>
931</dd>
932<dt><code>--with-nan=<var>encoding</var></code></dt>
933<dd><p>On MIPS targets, set the default encoding convention to use for the
934special not-a-number (NaN) IEEE 754 floating-point data.  The
935possibilities for <var>encoding</var> are:
936</p><dl compact="compact">
937<dt><code>legacy</code></dt>
938<dd><p>Use the legacy encoding, as with the <samp>-mnan=legacy</samp> command-line
939option.
940</p></dd>
941<dt><code>2008</code></dt>
942<dd><p>Use the 754-2008 encoding, as with the <samp>-mnan=2008</samp> command-line
943option.
944</p></dd>
945</dl>
946<p>To use this configuration option you must have an assembler version
947installed that supports the <samp>-mnan=</samp> command-line option too.
948In the absence of this configuration option the default convention is
949the legacy encoding, as when neither of the <samp>-mnan=2008</samp> and
950<samp>-mnan=legacy</samp> command-line options has been used.
951</p>
952</dd>
953<dt><code>--with-divide=<var>type</var></code></dt>
954<dd><p>Specify how the compiler should generate code for checking for
955division by zero.  This option is only supported on the MIPS target.
956The possibilities for <var>type</var> are:
957</p><dl compact="compact">
958<dt><code>traps</code></dt>
959<dd><p>Division by zero checks use conditional traps (this is the default on
960systems that support conditional traps).
961</p></dd>
962<dt><code>breaks</code></dt>
963<dd><p>Division by zero checks use the break instruction.
964</p></dd>
965</dl>
966
967
968</dd>
969<dt><code>--with-llsc</code></dt>
970<dd><p>On MIPS targets, make <samp>-mllsc</samp> the default when no
971<samp>-mno-llsc</samp> option is passed.  This is the default for
972Linux-based targets, as the kernel will emulate them if the ISA does
973not provide them.
974</p>
975</dd>
976<dt><code>--without-llsc</code></dt>
977<dd><p>On MIPS targets, make <samp>-mno-llsc</samp> the default when no
978<samp>-mllsc</samp> option is passed.
979</p>
980</dd>
981<dt><code>--with-synci</code></dt>
982<dd><p>On MIPS targets, make <samp>-msynci</samp> the default when no
983<samp>-mno-synci</samp> option is passed.
984</p>
985</dd>
986<dt><code>--without-synci</code></dt>
987<dd><p>On MIPS targets, make <samp>-mno-synci</samp> the default when no
988<samp>-msynci</samp> option is passed.  This is the default.
989</p>
990</dd>
991<dt><code>--with-lxc1-sxc1</code></dt>
992<dd><p>On MIPS targets, make <samp>-mlxc1-sxc1</samp> the default when no
993<samp>-mno-lxc1-sxc1</samp> option is passed.  This is the default.
994</p>
995</dd>
996<dt><code>--without-lxc1-sxc1</code></dt>
997<dd><p>On MIPS targets, make <samp>-mno-lxc1-sxc1</samp> the default when no
998<samp>-mlxc1-sxc1</samp> option is passed.  The indexed load/store
999instructions are not directly a problem but can lead to unexpected
1000behaviour when deployed in an application intended for a 32-bit address
1001space but run on a 64-bit processor.  The issue is seen because all
1002known MIPS 64-bit Linux kernels execute o32 and n32 applications
1003with 64-bit addressing enabled which affects the overflow behaviour
1004of the indexed addressing mode.  GCC will assume that ordinary
100532-bit arithmetic overflow behaviour is the same whether performed
1006as an <code>addu</code> instruction or as part of the address calculation
1007in <code>lwxc1</code> type instructions.  This assumption holds true in a
1008pure 32-bit environment and can hold true in a 64-bit environment if
1009the address space is accurately set to be 32-bit for o32 and n32.
1010</p>
1011</dd>
1012<dt><code>--with-madd4</code></dt>
1013<dd><p>On MIPS targets, make <samp>-mmadd4</samp> the default when no
1014<samp>-mno-madd4</samp> option is passed.  This is the default.
1015</p>
1016</dd>
1017<dt><code>--without-madd4</code></dt>
1018<dd><p>On MIPS targets, make <samp>-mno-madd4</samp> the default when no
1019<samp>-mmadd4</samp> option is passed.  The <code>madd4</code> instruction
1020family can be problematic when targeting a combination of cores that
1021implement these instructions differently.  There are two known cores
1022that implement these as fused operations instead of unfused (where
1023unfused is normally expected).  Disabling these instructions is the
1024only way to ensure compatible code is generated; this will incur
1025a performance penalty.
1026</p>
1027</dd>
1028<dt><code>--with-mips-plt</code></dt>
1029<dd><p>On MIPS targets, make use of copy relocations and PLTs.
1030These features are extensions to the traditional
1031SVR4-based MIPS ABIs and require support from GNU binutils
1032and the runtime C library.
1033</p>
1034</dd>
1035<dt><code>--with-stack-clash-protection-guard-size=<var>size</var></code></dt>
1036<dd><p>On certain targets this option sets the default stack clash protection guard
1037size as a power of two in bytes.  On AArch64 <var>size</var> is required to be either
103812 (4KB) or 16 (64KB).
1039</p>
1040</dd>
1041<dt><code>--enable-__cxa_atexit</code></dt>
1042<dd><p>Define if you want to use __cxa_atexit, rather than atexit, to
1043register C++ destructors for local statics and global objects.
1044This is essential for fully standards-compliant handling of
1045destructors, but requires __cxa_atexit in libc.  This option is currently
1046only available on systems with GNU libc.  When enabled, this will cause
1047<samp>-fuse-cxa-atexit</samp> to be passed by default.
1048</p>
1049</dd>
1050<dt><code>--enable-gnu-indirect-function</code></dt>
1051<dd><p>Define if you want to enable the <code>ifunc</code> attribute.  This option is
1052currently only available on systems with GNU libc on certain targets.
1053</p>
1054</dd>
1055<dt><code>--enable-target-optspace</code></dt>
1056<dd><p>Specify that target
1057libraries should be optimized for code space instead of code speed.
1058This is the default for the m32r platform.
1059</p>
1060</dd>
1061<dt><code>--with-cpp-install-dir=<var>dirname</var></code></dt>
1062<dd><p>Specify that the user visible <code>cpp</code> program should be installed
1063in <samp><var>prefix</var>/<var>dirname</var>/cpp</samp>, in addition to <var>bindir</var>.
1064</p>
1065</dd>
1066<dt><code>--enable-comdat</code></dt>
1067<dd><p>Enable COMDAT group support.  This is primarily used to override the
1068automatically detected value.
1069</p>
1070</dd>
1071<dt><code>--enable-initfini-array</code></dt>
1072<dd><p>Force the use of sections <code>.init_array</code> and <code>.fini_array</code>
1073(instead of <code>.init</code> and <code>.fini</code>) for constructors and
1074destructors.  Option <samp>--disable-initfini-array</samp> has the
1075opposite effect.  If neither option is specified, the configure script
1076will try to guess whether the <code>.init_array</code> and
1077<code>.fini_array</code> sections are supported and, if they are, use them.
1078</p>
1079</dd>
1080<dt><code>--enable-link-mutex</code></dt>
1081<dd><p>When building GCC, use a mutex to avoid linking the compilers for
1082multiple languages at the same time, to avoid thrashing on build
1083systems with limited free memory.  The default is not to use such a mutex.
1084</p>
1085</dd>
1086<dt><code>--enable-maintainer-mode</code></dt>
1087<dd><p>The build rules that regenerate the Autoconf and Automake output files as
1088well as the GCC master message catalog <samp>gcc.pot</samp> are normally
1089disabled.  This is because it can only be rebuilt if the complete source
1090tree is present.  If you have changed the sources and want to rebuild the
1091catalog, configuring with <samp>--enable-maintainer-mode</samp> will enable
1092this.  Note that you need a recent version of the <code>gettext</code> tools
1093to do so.
1094</p>
1095</dd>
1096<dt><code>--disable-bootstrap</code></dt>
1097<dd><p>For a native build, the default configuration is to perform
1098a 3-stage bootstrap of the compiler when &lsquo;<samp>make</samp>&rsquo; is invoked,
1099testing that GCC can compile itself correctly.  If you want to disable
1100this process, you can configure with <samp>--disable-bootstrap</samp>.
1101</p>
1102</dd>
1103<dt><code>--enable-bootstrap</code></dt>
1104<dd><p>In special cases, you may want to perform a 3-stage build
1105even if the target and host triplets are different.
1106This is possible when the host can run code compiled for
1107the target (e.g. host is i686-linux, target is i486-linux).
1108Starting from GCC 4.2, to do this you have to configure explicitly
1109with <samp>--enable-bootstrap</samp>.
1110</p>
1111</dd>
1112<dt><code>--enable-generated-files-in-srcdir</code></dt>
1113<dd><p>Neither the .c and .h files that are generated from Bison and flex nor the
1114info manuals and man pages that are built from the .texi files are present
1115in the repository development tree.  When building GCC from that development tree,
1116or from one of our snapshots, those generated files are placed in your
1117build directory, which allows for the source to be in a readonly
1118directory.
1119</p>
1120<p>If you configure with <samp>--enable-generated-files-in-srcdir</samp> then those
1121generated files will go into the source directory.  This is mainly intended
1122for generating release or prerelease tarballs of the GCC sources, since it
1123is not a requirement that the users of source releases to have flex, Bison,
1124or makeinfo.
1125</p>
1126</dd>
1127<dt><code>--enable-version-specific-runtime-libs</code></dt>
1128<dd><p>Specify
1129that runtime libraries should be installed in the compiler specific
1130subdirectory (<samp><var>libdir</var>/gcc</samp>) rather than the usual places.  In
1131addition, &lsquo;<samp>libstdc++</samp>&rsquo;&rsquo;s include files will be installed into
1132<samp><var>libdir</var></samp> unless you overruled it by using
1133<samp>--with-gxx-include-dir=<var>dirname</var></samp>.  Using this option is
1134particularly useful if you intend to use several versions of GCC in
1135parallel.  The default is &lsquo;<samp>yes</samp>&rsquo; for &lsquo;<samp>libada</samp>&rsquo;, and &lsquo;<samp>no</samp>&rsquo; for
1136the remaining libraries.
1137</p>
1138</dd>
1139<dt><code><a name="WithAixSoname"></a>--with-aix-soname=&lsquo;<samp>aix</samp>&rsquo;, &lsquo;<samp>svr4</samp>&rsquo; or &lsquo;<samp>both</samp>&rsquo;</code></dt>
1140<dd><p>Traditional AIX shared library versioning (versioned <code>Shared Object</code>
1141files as members of unversioned <code>Archive Library</code> files named
1142&lsquo;<samp>lib.a</samp>&rsquo;) causes numerous headaches for package managers. However,
1143<code>Import Files</code> as members of <code>Archive Library</code> files allow for
1144<strong>filename-based versioning</strong> of shared libraries as seen on Linux/SVR4,
1145where this is called the &quot;SONAME&quot;. But as they prevent static linking,
1146<code>Import Files</code> may be used with <code>Runtime Linking</code> only, where the
1147linker does search for &lsquo;<samp>libNAME.so</samp>&rsquo; before &lsquo;<samp>libNAME.a</samp>&rsquo; library
1148filenames with the &lsquo;<samp>-lNAME</samp>&rsquo; linker flag.
1149</p>
1150<a name="AixLdCommand"></a><p>For detailed information please refer to the AIX
1151<a href="https://www.ibm.com/support/knowledgecenter/search/%22the%20ld%20command%2C%20also%20called%20the%20linkage%20editor%20or%20binder%22">ld
1152Command</a> reference.
1153</p>
1154<p>As long as shared library creation is enabled, upon:
1155</p><dl compact="compact">
1156<dt><code>--with-aix-soname=aix</code></dt>
1157<dt><code>--with-aix-soname=both</code></dt>
1158<dd><p>A (traditional AIX) <code>Shared Archive Library</code> file is created:
1159 </p><ul>
1160<li> using the &lsquo;<samp>libNAME.a</samp>&rsquo; filename scheme
1161  </li><li> with the <code>Shared Object</code> file as archive member named
1162  &lsquo;<samp>libNAME.so.V</samp>&rsquo; (except for &lsquo;<samp>libgcc_s</samp>&rsquo;, where the <code>Shared
1163  Object</code> file is named &lsquo;<samp>shr.o</samp>&rsquo; for backwards compatibility), which
1164  <ul class="no-bullet">
1165<li>- is used for runtime loading from inside the &lsquo;<samp>libNAME.a</samp>&rsquo; file
1166   </li><li>- is used for dynamic loading via
1167   <code>dlopen(&quot;libNAME.a(libNAME.so.V)&quot;, RTLD_MEMBER)</code>
1168   </li><li>- is used for shared linking
1169   </li><li>- is used for static linking, so no separate <code>Static Archive
1170   Library</code> file is needed
1171  </li></ul>
1172</li></ul>
1173</dd>
1174<dt><code>--with-aix-soname=both</code></dt>
1175<dt><code>--with-aix-soname=svr4</code></dt>
1176<dd><p>A (second) <code>Shared Archive Library</code> file is created:
1177 </p><ul>
1178<li> using the &lsquo;<samp>libNAME.so.V</samp>&rsquo; filename scheme
1179 </li><li> with the <code>Shared Object</code> file as archive member named
1180 &lsquo;<samp>shr.o</samp>&rsquo;, which
1181  <ul class="no-bullet">
1182<li>- is created with the <code>-G linker flag</code>
1183   </li><li>- has the <code>F_LOADONLY</code> flag set
1184   </li><li>- is used for runtime loading from inside the &lsquo;<samp>libNAME.so.V</samp>&rsquo; file
1185   </li><li>- is used for dynamic loading via <code>dlopen(&quot;libNAME.so.V(shr.o)&quot;,
1186   RTLD_MEMBER)</code>
1187  </li></ul>
1188</li><li> with the <code>Import File</code> as archive member named &lsquo;<samp>shr.imp</samp>&rsquo;,
1189 which
1190  <ul class="no-bullet">
1191<li>- refers to &lsquo;<samp>libNAME.so.V(shr.o)</samp>&rsquo; as the &quot;SONAME&quot;, to be recorded
1192   in the <code>Loader Section</code> of subsequent binaries
1193   </li><li>- indicates whether &lsquo;<samp>libNAME.so.V(shr.o)</samp>&rsquo; is 32 or 64 bit
1194   </li><li>- lists all the public symbols exported by &lsquo;<samp>lib.so.V(shr.o)</samp>&rsquo;,
1195   eventually decorated with the <code>&lsquo;<samp>weak</samp>&rsquo; Keyword</code>
1196   </li><li>- is necessary for shared linking against &lsquo;<samp>lib.so.V(shr.o)</samp>&rsquo;
1197   </li></ul>
1198</li></ul>
1199<p>A symbolic link using the &lsquo;<samp>libNAME.so</samp>&rsquo; filename scheme is created:
1200  </p><ul>
1201<li> pointing to the &lsquo;<samp>libNAME.so.V</samp>&rsquo; <code>Shared Archive Library</code> file
1202  </li><li> to permit the <code>ld Command</code> to find &lsquo;<samp>lib.so.V(shr.imp)</samp>&rsquo; via
1203  the &lsquo;<samp>-lNAME</samp>&rsquo; argument (requires <code>Runtime Linking</code> to be enabled)
1204  </li><li> to permit dynamic loading of &lsquo;<samp>lib.so.V(shr.o)</samp>&rsquo; without the need
1205  to specify the version number via <code>dlopen(&quot;libNAME.so(shr.o)&quot;,
1206  RTLD_MEMBER)</code>
1207  </li></ul>
1208</dd>
1209</dl>
1210
1211<p>As long as static library creation is enabled, upon:
1212</p><dl compact="compact">
1213<dt><code>--with-aix-soname=svr4</code></dt>
1214<dd><p>A <code>Static Archive Library</code> is created:
1215 </p><ul>
1216<li> using the &lsquo;<samp>libNAME.a</samp>&rsquo; filename scheme
1217 </li><li> with all the <code>Static Object</code> files as archive members, which
1218  <ul class="no-bullet">
1219<li>- are used for static linking
1220  </li></ul>
1221</li></ul>
1222</dd>
1223</dl>
1224
1225<p>While the aix-soname=&lsquo;<samp>svr4</samp>&rsquo; option does not create <code>Shared Object</code>
1226files as members of unversioned <code>Archive Library</code> files any more, package
1227managers still are responsible to
1228<a href="./specific.html#TransferAixShobj">transfer</a> <code>Shared Object</code> files
1229found as member of a previously installed unversioned <code>Archive Library</code>
1230file into the newly installed <code>Archive Library</code> file with the same
1231filename.
1232</p>
1233<p><em>WARNING:</em> Creating <code>Shared Object</code> files with <code>Runtime Linking</code>
1234enabled may bloat the TOC, eventually leading to <code>TOC overflow</code> errors,
1235requiring the use of either the <samp>-Wl,-bbigtoc</samp> linker flag (seen to
1236break with the <code>GDB</code> debugger) or some of the TOC-related compiler flags,
1237see &ldquo;RS/6000 and PowerPC Options&rdquo; in the main manual.
1238</p>
1239<p><samp>--with-aix-soname</samp> is currently supported by &lsquo;<samp>libgcc_s</samp>&rsquo; only, so
1240this option is still experimental and not for normal use yet.
1241</p>
1242<p>Default is the traditional behavior <samp>--with-aix-soname=&lsquo;<samp>aix</samp>&rsquo;</samp>.
1243</p>
1244</dd>
1245<dt><code>--enable-languages=<var>lang1</var>,<var>lang2</var>,&hellip;</code></dt>
1246<dd><p>Specify that only a particular subset of compilers and
1247their runtime libraries should be built.  For a list of valid values for
1248<var>langN</var> you can issue the following command in the
1249<samp>gcc</samp> directory of your GCC source tree:<br>
1250</p><div class="smallexample">
1251<pre class="smallexample">grep ^language= */config-lang.in
1252</pre></div>
1253<p>Currently, you can use any of the following:
1254<code>all</code>, <code>default</code>, <code>ada</code>, <code>c</code>, <code>c++</code>, <code>d</code>,
1255<code>fortran</code>, <code>go</code>, <code>jit</code>, <code>lto</code>, <code>objc</code>, <code>obj-c++</code>.
1256Building the Ada compiler has special requirements, see below.
1257If you do not pass this flag, or specify the option <code>default</code>, then the
1258default languages available in the <samp>gcc</samp> sub-tree will be configured.
1259Ada, D, Go, Jit, and Objective-C++ are not default languages.  LTO is not a
1260default language, but is built by default because <samp>--enable-lto</samp> is
1261enabled by default.  The other languages are default languages.  If
1262<code>all</code> is specified, then all available languages are built.  An
1263exception is <code>jit</code> language, which requires
1264<samp>--enable-host-shared</samp> to be included with <code>all</code>.
1265</p>
1266</dd>
1267<dt><code>--enable-stage1-languages=<var>lang1</var>,<var>lang2</var>,&hellip;</code></dt>
1268<dd><p>Specify that a particular subset of compilers and their runtime
1269libraries should be built with the system C compiler during stage 1 of
1270the bootstrap process, rather than only in later stages with the
1271bootstrapped C compiler.  The list of valid values is the same as for
1272<samp>--enable-languages</samp>, and the option <code>all</code> will select all
1273of the languages enabled by <samp>--enable-languages</samp>.  This option is
1274primarily useful for GCC development; for instance, when a development
1275version of the compiler cannot bootstrap due to compiler bugs, or when
1276one is debugging front ends other than the C front end.  When this
1277option is used, one can then build the target libraries for the
1278specified languages with the stage-1 compiler by using <code>make
1279stage1-bubble all-target</code>, or run the testsuite on the stage-1 compiler
1280for the specified languages using <code>make stage1-start check-gcc</code>.
1281</p>
1282</dd>
1283<dt><code>--disable-libada</code></dt>
1284<dd><p>Specify that the run-time libraries and tools used by GNAT should not
1285be built.  This can be useful for debugging, or for compatibility with
1286previous Ada build procedures, when it was required to explicitly
1287do a &lsquo;<samp>make -C gcc gnatlib_and_tools</samp>&rsquo;.
1288</p>
1289</dd>
1290<dt><code>--disable-libsanitizer</code></dt>
1291<dd><p>Specify that the run-time libraries for the various sanitizers should
1292not be built.
1293</p>
1294</dd>
1295<dt><code>--disable-libssp</code></dt>
1296<dd><p>Specify that the run-time libraries for stack smashing protection
1297should not be built or linked against.  On many targets library support
1298is provided by the C library instead.
1299</p>
1300</dd>
1301<dt><code>--disable-libquadmath</code></dt>
1302<dd><p>Specify that the GCC quad-precision math library should not be built.
1303On some systems, the library is required to be linkable when building
1304the Fortran front end, unless <samp>--disable-libquadmath-support</samp>
1305is used.
1306</p>
1307</dd>
1308<dt><code>--disable-libquadmath-support</code></dt>
1309<dd><p>Specify that the Fortran front end and <code>libgfortran</code> do not add
1310support for <code>libquadmath</code> on systems supporting it.
1311</p>
1312</dd>
1313<dt><code>--disable-libgomp</code></dt>
1314<dd><p>Specify that the GNU Offloading and Multi Processing Runtime Library
1315should not be built.
1316</p>
1317</dd>
1318<dt><code>--disable-libvtv</code></dt>
1319<dd><p>Specify that the run-time libraries used by vtable verification
1320should not be built.
1321</p>
1322</dd>
1323<dt><code>--with-dwarf2</code></dt>
1324<dd><p>Specify that the compiler should
1325use DWARF 2 debugging information as the default.
1326</p>
1327</dd>
1328<dt><code>--with-advance-toolchain=<var>at</var></code></dt>
1329<dd><p>On 64-bit PowerPC Linux systems, configure the compiler to use the
1330header files, library files, and the dynamic linker from the Advance
1331Toolchain release <var>at</var> instead of the default versions that are
1332provided by the Linux distribution.  In general, this option is
1333intended for the developers of GCC, and it is not intended for general
1334use.
1335</p>
1336</dd>
1337<dt><code>--enable-targets=all</code></dt>
1338<dt><code>--enable-targets=<var>target_list</var></code></dt>
1339<dd><p>Some GCC targets, e.g. powerpc64-linux, build bi-arch compilers.
1340These are compilers that are able to generate either 64-bit or 32-bit
1341code.  Typically, the corresponding 32-bit target, e.g.
1342powerpc-linux for powerpc64-linux, only generates 32-bit code.  This
1343option enables the 32-bit target to be a bi-arch compiler, which is
1344useful when you want a bi-arch compiler that defaults to 32-bit, and
1345you are building a bi-arch or multi-arch binutils in a combined tree.
1346On mips-linux, this will build a tri-arch compiler (ABI o32/n32/64),
1347defaulted to o32.
1348Currently, this option only affects sparc-linux, powerpc-linux, x86-linux,
1349mips-linux and s390-linux.
1350</p>
1351</dd>
1352<dt><code>--enable-default-pie</code></dt>
1353<dd><p>Turn on <samp>-fPIE</samp> and <samp>-pie</samp> by default.
1354</p>
1355</dd>
1356<dt><code>--enable-secureplt</code></dt>
1357<dd><p>This option enables <samp>-msecure-plt</samp> by default for powerpc-linux.
1358See &ldquo;RS/6000 and PowerPC Options&rdquo; in the main manual
1359</p>
1360</dd>
1361<dt><code>--enable-default-ssp</code></dt>
1362<dd><p>Turn on <samp>-fstack-protector-strong</samp> by default.
1363</p>
1364</dd>
1365<dt><code>--enable-cld</code></dt>
1366<dd><p>This option enables <samp>-mcld</samp> by default for 32-bit x86 targets.
1367See &ldquo;i386 and x86-64 Options&rdquo; in the main manual
1368</p>
1369</dd>
1370<dt><code>--enable-large-address-aware</code></dt>
1371<dd><p>The <samp>--enable-large-address-aware</samp> option arranges for MinGW
1372executables to be linked using the <samp>--large-address-aware</samp>
1373option, that enables the use of more than 2GB of memory.  If GCC is
1374configured with this option, its effects can be reversed by passing the
1375<samp>-Wl,--disable-large-address-aware</samp> option to the so-configured
1376compiler driver.
1377</p>
1378</dd>
1379<dt><code>--enable-win32-registry</code></dt>
1380<dt><code>--enable-win32-registry=<var>key</var></code></dt>
1381<dt><code>--disable-win32-registry</code></dt>
1382<dd><p>The <samp>--enable-win32-registry</samp> option enables Microsoft Windows-hosted GCC
1383to look up installations paths in the registry using the following key:
1384</p>
1385<div class="smallexample">
1386<pre class="smallexample"><code>HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\<var>key</var></code>
1387</pre></div>
1388
1389<p><var>key</var> defaults to GCC version number, and can be overridden by the
1390<samp>--enable-win32-registry=<var>key</var></samp> option.  Vendors and distributors
1391who use custom installers are encouraged to provide a different key,
1392perhaps one comprised of vendor name and GCC version number, to
1393avoid conflict with existing installations.  This feature is enabled
1394by default, and can be disabled by <samp>--disable-win32-registry</samp>
1395option.  This option has no effect on the other hosts.
1396</p>
1397</dd>
1398<dt><code>--nfp</code></dt>
1399<dd><p>Specify that the machine does not have a floating point unit.  This
1400option only applies to &lsquo;<samp>m68k-sun-sunos<var>n</var></samp>&rsquo;.  On any other
1401system, <samp>--nfp</samp> has no effect.
1402</p>
1403</dd>
1404<dt><code>--enable-werror</code></dt>
1405<dt><code>--disable-werror</code></dt>
1406<dt><code>--enable-werror=yes</code></dt>
1407<dt><code>--enable-werror=no</code></dt>
1408<dd><p>When you specify this option, it controls whether certain files in the
1409compiler are built with <samp>-Werror</samp> in bootstrap stage2 and later.
1410If you don&rsquo;t specify it, <samp>-Werror</samp> is turned on for the main
1411development trunk.  However it defaults to off for release branches and
1412final releases.  The specific files which get <samp>-Werror</samp> are
1413controlled by the Makefiles.
1414</p>
1415</dd>
1416<dt><code>--enable-checking</code></dt>
1417<dt><code>--disable-checking</code></dt>
1418<dt><code>--enable-checking=<var>list</var></code></dt>
1419<dd><p>This option controls performing internal consistency checks in the compiler.
1420It does not change the generated code, but adds error checking of the
1421requested complexity.  This slows down the compiler and may only work
1422properly if you are building the compiler with GCC.
1423</p>
1424<p>When the option is not specified, the active set of checks depends on context.
1425Namely, bootstrap stage 1 defaults to &lsquo;<samp>--enable-checking=yes</samp>&rsquo;, builds
1426from release branches or release archives default to
1427&lsquo;<samp>--enable-checking=release</samp>&rsquo;, and otherwise
1428&lsquo;<samp>--enable-checking=yes,extra</samp>&rsquo; is used.  When the option is
1429specified without a <var>list</var>, the result is the same as
1430&lsquo;<samp>--enable-checking=yes</samp>&rsquo;.  Likewise, &lsquo;<samp>--disable-checking</samp>&rsquo; is
1431equivalent to &lsquo;<samp>--enable-checking=no</samp>&rsquo;.
1432</p>
1433<p>The categories of checks available in <var>list</var> are &lsquo;<samp>yes</samp>&rsquo; (most common
1434checks &lsquo;<samp>assert,misc,gc,gimple,rtlflag,runtime,tree,types</samp>&rsquo;), &lsquo;<samp>no</samp>&rsquo;
1435(no checks at all), &lsquo;<samp>all</samp>&rsquo; (all but &lsquo;<samp>valgrind</samp>&rsquo;), &lsquo;<samp>release</samp>&rsquo;
1436(cheapest checks &lsquo;<samp>assert,runtime</samp>&rsquo;) or &lsquo;<samp>none</samp>&rsquo; (same as &lsquo;<samp>no</samp>&rsquo;).
1437&lsquo;<samp>release</samp>&rsquo; checks are always on and to disable them
1438&lsquo;<samp>--disable-checking</samp>&rsquo; or &lsquo;<samp>--enable-checking=no[,&lt;other checks&gt;]</samp>&rsquo;
1439must be explicitly requested.  Disabling assertions makes the compiler and
1440runtime slightly faster but increases the risk of undetected internal errors
1441causing wrong code to be generated.
1442</p>
1443<p>Individual checks can be enabled with these flags: &lsquo;<samp>assert</samp>&rsquo;, &lsquo;<samp>df</samp>&rsquo;,
1444&lsquo;<samp>extra</samp>&rsquo;, &lsquo;<samp>fold</samp>&rsquo;, &lsquo;<samp>gc</samp>&rsquo;, &lsquo;<samp>gcac</samp>&rsquo;, &lsquo;<samp>gimple</samp>&rsquo;,
1445&lsquo;<samp>misc</samp>&rsquo;, &lsquo;<samp>rtl</samp>&rsquo;, &lsquo;<samp>rtlflag</samp>&rsquo;, &lsquo;<samp>runtime</samp>&rsquo;, &lsquo;<samp>tree</samp>&rsquo;,
1446&lsquo;<samp>types</samp>&rsquo; and &lsquo;<samp>valgrind</samp>&rsquo;.  &lsquo;<samp>extra</samp>&rsquo; extends &lsquo;<samp>misc</samp>&rsquo;
1447checking with extra checks that might affect code generation and should
1448therefore not differ between stage1 and later stages in bootstrap.
1449</p>
1450<p>The &lsquo;<samp>valgrind</samp>&rsquo; check requires the external <code>valgrind</code> simulator,
1451available from <a href="http://valgrind.org/">http://valgrind.org/</a>.  The &lsquo;<samp>rtl</samp>&rsquo; checks are
1452expensive and the &lsquo;<samp>df</samp>&rsquo;, &lsquo;<samp>gcac</samp>&rsquo; and &lsquo;<samp>valgrind</samp>&rsquo; checks are very
1453expensive.
1454</p>
1455</dd>
1456<dt><code>--disable-stage1-checking</code></dt>
1457<dt><code>--enable-stage1-checking</code></dt>
1458<dt><code>--enable-stage1-checking=<var>list</var></code></dt>
1459<dd><p>This option affects only bootstrap build.  If no <samp>--enable-checking</samp>
1460option is specified the stage1 compiler is built with &lsquo;<samp>yes</samp>&rsquo; checking
1461enabled, otherwise the stage1 checking flags are the same as specified by
1462<samp>--enable-checking</samp>.  To build the stage1 compiler with
1463different checking options use <samp>--enable-stage1-checking</samp>.
1464The list of checking options is the same as for <samp>--enable-checking</samp>.
1465If your system is too slow or too small to bootstrap a released compiler
1466with checking for stage1 enabled, you can use &lsquo;<samp>--disable-stage1-checking</samp>&rsquo;
1467to disable checking for the stage1 compiler.
1468</p>
1469</dd>
1470<dt><code>--enable-coverage</code></dt>
1471<dt><code>--enable-coverage=<var>level</var></code></dt>
1472<dd><p>With this option, the compiler is built to collect self coverage
1473information, every time it is run.  This is for internal development
1474purposes, and only works when the compiler is being built with gcc.  The
1475<var>level</var> argument controls whether the compiler is built optimized or
1476not, values are &lsquo;<samp>opt</samp>&rsquo; and &lsquo;<samp>noopt</samp>&rsquo;.  For coverage analysis you
1477want to disable optimization, for performance analysis you want to
1478enable optimization.  When coverage is enabled, the default level is
1479without optimization.
1480</p>
1481</dd>
1482<dt><code>--enable-gather-detailed-mem-stats</code></dt>
1483<dd><p>When this option is specified more detailed information on memory
1484allocation is gathered.  This information is printed when using
1485<samp>-fmem-report</samp>.
1486</p>
1487</dd>
1488<dt><code>--enable-valgrind-annotations</code></dt>
1489<dd><p>Mark selected memory related operations in the compiler when run under
1490valgrind to suppress false positives.
1491</p>
1492</dd>
1493<dt><code>--enable-nls</code></dt>
1494<dt><code>--disable-nls</code></dt>
1495<dd><p>The <samp>--enable-nls</samp> option enables Native Language Support (NLS),
1496which lets GCC output diagnostics in languages other than American
1497English.  Native Language Support is enabled by default if not doing a
1498canadian cross build.  The <samp>--disable-nls</samp> option disables NLS.
1499</p>
1500</dd>
1501<dt><code>--with-included-gettext</code></dt>
1502<dd><p>If NLS is enabled, the <samp>--with-included-gettext</samp> option causes the build
1503procedure to prefer its copy of GNU <code>gettext</code>.
1504</p>
1505</dd>
1506<dt><code>--with-catgets</code></dt>
1507<dd><p>If NLS is enabled, and if the host lacks <code>gettext</code> but has the
1508inferior <code>catgets</code> interface, the GCC build procedure normally
1509ignores <code>catgets</code> and instead uses GCC&rsquo;s copy of the GNU
1510<code>gettext</code> library.  The <samp>--with-catgets</samp> option causes the
1511build procedure to use the host&rsquo;s <code>catgets</code> in this situation.
1512</p>
1513</dd>
1514<dt><code>--with-libiconv-prefix=<var>dir</var></code></dt>
1515<dd><p>Search for libiconv header files in <samp><var>dir</var>/include</samp> and
1516libiconv library files in <samp><var>dir</var>/lib</samp>.
1517</p>
1518</dd>
1519<dt><code>--enable-obsolete</code></dt>
1520<dd><p>Enable configuration for an obsoleted system.  If you attempt to
1521configure GCC for a system (build, host, or target) which has been
1522obsoleted, and you do not specify this flag, configure will halt with an
1523error message.
1524</p>
1525<p>All support for systems which have been obsoleted in one release of GCC
1526is removed entirely in the next major release, unless someone steps
1527forward to maintain the port.
1528</p>
1529</dd>
1530<dt><code>--enable-decimal-float</code></dt>
1531<dt><code>--enable-decimal-float=yes</code></dt>
1532<dt><code>--enable-decimal-float=no</code></dt>
1533<dt><code>--enable-decimal-float=bid</code></dt>
1534<dt><code>--enable-decimal-float=dpd</code></dt>
1535<dt><code>--disable-decimal-float</code></dt>
1536<dd><p>Enable (or disable) support for the C decimal floating point extension
1537that is in the IEEE 754-2008 standard.  This is enabled by default only
1538on PowerPC, i386, and x86_64 GNU/Linux systems.  Other systems may also
1539support it, but require the user to specifically enable it.  You can
1540optionally control which decimal floating point format is used (either
1541&lsquo;<samp>bid</samp>&rsquo; or &lsquo;<samp>dpd</samp>&rsquo;).  The &lsquo;<samp>bid</samp>&rsquo; (binary integer decimal)
1542format is default on i386 and x86_64 systems, and the &lsquo;<samp>dpd</samp>&rsquo;
1543(densely packed decimal) format is default on PowerPC systems.
1544</p>
1545</dd>
1546<dt><code>--enable-fixed-point</code></dt>
1547<dt><code>--disable-fixed-point</code></dt>
1548<dd><p>Enable (or disable) support for C fixed-point arithmetic.
1549This option is enabled by default for some targets (such as MIPS) which
1550have hardware-support for fixed-point operations.  On other targets, you
1551may enable this option manually.
1552</p>
1553</dd>
1554<dt><code>--with-long-double-128</code></dt>
1555<dd><p>Specify if <code>long double</code> type should be 128-bit by default on selected
1556GNU/Linux architectures.  If using <code>--without-long-double-128</code>,
1557<code>long double</code> will be by default 64-bit, the same as <code>double</code> type.
1558When neither of these configure options are used, the default will be
1559128-bit <code>long double</code> when built against GNU C Library 2.4 and later,
156064-bit <code>long double</code> otherwise.
1561</p>
1562</dd>
1563<dt><code>--with-long-double-format=ibm</code></dt>
1564<dt><code>--with-long-double-format=ieee</code></dt>
1565<dd><p>Specify whether <code>long double</code> uses the IBM extended double format
1566or the IEEE 128-bit floating point format on PowerPC Linux systems.
1567This configuration switch will only work on little endian PowerPC
1568Linux systems and on big endian 64-bit systems where the default cpu
1569is at least power7 (i.e. <samp>--with-cpu=power7</samp>,
1570<samp>--with-cpu=power8</samp>, or <samp>--with-cpu=power9</samp> is used).
1571</p>
1572<p>If you use the <samp>--with-long-double-64</samp> configuration option,
1573the <samp>--with-long-double-format=ibm</samp> and
1574<samp>--with-long-double-format=ieee</samp> options are ignored.
1575</p>
1576<p>The default <code>long double</code> format is to use IBM extended double.
1577Until all of the libraries are converted to use IEEE 128-bit floating
1578point, it is not recommended to use
1579<samp>--with-long-double-format=ieee</samp>.
1580</p>
1581<p>On little endian PowerPC Linux systems, if you explicitly set the
1582<code>long double</code> type, it will build multilibs to allow you to
1583select either <code>long double</code> format, unless you disable multilibs
1584with the <code>--disable-multilib</code> option.  At present,
1585<code>long double</code> multilibs are not built on big endian PowerPC Linux
1586systems.  If you are building multilibs, you will need to configure
1587the compiler using the <samp>--with-system-zlib</samp> option.
1588</p>
1589<p>If you do not set the <code>long double</code> type explicitly, no multilibs
1590will be generated.
1591</p>
1592</dd>
1593<dt><code>--enable-fdpic</code></dt>
1594<dd><p>On SH Linux systems, generate ELF FDPIC code.
1595</p>
1596</dd>
1597<dt><code>--with-gmp=<var>pathname</var></code></dt>
1598<dt><code>--with-gmp-include=<var>pathname</var></code></dt>
1599<dt><code>--with-gmp-lib=<var>pathname</var></code></dt>
1600<dt><code>--with-mpfr=<var>pathname</var></code></dt>
1601<dt><code>--with-mpfr-include=<var>pathname</var></code></dt>
1602<dt><code>--with-mpfr-lib=<var>pathname</var></code></dt>
1603<dt><code>--with-mpc=<var>pathname</var></code></dt>
1604<dt><code>--with-mpc-include=<var>pathname</var></code></dt>
1605<dt><code>--with-mpc-lib=<var>pathname</var></code></dt>
1606<dd><p>If you want to build GCC but do not have the GMP library, the MPFR
1607library and/or the MPC library installed in a standard location and
1608do not have their sources present in the GCC source tree then you
1609can explicitly specify the directory where they are installed
1610(&lsquo;<samp>--with-gmp=<var>gmpinstalldir</var></samp>&rsquo;,
1611&lsquo;<samp>--with-mpfr=<var>mpfrinstalldir</var></samp>&rsquo;,
1612&lsquo;<samp>--with-mpc=<var>mpcinstalldir</var></samp>&rsquo;).  The
1613<samp>--with-gmp=<var>gmpinstalldir</var></samp> option is shorthand for
1614<samp>--with-gmp-lib=<var>gmpinstalldir</var>/lib</samp> and
1615<samp>--with-gmp-include=<var>gmpinstalldir</var>/include</samp>.  Likewise the
1616<samp>--with-mpfr=<var>mpfrinstalldir</var></samp> option is shorthand for
1617<samp>--with-mpfr-lib=<var>mpfrinstalldir</var>/lib</samp> and
1618<samp>--with-mpfr-include=<var>mpfrinstalldir</var>/include</samp>, also the
1619<samp>--with-mpc=<var>mpcinstalldir</var></samp> option is shorthand for
1620<samp>--with-mpc-lib=<var>mpcinstalldir</var>/lib</samp> and
1621<samp>--with-mpc-include=<var>mpcinstalldir</var>/include</samp>.  If these
1622shorthand assumptions are not correct, you can use the explicit
1623include and lib options directly.  You might also need to ensure the
1624shared libraries can be found by the dynamic linker when building and
1625using GCC, for example by setting the runtime shared library path
1626variable (<code>LD_LIBRARY_PATH</code> on GNU/Linux and Solaris systems).
1627</p>
1628<p>These flags are applicable to the host platform only.  When building
1629a cross compiler, they will not be used to configure target libraries.
1630</p>
1631</dd>
1632<dt><code>--with-isl=<var>pathname</var></code></dt>
1633<dt><code>--with-isl-include=<var>pathname</var></code></dt>
1634<dt><code>--with-isl-lib=<var>pathname</var></code></dt>
1635<dd><p>If you do not have the isl library installed in a standard location and you
1636want to build GCC, you can explicitly specify the directory where it is
1637installed (&lsquo;<samp>--with-isl=<var>islinstalldir</var></samp>&rsquo;). The
1638<samp>--with-isl=<var>islinstalldir</var></samp> option is shorthand for
1639<samp>--with-isl-lib=<var>islinstalldir</var>/lib</samp> and
1640<samp>--with-isl-include=<var>islinstalldir</var>/include</samp>. If this
1641shorthand assumption is not correct, you can use the explicit
1642include and lib options directly.
1643</p>
1644<p>These flags are applicable to the host platform only.  When building
1645a cross compiler, they will not be used to configure target libraries.
1646</p>
1647</dd>
1648<dt><code>--with-stage1-ldflags=<var>flags</var></code></dt>
1649<dd><p>This option may be used to set linker flags to be used when linking
1650stage 1 of GCC.  These are also used when linking GCC if configured with
1651<samp>--disable-bootstrap</samp>.  If <samp>--with-stage1-libs</samp> is not set to a
1652value, then the default is &lsquo;<samp>-static-libstdc++ -static-libgcc</samp>&rsquo;, if
1653supported.
1654</p>
1655</dd>
1656<dt><code>--with-stage1-libs=<var>libs</var></code></dt>
1657<dd><p>This option may be used to set libraries to be used when linking stage 1
1658of GCC.  These are also used when linking GCC if configured with
1659<samp>--disable-bootstrap</samp>.
1660</p>
1661</dd>
1662<dt><code>--with-boot-ldflags=<var>flags</var></code></dt>
1663<dd><p>This option may be used to set linker flags to be used when linking
1664stage 2 and later when bootstrapping GCC.  If &ndash;with-boot-libs
1665is not is set to a value, then the default is
1666&lsquo;<samp>-static-libstdc++ -static-libgcc</samp>&rsquo;.
1667</p>
1668</dd>
1669<dt><code>--with-boot-libs=<var>libs</var></code></dt>
1670<dd><p>This option may be used to set libraries to be used when linking stage 2
1671and later when bootstrapping GCC.
1672</p>
1673</dd>
1674<dt><code>--with-debug-prefix-map=<var>map</var></code></dt>
1675<dd><p>Convert source directory names using <samp>-fdebug-prefix-map</samp> when
1676building runtime libraries.  &lsquo;<samp><var>map</var></samp>&rsquo; is a space-separated
1677list of maps of the form &lsquo;<samp><var>old</var>=<var>new</var></samp>&rsquo;.
1678</p>
1679</dd>
1680<dt><code>--enable-linker-build-id</code></dt>
1681<dd><p>Tells GCC to pass <samp>--build-id</samp> option to the linker for all final
1682links (links performed without the <samp>-r</samp> or <samp>--relocatable</samp>
1683option), if the linker supports it.  If you specify
1684<samp>--enable-linker-build-id</samp>, but your linker does not
1685support <samp>--build-id</samp> option, a warning is issued and the
1686<samp>--enable-linker-build-id</samp> option is ignored.  The default is off.
1687</p>
1688</dd>
1689<dt><code>--with-linker-hash-style=<var>choice</var></code></dt>
1690<dd><p>Tells GCC to pass <samp>--hash-style=<var>choice</var></samp> option to the
1691linker for all final links. <var>choice</var> can be one of
1692&lsquo;<samp>sysv</samp>&rsquo;, &lsquo;<samp>gnu</samp>&rsquo;, and &lsquo;<samp>both</samp>&rsquo; where &lsquo;<samp>sysv</samp>&rsquo; is the default.
1693</p>
1694</dd>
1695<dt><code>--enable-gnu-unique-object</code></dt>
1696<dt><code>--disable-gnu-unique-object</code></dt>
1697<dd><p>Tells GCC to use the gnu_unique_object relocation for C++ template
1698static data members and inline function local statics.  Enabled by
1699default for a toolchain with an assembler that accepts it and
1700GLIBC 2.11 or above, otherwise disabled.
1701</p>
1702</dd>
1703<dt><code>--with-diagnostics-color=<var>choice</var></code></dt>
1704<dd><p>Tells GCC to use <var>choice</var> as the default for <samp>-fdiagnostics-color=</samp>
1705option (if not used explicitly on the command line).  <var>choice</var>
1706can be one of &lsquo;<samp>never</samp>&rsquo;, &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>always</samp>&rsquo;, and &lsquo;<samp>auto-if-env</samp>&rsquo;
1707where &lsquo;<samp>auto</samp>&rsquo; is the default.  &lsquo;<samp>auto-if-env</samp>&rsquo; makes
1708<samp>-fdiagnostics-color=auto</samp> the default if <code>GCC_COLORS</code>
1709is present and non-empty in the environment of the compiler, and
1710<samp>-fdiagnostics-color=never</samp> otherwise.
1711</p>
1712</dd>
1713<dt><code>--with-diagnostics-urls=<var>choice</var></code></dt>
1714<dd><p>Tells GCC to use <var>choice</var> as the default for <samp>-fdiagnostics-urls=</samp>
1715option (if not used explicitly on the command line).  <var>choice</var>
1716can be one of &lsquo;<samp>never</samp>&rsquo;, &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>always</samp>&rsquo;, and &lsquo;<samp>auto-if-env</samp>&rsquo;
1717where &lsquo;<samp>auto</samp>&rsquo; is the default.  &lsquo;<samp>auto-if-env</samp>&rsquo; makes
1718<samp>-fdiagnostics-urls=auto</samp> the default if <code>GCC_URLS</code>
1719or <code>TERM_URLS</code> is present and non-empty in the environment of the
1720compiler, and <samp>-fdiagnostics-urls=never</samp> otherwise.
1721</p>
1722</dd>
1723<dt><code>--enable-lto</code></dt>
1724<dt><code>--disable-lto</code></dt>
1725<dd><p>Enable support for link-time optimization (LTO).  This is enabled by
1726default, and may be disabled using <samp>--disable-lto</samp>.
1727</p>
1728</dd>
1729<dt><code>--enable-linker-plugin-configure-flags=FLAGS</code></dt>
1730<dt><code>--enable-linker-plugin-flags=FLAGS</code></dt>
1731<dd><p>By default, linker plugins (such as the LTO plugin) are built for the
1732host system architecture.  For the case that the linker has a
1733different (but run-time compatible) architecture, these flags can be
1734specified to build plugins that are compatible to the linker.  For
1735example, if you are building GCC for a 64-bit x86_64
1736(&lsquo;<samp>x86_64-pc-linux-gnu</samp>&rsquo;) host system, but have a 32-bit x86
1737GNU/Linux (&lsquo;<samp>i686-pc-linux-gnu</samp>&rsquo;) linker executable (which is
1738executable on the former system), you can configure GCC as follows for
1739getting compatible linker plugins:
1740</p>
1741<div class="smallexample">
1742<pre class="smallexample">% <var>srcdir</var>/configure \
1743    --host=x86_64-pc-linux-gnu \
1744    --enable-linker-plugin-configure-flags=--host=i686-pc-linux-gnu \
1745    --enable-linker-plugin-flags='CC=gcc\ -m32\ -Wl,-rpath,[...]/i686-pc-linux-gnu/lib'
1746</pre></div>
1747
1748</dd>
1749<dt><code>--with-plugin-ld=<var>pathname</var></code></dt>
1750<dd><p>Enable an alternate linker to be used at link-time optimization (LTO)
1751link time when <samp>-fuse-linker-plugin</samp> is enabled.
1752This linker should have plugin support such as gold starting with
1753version 2.20 or GNU ld starting with version 2.21.
1754See <samp>-fuse-linker-plugin</samp> for details.
1755</p>
1756</dd>
1757<dt><code>--enable-canonical-system-headers</code></dt>
1758<dt><code>--disable-canonical-system-headers</code></dt>
1759<dd><p>Enable system header path canonicalization for <samp>libcpp</samp>.  This can
1760produce shorter header file paths in diagnostics and dependency output
1761files, but these changed header paths may conflict with some compilation
1762environments.  Enabled by default, and may be disabled using
1763<samp>--disable-canonical-system-headers</samp>.
1764</p>
1765</dd>
1766<dt><code>--with-glibc-version=<var>major</var>.<var>minor</var></code></dt>
1767<dd><p>Tell GCC that when the GNU C Library (glibc) is used on the target it
1768will be version <var>major</var>.<var>minor</var> or later.  Normally this can
1769be detected from the C library&rsquo;s header files, but this option may be
1770needed when bootstrapping a cross toolchain without the header files
1771available for building the initial bootstrap compiler.
1772</p>
1773<p>If GCC is configured with some multilibs that use glibc and some that
1774do not, this option applies only to the multilibs that use glibc.
1775However, such configurations may not work well as not all the relevant
1776configuration in GCC is on a per-multilib basis.
1777</p>
1778</dd>
1779<dt><code>--enable-as-accelerator-for=<var>target</var></code></dt>
1780<dd><p>Build as offload target compiler. Specify offload host triple by <var>target</var>.
1781</p>
1782</dd>
1783<dt><code>--enable-offload-targets=<var>target1</var>[=<var>path1</var>],&hellip;,<var>targetN</var>[=<var>pathN</var>]</code></dt>
1784<dd><p>Enable offloading to targets <var>target1</var>, &hellip;, <var>targetN</var>.
1785Offload compilers are expected to be already installed.  Default search
1786path for them is <samp><var>exec-prefix</var></samp>, but it can be changed by
1787specifying paths <var>path1</var>, &hellip;, <var>pathN</var>.
1788</p>
1789<div class="smallexample">
1790<pre class="smallexample">% <var>srcdir</var>/configure \
1791    --enable-offload-targets=x86_64-intelmicemul-linux-gnu=/path/to/x86_64/compiler,nvptx-none,hsa
1792</pre></div>
1793
1794<p>If &lsquo;<samp>hsa</samp>&rsquo; is specified as one of the targets, the compiler will be
1795built with support for HSA GPU accelerators.  Because the same
1796compiler will emit the accelerator code, no path should be specified.
1797</p>
1798</dd>
1799<dt><code>--with-hsa-runtime=<var>pathname</var></code></dt>
1800<dt><code>--with-hsa-runtime-include=<var>pathname</var></code></dt>
1801<dt><code>--with-hsa-runtime-lib=<var>pathname</var></code></dt>
1802<dd>
1803<p>If you configure GCC with HSA offloading but do not have the HSA
1804run-time library installed in a standard location then you can
1805explicitly specify the directory where they are installed.  The
1806<samp>--with-hsa-runtime=<var>hsainstalldir</var></samp> option is a
1807shorthand for
1808<samp>--with-hsa-runtime-lib=<var>hsainstalldir</var>/lib</samp> and
1809<samp>--with-hsa-runtime-include=<var>hsainstalldir</var>/include</samp>.
1810</p>
1811</dd>
1812<dt><code>--enable-cet</code></dt>
1813<dt><code>--disable-cet</code></dt>
1814<dd><p>Enable building target run-time libraries with control-flow
1815instrumentation, see <samp>-fcf-protection</samp> option.  When
1816<code>--enable-cet</code> is specified target libraries are configured
1817to add <samp>-fcf-protection</samp> and, if needed, other target
1818specific options to a set of building options.
1819</p>
1820<p>The option is disabled by default.  When <code>--enable-cet=auto</code>
1821is used, it is enabled on Linux/x86 if target binutils
1822supports <code>Intel CET</code> instructions and disabled otherwise.
1823In this case the target libraries are configured to get additional
1824<samp>-fcf-protection</samp> option.
1825</p>
1826</dd>
1827<dt><code>--with-riscv-attribute=&lsquo;<samp>yes</samp>&rsquo;, &lsquo;<samp>no</samp>&rsquo; or &lsquo;<samp>default</samp>&rsquo;</code></dt>
1828<dd><p>Generate RISC-V attribute by default, in order to record extra build
1829information in object.
1830</p>
1831<p>The option is disabled by default. It is enabled on RISC-V/ELF (bare-metal)
1832target if target binutils supported.
1833</p></dd>
1834</dl>
1835
1836<a name="Cross-Compiler-Specific-Options"></a>
1837<h4 class="subheading">Cross-Compiler-Specific Options</h4>
1838<p>The following options only apply to building cross compilers.
1839</p>
1840<dl compact="compact">
1841<dt><code>--with-toolexeclibdir=<var>dir</var></code></dt>
1842<dd><p>Specify the installation directory for libraries built with a cross compiler.
1843The default is <samp>${gcc_tooldir}/lib</samp>.
1844</p>
1845</dd>
1846<dt><code>--with-sysroot</code></dt>
1847<dt><code>--with-sysroot=<var>dir</var></code></dt>
1848<dd><p>Tells GCC to consider <var>dir</var> as the root of a tree that contains
1849(a subset of) the root filesystem of the target operating system.
1850Target system headers, libraries and run-time object files will be
1851searched for in there.  More specifically, this acts as if
1852<samp>--sysroot=<var>dir</var></samp> was added to the default options of the built
1853compiler.  The specified directory is not copied into the
1854install tree, unlike the options <samp>--with-headers</samp> and
1855<samp>--with-libs</samp> that this option obsoletes.  The default value,
1856in case <samp>--with-sysroot</samp> is not given an argument, is
1857<samp>${gcc_tooldir}/sys-root</samp>.  If the specified directory is a
1858subdirectory of <samp>${exec_prefix}</samp>, then it will be found relative to
1859the GCC binaries if the installation tree is moved.
1860</p>
1861<p>This option affects the system root for the compiler used to build
1862target libraries (which runs on the build system) and the compiler newly
1863installed with <code>make install</code>; it does not affect the compiler which is
1864used to build GCC itself.
1865</p>
1866<p>If you specify the <samp>--with-native-system-header-dir=<var>dirname</var></samp>
1867option then the compiler will search that directory within <var>dirname</var> for
1868native system headers rather than the default <samp>/usr/include</samp>.
1869</p>
1870</dd>
1871<dt><code>--with-build-sysroot</code></dt>
1872<dt><code>--with-build-sysroot=<var>dir</var></code></dt>
1873<dd><p>Tells GCC to consider <var>dir</var> as the system root (see
1874<samp>--with-sysroot</samp>) while building target libraries, instead of
1875the directory specified with <samp>--with-sysroot</samp>.  This option is
1876only useful when you are already using <samp>--with-sysroot</samp>.  You
1877can use <samp>--with-build-sysroot</samp> when you are configuring with
1878<samp>--prefix</samp> set to a directory that is different from the one in
1879which you are installing GCC and your target libraries.
1880</p>
1881<p>This option affects the system root for the compiler used to build
1882target libraries (which runs on the build system); it does not affect
1883the compiler which is used to build GCC itself.
1884</p>
1885<p>If you specify the <samp>--with-native-system-header-dir=<var>dirname</var></samp>
1886option then the compiler will search that directory within <var>dirname</var> for
1887native system headers rather than the default <samp>/usr/include</samp>.
1888</p>
1889</dd>
1890<dt><code>--with-headers</code></dt>
1891<dt><code>--with-headers=<var>dir</var></code></dt>
1892<dd><p>Deprecated in favor of <samp>--with-sysroot</samp>.
1893Specifies that target headers are available when building a cross compiler.
1894The <var>dir</var> argument specifies a directory which has the target include
1895files.  These include files will be copied into the <samp>gcc</samp> install
1896directory.  <em>This option with the <var>dir</var> argument is required</em> when
1897building a cross compiler, if <samp><var>prefix</var>/<var>target</var>/sys-include</samp>
1898doesn&rsquo;t pre-exist.  If <samp><var>prefix</var>/<var>target</var>/sys-include</samp> does
1899pre-exist, the <var>dir</var> argument may be omitted.  <code>fixincludes</code>
1900will be run on these files to make them compatible with GCC.
1901</p>
1902</dd>
1903<dt><code>--without-headers</code></dt>
1904<dd><p>Tells GCC not use any target headers from a libc when building a cross
1905compiler.  When crossing to GNU/Linux, you need the headers so GCC
1906can build the exception handling for libgcc.
1907</p>
1908</dd>
1909<dt><code>--with-libs</code></dt>
1910<dt><code>--with-libs=&quot;<var>dir1</var> <var>dir2</var> &hellip; <var>dirN</var>&quot;</code></dt>
1911<dd><p>Deprecated in favor of <samp>--with-sysroot</samp>.
1912Specifies a list of directories which contain the target runtime
1913libraries.  These libraries will be copied into the <samp>gcc</samp> install
1914directory.  If the directory list is omitted, this option has no
1915effect.
1916</p>
1917</dd>
1918<dt><code>--with-newlib</code></dt>
1919<dd><p>Specifies that &lsquo;<samp>newlib</samp>&rsquo; is
1920being used as the target C library.  This causes <code>__eprintf</code> to be
1921omitted from <samp>libgcc.a</samp> on the assumption that it will be provided by
1922&lsquo;<samp>newlib</samp>&rsquo;.
1923</p>
1924<a name="avr"></a>
1925</dd>
1926<dt><code>--with-avrlibc</code></dt>
1927<dd><p>Only supported for the AVR target. Specifies that &lsquo;<samp>AVR-Libc</samp>&rsquo; is
1928being used as the target C&nbsp; library.  This causes float support
1929functions like <code>__addsf3</code> to be omitted from <samp>libgcc.a</samp> on
1930the assumption that it will be provided by <samp>libm.a</samp>.  For more
1931technical details, cf. <a href="http://gcc.gnu.org/PR54461">PR54461</a>.
1932It is not supported for
1933RTEMS configurations, which currently use newlib.  The option is
1934supported since version 4.7.2 and is the default in 4.8.0 and newer.
1935</p>
1936</dd>
1937<dt><code>--with-double={32|64|32,64|64,32}</code></dt>
1938<dt><code>--with-long-double={32|64|32,64|64,32|double}</code></dt>
1939<dd><p>Only supported for the AVR target since version&nbsp;10.
1940Specify the default layout available for the C/C++ &lsquo;<samp>double</samp>&rsquo;
1941and &lsquo;<samp>long double</samp>&rsquo; type, respectively. The following rules apply:
1942</p><ul>
1943<li> The first value after the &lsquo;<samp>=</samp>&rsquo; specifies the default layout (in bits)
1944of the type and also the default for the <samp>-mdouble=</samp> resp.
1945<samp>-mlong-double=</samp> compiler option.
1946</li><li> If more than one value is specified, respective multilib variants are
1947available, and  <samp>-mdouble=</samp> resp. <samp>-mlong-double=</samp> acts
1948as a multilib option.
1949</li><li> If <samp>--with-long-double=double</samp> is specified, &lsquo;<samp>double</samp>&rsquo; and
1950&lsquo;<samp>long double</samp>&rsquo; will have the same layout.
1951</li><li> The defaults are <samp>--with-long-double=64,32</samp> and
1952<samp>--with-double=32,64</samp>.  The default &lsquo;<samp>double</samp>&rsquo; layout imposed by
1953the latter is compatible with older versions of the compiler that implement
1954&lsquo;<samp>double</samp>&rsquo; as a 32-bit type, which does not comply to the language standard.
1955</li></ul>
1956<p>Not all combinations of <samp>--with-double=</samp> and
1957<samp>--with-long-double=</samp> are valid.  For example, the combination
1958<samp>--with-double=32,64</samp> <samp>--with-long-double=32</samp> will be
1959rejected because the first option specifies the availability of
1960multilibs for &lsquo;<samp>double</samp>&rsquo;, whereas the second option implies
1961that &lsquo;<samp>long double</samp>&rsquo; &mdash; and hence also &lsquo;<samp>double</samp>&rsquo; &mdash; is always
196232&nbsp;bits wide.
1963</p>
1964</dd>
1965<dt><code>--with-double-comparison={tristate|bool|libf7}</code></dt>
1966<dd><p>Only supported for the AVR target since version&nbsp;10.
1967Specify what result format is returned by library functions that
1968compare 64-bit floating point values (<code>DFmode</code>).
1969The GCC default is &lsquo;<samp>tristate</samp>&rsquo;.  If the floating point
1970implementation returns a boolean instead, set it to &lsquo;<samp>bool</samp>&rsquo;.
1971</p>
1972</dd>
1973<dt><code>--with-libf7={libgcc|math|math-symbols|no}</code></dt>
1974<dd><p>Only supported for the AVR target since version&nbsp;10.
1975Specify to which degree code from LibF7 is included in libgcc.
1976LibF7 is an ad-hoc, AVR-specific, 64-bit floating point emulation
1977written in C and (inline) assembly. &lsquo;<samp>libgcc</samp>&rsquo; adds support
1978for functions that one would usually expect in libgcc like double addition,
1979double comparisons and double conversions. &lsquo;<samp>math</samp>&rsquo; also adds routines
1980that one would expect in <samp>libm.a</samp>, but with <code>__</code> (two underscores)
1981prepended to the symbol names as specified by <samp>math.h</samp>.
1982&lsquo;<samp>math-symbols</samp>&rsquo; also defines weak aliases for the functions
1983declared in <samp>math.h</samp>.  However, <code>--with-libf7</code> won&rsquo;t
1984install no <samp>math.h</samp> header file whatsoever, this file must come
1985from elsewhere.  This option sets <samp>--with-double-comparison</samp>
1986to &lsquo;<samp>bool</samp>&rsquo;.
1987</p>
1988</dd>
1989<dt><code>--with-nds32-lib=<var>library</var></code></dt>
1990<dd><p>Specifies that <var>library</var> setting is used for building <samp>libgcc.a</samp>.
1991Currently, the valid <var>library</var> is &lsquo;<samp>newlib</samp>&rsquo; or &lsquo;<samp>mculib</samp>&rsquo;.
1992This option is only supported for the NDS32 target.
1993</p>
1994</dd>
1995<dt><code>--with-build-time-tools=<var>dir</var></code></dt>
1996<dd><p>Specifies where to find the set of target tools (assembler, linker, etc.)
1997that will be used while building GCC itself.  This option can be useful
1998if the directory layouts are different between the system you are building
1999GCC on, and the system where you will deploy it.
2000</p>
2001<p>For example, on an &lsquo;<samp>ia64-hp-hpux</samp>&rsquo; system, you may have the GNU
2002assembler and linker in <samp>/usr/bin</samp>, and the native tools in a
2003different path, and build a toolchain that expects to find the
2004native tools in <samp>/usr/bin</samp>.
2005</p>
2006<p>When you use this option, you should ensure that <var>dir</var> includes
2007<code>ar</code>, <code>as</code>, <code>ld</code>, <code>nm</code>,
2008<code>ranlib</code> and <code>strip</code> if necessary, and possibly
2009<code>objdump</code>.  Otherwise, GCC may use an inconsistent set of
2010tools.
2011</p></dd>
2012</dl>
2013
2014<a name="Overriding-configure-test-results"></a>
2015<h4 class="subsubheading">Overriding <code>configure</code> test results</h4>
2016
2017<p>Sometimes, it might be necessary to override the result of some
2018<code>configure</code> test, for example in order to ease porting to a new
2019system or work around a bug in a test.  The toplevel <code>configure</code>
2020script provides three variables for this:
2021</p>
2022<dl compact="compact">
2023<dt><code>build_configargs</code></dt>
2024<dd><a name="index-build_005fconfigargs"></a>
2025<p>The contents of this variable is passed to all build <code>configure</code>
2026scripts.
2027</p>
2028</dd>
2029<dt><code>host_configargs</code></dt>
2030<dd><a name="index-host_005fconfigargs"></a>
2031<p>The contents of this variable is passed to all host <code>configure</code>
2032scripts.
2033</p>
2034</dd>
2035<dt><code>target_configargs</code></dt>
2036<dd><a name="index-target_005fconfigargs"></a>
2037<p>The contents of this variable is passed to all target <code>configure</code>
2038scripts.
2039</p>
2040</dd>
2041</dl>
2042
2043<p>In order to avoid shell and <code>make</code> quoting issues for complex
2044overrides, you can pass a setting for <code>CONFIG_SITE</code> and set
2045variables in the site file.
2046</p>
2047<a name="Objective-C-Specific-Options"></a>
2048<h4 class="subheading">Objective-C-Specific Options</h4>
2049
2050<p>The following options apply to the build of the Objective-C runtime library.
2051</p>
2052<dl compact="compact">
2053<dt><code>--enable-objc-gc</code></dt>
2054<dd><p>Specify that an additional variant of the GNU Objective-C runtime library
2055is built, using an external build of the Boehm-Demers-Weiser garbage
2056collector (<a href="https://www.hboehm.info/gc/">https://www.hboehm.info/gc/</a>).  This library needs to be
2057available for each multilib variant, unless configured with
2058<samp>--enable-objc-gc=&lsquo;<samp>auto</samp>&rsquo;</samp> in which case the build of the
2059additional runtime library is skipped when not available and the build
2060continues.
2061</p>
2062</dd>
2063<dt><code>--with-target-bdw-gc=<var>list</var></code></dt>
2064<dt><code>--with-target-bdw-gc-include=<var>list</var></code></dt>
2065<dt><code>--with-target-bdw-gc-lib=<var>list</var></code></dt>
2066<dd><p>Specify search directories for the garbage collector header files and
2067libraries. <var>list</var> is a comma separated list of key value pairs of the
2068form &lsquo;<samp><var>multilibdir</var>=<var>path</var></samp>&rsquo;, where the default multilib key
2069is named as &lsquo;<samp>.</samp>&rsquo; (dot), or is omitted (e.g.
2070&lsquo;<samp>--with-target-bdw-gc=/opt/bdw-gc,32=/opt-bdw-gc32</samp>&rsquo;).
2071</p>
2072<p>The options <samp>--with-target-bdw-gc-include</samp> and
2073<samp>--with-target-bdw-gc-lib</samp> must always be specified together
2074for each multilib variant and they take precedence over
2075<samp>--with-target-bdw-gc</samp>.  If <samp>--with-target-bdw-gc-include</samp>
2076is missing values for a multilib, then the value for the default
2077multilib is used (e.g. &lsquo;<samp>--with-target-bdw-gc-include=/opt/bdw-gc/include</samp>&rsquo;
2078&lsquo;<samp>--with-target-bdw-gc-lib=/opt/bdw-gc/lib64,32=/opt-bdw-gc/lib32</samp>&rsquo;).
2079If none of these options are specified, the library is assumed in
2080default locations.
2081</p></dd>
2082</dl>
2083
2084<a name="D-Specific-Options"></a>
2085<h4 class="subheading">D-Specific Options</h4>
2086
2087<p>The following options apply to the build of the D runtime library.
2088</p>
2089<dl compact="compact">
2090<dt><code>--enable-libphobos-checking</code></dt>
2091<dt><code>--disable-libphobos-checking</code></dt>
2092<dt><code>--enable-libphobos-checking=<var>list</var></code></dt>
2093<dd><p>This option controls whether run-time checks and contracts are compiled into
2094the D runtime library.  When the option is not specified, the library is built
2095with &lsquo;<samp>release</samp>&rsquo; checking.  When the option is specified without a
2096<var>list</var>, the result is the same as &lsquo;<samp>--enable-libphobos-checking=yes</samp>&rsquo;.
2097Likewise, &lsquo;<samp>--disable-libphobos-checking</samp>&rsquo; is equivalent to
2098&lsquo;<samp>--enable-libphobos-checking=no</samp>&rsquo;.
2099</p>
2100<p>The categories of checks available in <var>list</var> are &lsquo;<samp>yes</samp>&rsquo; (compiles
2101libphobos with <samp>-fno-release</samp>), &lsquo;<samp>no</samp>&rsquo; (compiles libphobos with
2102<samp>-frelease</samp>), &lsquo;<samp>all</samp>&rsquo; (same as &lsquo;<samp>yes</samp>&rsquo;), &lsquo;<samp>none</samp>&rsquo; or
2103&lsquo;<samp>release</samp>&rsquo; (same as &lsquo;<samp>no</samp>&rsquo;).
2104</p>
2105<p>Individual checks available in <var>list</var> are &lsquo;<samp>assert</samp>&rsquo; (compiles libphobos
2106with an extra option <samp>-fassert</samp>).
2107</p>
2108</dd>
2109<dt><code>--with-libphobos-druntime-only</code></dt>
2110<dt><code>--with-libphobos-druntime-only=<var>choice</var></code></dt>
2111<dd><p>Specify whether to build only the core D runtime library (druntime), or both
2112the core and standard library (phobos) into libphobos.  This is useful for
2113targets that have full support in druntime, but no or incomplete support
2114in phobos.  <var>choice</var> can be one of &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>yes</samp>&rsquo;, and &lsquo;<samp>no</samp>&rsquo;
2115where &lsquo;<samp>auto</samp>&rsquo; is the default.
2116</p>
2117<p>When the option is not specified, the default choice &lsquo;<samp>auto</samp>&rsquo; means that it
2118is inferred whether the target has support for the phobos standard library.
2119When the option is specified without a <var>choice</var>,  the result is the same as
2120&lsquo;<samp>--with-libphobos-druntime-only=yes</samp>&rsquo;.
2121</p>
2122</dd>
2123<dt><code>--with-target-system-zlib</code></dt>
2124<dd><p>Use installed &lsquo;<samp>zlib</samp>&rsquo; rather than that included with GCC.  This needs
2125to be available for each multilib variant, unless configured with
2126<samp>--with-target-system-zlib=&lsquo;<samp>auto</samp>&rsquo;</samp> in which case the GCC&nbsp;included
2127&lsquo;<samp>zlib</samp>&rsquo; is only used when the system installed library is not available.
2128</p></dd>
2129</dl>
2130
2131<hr />
2132<p>
2133<p><a href="./index.html">Return to the GCC Installation page</a>
2134</p>
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146</body>
2147</html>
2148