You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2148 lines
101KB

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