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