ARM-Options.html 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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-2017 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 the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU 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 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>Using the GNU Compiler Collection (GCC): ARM Options</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): ARM Options">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): ARM Options">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Submodel-Options.html#Submodel-Options" rel="up" title="Submodel Options">
  30. <link href="AVR-Options.html#AVR-Options" rel="next" title="AVR Options">
  31. <link href="ARC-Options.html#ARC-Options" rel="prev" title="ARC Options">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="ARM-Options"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="AVR-Options.html#AVR-Options" accesskey="n" rel="next">AVR Options</a>, Previous: <a href="ARC-Options.html#ARC-Options" accesskey="p" rel="prev">ARC Options</a>, Up: <a href="Submodel-Options.html#Submodel-Options" accesskey="u" rel="up">Submodel Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="ARM-Options-1"></a>
  69. <h4 class="subsection">3.18.4 ARM Options</h4>
  70. <a name="index-ARM-options"></a>
  71. <p>These &lsquo;<samp>-m</samp>&rsquo; options are defined for the ARM port:
  72. </p>
  73. <dl compact="compact">
  74. <dt><code>-mabi=<var>name</var></code></dt>
  75. <dd><a name="index-mabi-1"></a>
  76. <p>Generate code for the specified ABI. Permissible values are: &lsquo;<samp>apcs-gnu</samp>&rsquo;,
  77. &lsquo;<samp>atpcs</samp>&rsquo;, &lsquo;<samp>aapcs</samp>&rsquo;, &lsquo;<samp>aapcs-linux</samp>&rsquo; and &lsquo;<samp>iwmmxt</samp>&rsquo;.
  78. </p>
  79. </dd>
  80. <dt><code>-mapcs-frame</code></dt>
  81. <dd><a name="index-mapcs_002dframe"></a>
  82. <p>Generate a stack frame that is compliant with the ARM Procedure Call
  83. Standard for all functions, even if this is not strictly necessary for
  84. correct execution of the code. Specifying <samp>-fomit-frame-pointer</samp>
  85. with this option causes the stack frames not to be generated for
  86. leaf functions. The default is <samp>-mno-apcs-frame</samp>.
  87. This option is deprecated.
  88. </p>
  89. </dd>
  90. <dt><code>-mapcs</code></dt>
  91. <dd><a name="index-mapcs"></a>
  92. <p>This is a synonym for <samp>-mapcs-frame</samp> and is deprecated.
  93. </p>
  94. </dd>
  95. <dt><code>-mthumb-interwork</code></dt>
  96. <dd><a name="index-mthumb_002dinterwork"></a>
  97. <p>Generate code that supports calling between the ARM and Thumb
  98. instruction sets. Without this option, on pre-v5 architectures, the
  99. two instruction sets cannot be reliably used inside one program. The
  100. default is <samp>-mno-thumb-interwork</samp>, since slightly larger code
  101. is generated when <samp>-mthumb-interwork</samp> is specified. In AAPCS
  102. configurations this option is meaningless.
  103. </p>
  104. </dd>
  105. <dt><code>-mno-sched-prolog</code></dt>
  106. <dd><a name="index-mno_002dsched_002dprolog"></a>
  107. <p>Prevent the reordering of instructions in the function prologue, or the
  108. merging of those instruction with the instructions in the function&rsquo;s
  109. body. This means that all functions start with a recognizable set
  110. of instructions (or in fact one of a choice from a small set of
  111. different function prologues), and this information can be used to
  112. locate the start of functions inside an executable piece of code. The
  113. default is <samp>-msched-prolog</samp>.
  114. </p>
  115. </dd>
  116. <dt><code>-mfloat-abi=<var>name</var></code></dt>
  117. <dd><a name="index-mfloat_002dabi"></a>
  118. <p>Specifies which floating-point ABI to use. Permissible values
  119. are: &lsquo;<samp>soft</samp>&rsquo;, &lsquo;<samp>softfp</samp>&rsquo; and &lsquo;<samp>hard</samp>&rsquo;.
  120. </p>
  121. <p>Specifying &lsquo;<samp>soft</samp>&rsquo; causes GCC to generate output containing
  122. library calls for floating-point operations.
  123. &lsquo;<samp>softfp</samp>&rsquo; allows the generation of code using hardware floating-point
  124. instructions, but still uses the soft-float calling conventions.
  125. &lsquo;<samp>hard</samp>&rsquo; allows generation of floating-point instructions
  126. and uses FPU-specific calling conventions.
  127. </p>
  128. <p>The default depends on the specific target configuration. Note that
  129. the hard-float and soft-float ABIs are not link-compatible; you must
  130. compile your entire program with the same ABI, and link with a
  131. compatible set of libraries.
  132. </p>
  133. </dd>
  134. <dt><code>-mlittle-endian</code></dt>
  135. <dd><a name="index-mlittle_002dendian-2"></a>
  136. <p>Generate code for a processor running in little-endian mode. This is
  137. the default for all standard configurations.
  138. </p>
  139. </dd>
  140. <dt><code>-mbig-endian</code></dt>
  141. <dd><a name="index-mbig_002dendian-2"></a>
  142. <p>Generate code for a processor running in big-endian mode; the default is
  143. to compile code for a little-endian processor.
  144. </p>
  145. </dd>
  146. <dt><code>-march=<var>name</var></code></dt>
  147. <dd><a name="index-march-1"></a>
  148. <p>This specifies the name of the target ARM architecture. GCC uses this
  149. name to determine what kind of instructions it can emit when generating
  150. assembly code. This option can be used in conjunction with or instead
  151. of the <samp>-mcpu=</samp> option. Permissible names are: &lsquo;<samp>armv2</samp>&rsquo;,
  152. &lsquo;<samp>armv2a</samp>&rsquo;, &lsquo;<samp>armv3</samp>&rsquo;, &lsquo;<samp>armv3m</samp>&rsquo;, &lsquo;<samp>armv4</samp>&rsquo;, &lsquo;<samp>armv4t</samp>&rsquo;,
  153. &lsquo;<samp>armv5</samp>&rsquo;, &lsquo;<samp>armv5e</samp>&rsquo;, &lsquo;<samp>armv5t</samp>&rsquo;, &lsquo;<samp>armv5te</samp>&rsquo;,
  154. &lsquo;<samp>armv6</samp>&rsquo;, &lsquo;<samp>armv6-m</samp>&rsquo;, &lsquo;<samp>armv6j</samp>&rsquo;, &lsquo;<samp>armv6k</samp>&rsquo;,
  155. &lsquo;<samp>armv6kz</samp>&rsquo;, &lsquo;<samp>armv6s-m</samp>&rsquo;,
  156. &lsquo;<samp>armv6t2</samp>&rsquo;, &lsquo;<samp>armv6z</samp>&rsquo;, &lsquo;<samp>armv6zk</samp>&rsquo;,
  157. &lsquo;<samp>armv7</samp>&rsquo;, &lsquo;<samp>armv7-a</samp>&rsquo;, &lsquo;<samp>armv7-m</samp>&rsquo;, &lsquo;<samp>armv7-r</samp>&rsquo;, &lsquo;<samp>armv7e-m</samp>&rsquo;,
  158. &lsquo;<samp>armv7ve</samp>&rsquo;, &lsquo;<samp>armv8-a</samp>&rsquo;, &lsquo;<samp>armv8-a+crc</samp>&rsquo;, &lsquo;<samp>armv8.1-a</samp>&rsquo;,
  159. &lsquo;<samp>armv8.1-a+crc</samp>&rsquo;, &lsquo;<samp>armv8-m.base</samp>&rsquo;, &lsquo;<samp>armv8-m.main</samp>&rsquo;,
  160. &lsquo;<samp>armv8-m.main+dsp</samp>&rsquo;, &lsquo;<samp>iwmmxt</samp>&rsquo;, &lsquo;<samp>iwmmxt2</samp>&rsquo;.
  161. </p>
  162. <p>Architecture revisions older than &lsquo;<samp>armv4t</samp>&rsquo; are deprecated.
  163. </p>
  164. <p><samp>-march=armv6s-m</samp> is the &lsquo;<samp>armv6-m</samp>&rsquo; architecture with support for
  165. the (now mandatory) SVC instruction.
  166. </p>
  167. <p><samp>-march=armv6zk</samp> is an alias for &lsquo;<samp>armv6kz</samp>&rsquo;, existing for backwards
  168. compatibility.
  169. </p>
  170. <p><samp>-march=armv7ve</samp> is the &lsquo;<samp>armv7-a</samp>&rsquo; architecture with virtualization
  171. extensions.
  172. </p>
  173. <p><samp>-march=armv8-a+crc</samp> enables code generation for the ARMv8-A
  174. architecture together with the optional CRC32 extensions.
  175. </p>
  176. <p><samp>-march=armv8.1-a</samp> enables compiler support for the ARMv8.1-A
  177. architecture. This also enables the features provided by
  178. <samp>-march=armv8-a+crc</samp>.
  179. </p>
  180. <p><samp>-march=armv8.2-a</samp> enables compiler support for the ARMv8.2-A
  181. architecture. This also enables the features provided by
  182. <samp>-march=armv8.1-a</samp>.
  183. </p>
  184. <p><samp>-march=armv8.2-a+fp16</samp> enables compiler support for the
  185. ARMv8.2-A architecture with the optional FP16 instructions extension.
  186. This also enables the features provided by <samp>-march=armv8.1-a</samp>
  187. and implies <samp>-mfp16-format=ieee</samp>.
  188. </p>
  189. <p><samp>-march=armv8.2-a+dotprod</samp> enables compiler support for the
  190. ARMv8.2-A architecture with the optional Dot Product instructions extension.
  191. This also enables the features provided by <samp>-march=armv8.1-a</samp>.
  192. </p>
  193. <p><samp>-march=armv8.2-a+fp16+dotprod</samp> enables compiler support for the
  194. ARMv8.2-A architecture with the optional FP16 and Dot Product instructions
  195. extension. This also enables the features provided by <samp>-march=armv8.1-a</samp>
  196. and implies <samp>-mfp16-format=ieee</samp>.
  197. </p>
  198. <p><samp>-march=native</samp> causes the compiler to auto-detect the architecture
  199. of the build computer. At present, this feature is only supported on
  200. GNU/Linux, and not all architectures are recognized. If the auto-detect
  201. is unsuccessful the option has no effect.
  202. </p>
  203. </dd>
  204. <dt><code>-mtune=<var>name</var></code></dt>
  205. <dd><a name="index-mtune-3"></a>
  206. <p>This option specifies the name of the target ARM processor for
  207. which GCC should tune the performance of the code.
  208. For some ARM implementations better performance can be obtained by using
  209. this option.
  210. Permissible names are: &lsquo;<samp>arm2</samp>&rsquo;, &lsquo;<samp>arm250</samp>&rsquo;,
  211. &lsquo;<samp>arm3</samp>&rsquo;, &lsquo;<samp>arm6</samp>&rsquo;, &lsquo;<samp>arm60</samp>&rsquo;, &lsquo;<samp>arm600</samp>&rsquo;, &lsquo;<samp>arm610</samp>&rsquo;,
  212. &lsquo;<samp>arm620</samp>&rsquo;, &lsquo;<samp>arm7</samp>&rsquo;, &lsquo;<samp>arm7m</samp>&rsquo;, &lsquo;<samp>arm7d</samp>&rsquo;, &lsquo;<samp>arm7dm</samp>&rsquo;,
  213. &lsquo;<samp>arm7di</samp>&rsquo;, &lsquo;<samp>arm7dmi</samp>&rsquo;, &lsquo;<samp>arm70</samp>&rsquo;, &lsquo;<samp>arm700</samp>&rsquo;,
  214. &lsquo;<samp>arm700i</samp>&rsquo;, &lsquo;<samp>arm710</samp>&rsquo;, &lsquo;<samp>arm710c</samp>&rsquo;, &lsquo;<samp>arm7100</samp>&rsquo;,
  215. &lsquo;<samp>arm720</samp>&rsquo;,
  216. &lsquo;<samp>arm7500</samp>&rsquo;, &lsquo;<samp>arm7500fe</samp>&rsquo;, &lsquo;<samp>arm7tdmi</samp>&rsquo;, &lsquo;<samp>arm7tdmi-s</samp>&rsquo;,
  217. &lsquo;<samp>arm710t</samp>&rsquo;, &lsquo;<samp>arm720t</samp>&rsquo;, &lsquo;<samp>arm740t</samp>&rsquo;,
  218. &lsquo;<samp>strongarm</samp>&rsquo;, &lsquo;<samp>strongarm110</samp>&rsquo;, &lsquo;<samp>strongarm1100</samp>&rsquo;,
  219. &lsquo;<samp>strongarm1110</samp>&rsquo;,
  220. &lsquo;<samp>arm8</samp>&rsquo;, &lsquo;<samp>arm810</samp>&rsquo;, &lsquo;<samp>arm9</samp>&rsquo;, &lsquo;<samp>arm9e</samp>&rsquo;, &lsquo;<samp>arm920</samp>&rsquo;,
  221. &lsquo;<samp>arm920t</samp>&rsquo;, &lsquo;<samp>arm922t</samp>&rsquo;, &lsquo;<samp>arm946e-s</samp>&rsquo;, &lsquo;<samp>arm966e-s</samp>&rsquo;,
  222. &lsquo;<samp>arm968e-s</samp>&rsquo;, &lsquo;<samp>arm926ej-s</samp>&rsquo;, &lsquo;<samp>arm940t</samp>&rsquo;, &lsquo;<samp>arm9tdmi</samp>&rsquo;,
  223. &lsquo;<samp>arm10tdmi</samp>&rsquo;, &lsquo;<samp>arm1020t</samp>&rsquo;, &lsquo;<samp>arm1026ej-s</samp>&rsquo;,
  224. &lsquo;<samp>arm10e</samp>&rsquo;, &lsquo;<samp>arm1020e</samp>&rsquo;, &lsquo;<samp>arm1022e</samp>&rsquo;,
  225. &lsquo;<samp>arm1136j-s</samp>&rsquo;, &lsquo;<samp>arm1136jf-s</samp>&rsquo;, &lsquo;<samp>mpcore</samp>&rsquo;, &lsquo;<samp>mpcorenovfp</samp>&rsquo;,
  226. &lsquo;<samp>arm1156t2-s</samp>&rsquo;, &lsquo;<samp>arm1156t2f-s</samp>&rsquo;, &lsquo;<samp>arm1176jz-s</samp>&rsquo;, &lsquo;<samp>arm1176jzf-s</samp>&rsquo;,
  227. &lsquo;<samp>generic-armv7-a</samp>&rsquo;, &lsquo;<samp>cortex-a5</samp>&rsquo;, &lsquo;<samp>cortex-a7</samp>&rsquo;, &lsquo;<samp>cortex-a8</samp>&rsquo;,
  228. &lsquo;<samp>cortex-a9</samp>&rsquo;, &lsquo;<samp>cortex-a12</samp>&rsquo;, &lsquo;<samp>cortex-a15</samp>&rsquo;, &lsquo;<samp>cortex-a17</samp>&rsquo;,
  229. &lsquo;<samp>cortex-a32</samp>&rsquo;, &lsquo;<samp>cortex-a35</samp>&rsquo;, &lsquo;<samp>cortex-a53</samp>&rsquo;, &lsquo;<samp>cortex-a57</samp>&rsquo;,
  230. &lsquo;<samp>cortex-a72</samp>&rsquo;, &lsquo;<samp>cortex-a73</samp>&rsquo;, &lsquo;<samp>cortex-r4</samp>&rsquo;,
  231. &lsquo;<samp>cortex-r4f</samp>&rsquo;, &lsquo;<samp>cortex-r5</samp>&rsquo;, &lsquo;<samp>cortex-r7</samp>&rsquo;, &lsquo;<samp>cortex-r8</samp>&rsquo;,
  232. &lsquo;<samp>cortex-m33</samp>&rsquo;,
  233. &lsquo;<samp>cortex-m23</samp>&rsquo;,
  234. &lsquo;<samp>cortex-m7</samp>&rsquo;,
  235. &lsquo;<samp>cortex-m4</samp>&rsquo;,
  236. &lsquo;<samp>cortex-m3</samp>&rsquo;,
  237. &lsquo;<samp>cortex-m1</samp>&rsquo;,
  238. &lsquo;<samp>cortex-m0</samp>&rsquo;,
  239. &lsquo;<samp>cortex-m0plus</samp>&rsquo;,
  240. &lsquo;<samp>cortex-m1.small-multiply</samp>&rsquo;,
  241. &lsquo;<samp>cortex-m0.small-multiply</samp>&rsquo;,
  242. &lsquo;<samp>cortex-m0plus.small-multiply</samp>&rsquo;,
  243. &lsquo;<samp>exynos-m1</samp>&rsquo;,
  244. &lsquo;<samp>marvell-pj4</samp>&rsquo;,
  245. &lsquo;<samp>xscale</samp>&rsquo;, &lsquo;<samp>iwmmxt</samp>&rsquo;, &lsquo;<samp>iwmmxt2</samp>&rsquo;, &lsquo;<samp>ep9312</samp>&rsquo;,
  246. &lsquo;<samp>fa526</samp>&rsquo;, &lsquo;<samp>fa626</samp>&rsquo;,
  247. &lsquo;<samp>fa606te</samp>&rsquo;, &lsquo;<samp>fa626te</samp>&rsquo;, &lsquo;<samp>fmp626</samp>&rsquo;, &lsquo;<samp>fa726te</samp>&rsquo;,
  248. &lsquo;<samp>xgene1</samp>&rsquo;.
  249. </p>
  250. <p>Additionally, this option can specify that GCC should tune the performance
  251. of the code for a big.LITTLE system. Permissible names are:
  252. &lsquo;<samp>cortex-a15.cortex-a7</samp>&rsquo;, &lsquo;<samp>cortex-a17.cortex-a7</samp>&rsquo;,
  253. &lsquo;<samp>cortex-a57.cortex-a53</samp>&rsquo;, &lsquo;<samp>cortex-a72.cortex-a53</samp>&rsquo;,
  254. &lsquo;<samp>cortex-a72.cortex-a35</samp>&rsquo;, &lsquo;<samp>cortex-a73.cortex-a53</samp>&rsquo;.
  255. </p>
  256. <p><samp>-mtune=generic-<var>arch</var></samp> specifies that GCC should tune the
  257. performance for a blend of processors within architecture <var>arch</var>.
  258. The aim is to generate code that run well on the current most popular
  259. processors, balancing between optimizations that benefit some CPUs in the
  260. range, and avoiding performance pitfalls of other CPUs. The effects of
  261. this option may change in future GCC versions as CPU models come and go.
  262. </p>
  263. <p><samp>-mtune=native</samp> causes the compiler to auto-detect the CPU
  264. of the build computer. At present, this feature is only supported on
  265. GNU/Linux, and not all architectures are recognized. If the auto-detect is
  266. unsuccessful the option has no effect.
  267. </p>
  268. </dd>
  269. <dt><code>-mcpu=<var>name</var></code></dt>
  270. <dd><a name="index-mcpu-2"></a>
  271. <p>This specifies the name of the target ARM processor. GCC uses this name
  272. to derive the name of the target ARM architecture (as if specified
  273. by <samp>-march</samp>) and the ARM processor type for which to tune for
  274. performance (as if specified by <samp>-mtune</samp>). Where this option
  275. is used in conjunction with <samp>-march</samp> or <samp>-mtune</samp>,
  276. those options take precedence over the appropriate part of this option.
  277. </p>
  278. <p>Permissible names for this option are the same as those for
  279. <samp>-mtune</samp>.
  280. </p>
  281. <p><samp>-mcpu=generic-<var>arch</var></samp> is also permissible, and is
  282. equivalent to <samp>-march=<var>arch</var> -mtune=generic-<var>arch</var></samp>.
  283. See <samp>-mtune</samp> for more information.
  284. </p>
  285. <p><samp>-mcpu=native</samp> causes the compiler to auto-detect the CPU
  286. of the build computer. At present, this feature is only supported on
  287. GNU/Linux, and not all architectures are recognized. If the auto-detect
  288. is unsuccessful the option has no effect.
  289. </p>
  290. </dd>
  291. <dt><code>-mfpu=<var>name</var></code></dt>
  292. <dd><a name="index-mfpu-1"></a>
  293. <p>This specifies what floating-point hardware (or hardware emulation) is
  294. available on the target. Permissible names are: &lsquo;<samp>vfpv2</samp>&rsquo;, &lsquo;<samp>vfpv3</samp>&rsquo;,
  295. &lsquo;<samp>vfpv3-fp16</samp>&rsquo;, &lsquo;<samp>vfpv3-d16</samp>&rsquo;, &lsquo;<samp>vfpv3-d16-fp16</samp>&rsquo;, &lsquo;<samp>vfpv3xd</samp>&rsquo;,
  296. &lsquo;<samp>vfpv3xd-fp16</samp>&rsquo;, &lsquo;<samp>neon-vfpv3</samp>&rsquo;, &lsquo;<samp>neon-fp16</samp>&rsquo;, &lsquo;<samp>vfpv4</samp>&rsquo;,
  297. &lsquo;<samp>vfpv4-d16</samp>&rsquo;, &lsquo;<samp>fpv4-sp-d16</samp>&rsquo;, &lsquo;<samp>neon-vfpv4</samp>&rsquo;,
  298. &lsquo;<samp>fpv5-d16</samp>&rsquo;, &lsquo;<samp>fpv5-sp-d16</samp>&rsquo;,
  299. &lsquo;<samp>fp-armv8</samp>&rsquo;, &lsquo;<samp>neon-fp-armv8</samp>&rsquo; and &lsquo;<samp>crypto-neon-fp-armv8</samp>&rsquo;.
  300. Note that &lsquo;<samp>neon</samp>&rsquo; is an alias for &lsquo;<samp>neon-vfpv3</samp>&rsquo; and &lsquo;<samp>vfp</samp>&rsquo;
  301. is an alias for &lsquo;<samp>vfpv2</samp>&rsquo;.
  302. </p>
  303. <p>If <samp>-msoft-float</samp> is specified this specifies the format of
  304. floating-point values.
  305. </p>
  306. <p>If the selected floating-point hardware includes the NEON extension
  307. (e.g. <samp>-mfpu</samp>=&lsquo;<samp>neon</samp>&rsquo;), note that floating-point
  308. operations are not generated by GCC&rsquo;s auto-vectorization pass unless
  309. <samp>-funsafe-math-optimizations</samp> is also specified. This is
  310. because NEON hardware does not fully implement the IEEE 754 standard for
  311. floating-point arithmetic (in particular denormal values are treated as
  312. zero), so the use of NEON instructions may lead to a loss of precision.
  313. </p>
  314. <p>You can also set the fpu name at function level by using the <code>target(&quot;fpu=&quot;)</code> function attributes (see <a href="ARM-Function-Attributes.html#ARM-Function-Attributes">ARM Function Attributes</a>) or pragmas (see <a href="Function-Specific-Option-Pragmas.html#Function-Specific-Option-Pragmas">Function Specific Option Pragmas</a>).
  315. </p>
  316. </dd>
  317. <dt><code>-mfp16-format=<var>name</var></code></dt>
  318. <dd><a name="index-mfp16_002dformat"></a>
  319. <p>Specify the format of the <code>__fp16</code> half-precision floating-point type.
  320. Permissible names are &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>ieee</samp>&rsquo;, and &lsquo;<samp>alternative</samp>&rsquo;;
  321. the default is &lsquo;<samp>none</samp>&rsquo;, in which case the <code>__fp16</code> type is not
  322. defined. See <a href="Half_002dPrecision.html#Half_002dPrecision">Half-Precision</a>, for more information.
  323. </p>
  324. </dd>
  325. <dt><code>-mstructure-size-boundary=<var>n</var></code></dt>
  326. <dd><a name="index-mstructure_002dsize_002dboundary"></a>
  327. <p>The sizes of all structures and unions are rounded up to a multiple
  328. of the number of bits set by this option. Permissible values are 8, 32
  329. and 64. The default value varies for different toolchains. For the COFF
  330. targeted toolchain the default value is 8. A value of 64 is only allowed
  331. if the underlying ABI supports it.
  332. </p>
  333. <p>Specifying a larger number can produce faster, more efficient code, but
  334. can also increase the size of the program. Different values are potentially
  335. incompatible. Code compiled with one value cannot necessarily expect to
  336. work with code or libraries compiled with another value, if they exchange
  337. information using structures or unions.
  338. </p>
  339. </dd>
  340. <dt><code>-mabort-on-noreturn</code></dt>
  341. <dd><a name="index-mabort_002don_002dnoreturn"></a>
  342. <p>Generate a call to the function <code>abort</code> at the end of a
  343. <code>noreturn</code> function. It is executed if the function tries to
  344. return.
  345. </p>
  346. </dd>
  347. <dt><code>-mlong-calls</code></dt>
  348. <dt><code>-mno-long-calls</code></dt>
  349. <dd><a name="index-mlong_002dcalls-2"></a>
  350. <a name="index-mno_002dlong_002dcalls"></a>
  351. <p>Tells the compiler to perform function calls by first loading the
  352. address of the function into a register and then performing a subroutine
  353. call on this register. This switch is needed if the target function
  354. lies outside of the 64-megabyte addressing range of the offset-based
  355. version of subroutine call instruction.
  356. </p>
  357. <p>Even if this switch is enabled, not all function calls are turned
  358. into long calls. The heuristic is that static functions, functions
  359. that have the <code>short_call</code> attribute, functions that are inside
  360. the scope of a <code>#pragma no_long_calls</code> directive, and functions whose
  361. definitions have already been compiled within the current compilation
  362. unit are not turned into long calls. The exceptions to this rule are
  363. that weak function definitions, functions with the <code>long_call</code>
  364. attribute or the <code>section</code> attribute, and functions that are within
  365. the scope of a <code>#pragma long_calls</code> directive are always
  366. turned into long calls.
  367. </p>
  368. <p>This feature is not enabled by default. Specifying
  369. <samp>-mno-long-calls</samp> restores the default behavior, as does
  370. placing the function calls within the scope of a <code>#pragma
  371. long_calls_off</code> directive. Note these switches have no effect on how
  372. the compiler generates code to handle function calls via function
  373. pointers.
  374. </p>
  375. </dd>
  376. <dt><code>-msingle-pic-base</code></dt>
  377. <dd><a name="index-msingle_002dpic_002dbase"></a>
  378. <p>Treat the register used for PIC addressing as read-only, rather than
  379. loading it in the prologue for each function. The runtime system is
  380. responsible for initializing this register with an appropriate value
  381. before execution begins.
  382. </p>
  383. </dd>
  384. <dt><code>-mpic-register=<var>reg</var></code></dt>
  385. <dd><a name="index-mpic_002dregister"></a>
  386. <p>Specify the register to be used for PIC addressing.
  387. For standard PIC base case, the default is any suitable register
  388. determined by compiler. For single PIC base case, the default is
  389. &lsquo;<samp>R9</samp>&rsquo; if target is EABI based or stack-checking is enabled,
  390. otherwise the default is &lsquo;<samp>R10</samp>&rsquo;.
  391. </p>
  392. </dd>
  393. <dt><code>-mpic-data-is-text-relative</code></dt>
  394. <dd><a name="index-mpic_002ddata_002dis_002dtext_002drelative"></a>
  395. <p>Assume that the displacement between the text and data segments is fixed
  396. at static link time. This permits using PC-relative addressing
  397. operations to access data known to be in the data segment. For
  398. non-VxWorks RTP targets, this option is enabled by default. When
  399. disabled on such targets, it will enable <samp>-msingle-pic-base</samp> by
  400. default.
  401. </p>
  402. </dd>
  403. <dt><code>-mpoke-function-name</code></dt>
  404. <dd><a name="index-mpoke_002dfunction_002dname"></a>
  405. <p>Write the name of each function into the text section, directly
  406. preceding the function prologue. The generated code is similar to this:
  407. </p>
  408. <div class="smallexample">
  409. <pre class="smallexample"> t0
  410. .ascii &quot;arm_poke_function_name&quot;, 0
  411. .align
  412. t1
  413. .word 0xff000000 + (t1 - t0)
  414. arm_poke_function_name
  415. mov ip, sp
  416. stmfd sp!, {fp, ip, lr, pc}
  417. sub fp, ip, #4
  418. </pre></div>
  419. <p>When performing a stack backtrace, code can inspect the value of
  420. <code>pc</code> stored at <code>fp + 0</code>. If the trace function then looks at
  421. location <code>pc - 12</code> and the top 8 bits are set, then we know that
  422. there is a function name embedded immediately preceding this location
  423. and has length <code>((pc[-3]) &amp; 0xff000000)</code>.
  424. </p>
  425. </dd>
  426. <dt><code>-mthumb</code></dt>
  427. <dt><code>-marm</code></dt>
  428. <dd><a name="index-marm"></a>
  429. <a name="index-mthumb"></a>
  430. <p>Select between generating code that executes in ARM and Thumb
  431. states. The default for most configurations is to generate code
  432. that executes in ARM state, but the default can be changed by
  433. configuring GCC with the <samp>--with-mode=</samp><var>state</var>
  434. configure option.
  435. </p>
  436. <p>You can also override the ARM and Thumb mode for each function
  437. by using the <code>target(&quot;thumb&quot;)</code> and <code>target(&quot;arm&quot;)</code> function attributes
  438. (see <a href="ARM-Function-Attributes.html#ARM-Function-Attributes">ARM Function Attributes</a>) or pragmas (see <a href="Function-Specific-Option-Pragmas.html#Function-Specific-Option-Pragmas">Function Specific Option Pragmas</a>).
  439. </p>
  440. </dd>
  441. <dt><code>-mtpcs-frame</code></dt>
  442. <dd><a name="index-mtpcs_002dframe"></a>
  443. <p>Generate a stack frame that is compliant with the Thumb Procedure Call
  444. Standard for all non-leaf functions. (A leaf function is one that does
  445. not call any other functions.) The default is <samp>-mno-tpcs-frame</samp>.
  446. </p>
  447. </dd>
  448. <dt><code>-mtpcs-leaf-frame</code></dt>
  449. <dd><a name="index-mtpcs_002dleaf_002dframe"></a>
  450. <p>Generate a stack frame that is compliant with the Thumb Procedure Call
  451. Standard for all leaf functions. (A leaf function is one that does
  452. not call any other functions.) The default is <samp>-mno-apcs-leaf-frame</samp>.
  453. </p>
  454. </dd>
  455. <dt><code>-mcallee-super-interworking</code></dt>
  456. <dd><a name="index-mcallee_002dsuper_002dinterworking"></a>
  457. <p>Gives all externally visible functions in the file being compiled an ARM
  458. instruction set header which switches to Thumb mode before executing the
  459. rest of the function. This allows these functions to be called from
  460. non-interworking code. This option is not valid in AAPCS configurations
  461. because interworking is enabled by default.
  462. </p>
  463. </dd>
  464. <dt><code>-mcaller-super-interworking</code></dt>
  465. <dd><a name="index-mcaller_002dsuper_002dinterworking"></a>
  466. <p>Allows calls via function pointers (including virtual functions) to
  467. execute correctly regardless of whether the target code has been
  468. compiled for interworking or not. There is a small overhead in the cost
  469. of executing a function pointer if this option is enabled. This option
  470. is not valid in AAPCS configurations because interworking is enabled
  471. by default.
  472. </p>
  473. </dd>
  474. <dt><code>-mtp=<var>name</var></code></dt>
  475. <dd><a name="index-mtp"></a>
  476. <p>Specify the access model for the thread local storage pointer. The valid
  477. models are &lsquo;<samp>soft</samp>&rsquo;, which generates calls to <code>__aeabi_read_tp</code>,
  478. &lsquo;<samp>cp15</samp>&rsquo;, which fetches the thread pointer from <code>cp15</code> directly
  479. (supported in the arm6k architecture), and &lsquo;<samp>auto</samp>&rsquo;, which uses the
  480. best available method for the selected processor. The default setting is
  481. &lsquo;<samp>auto</samp>&rsquo;.
  482. </p>
  483. </dd>
  484. <dt><code>-mtls-dialect=<var>dialect</var></code></dt>
  485. <dd><a name="index-mtls_002ddialect"></a>
  486. <p>Specify the dialect to use for accessing thread local storage. Two
  487. <var>dialect</var>s are supported&mdash;&lsquo;<samp>gnu</samp>&rsquo; and &lsquo;<samp>gnu2</samp>&rsquo;. The
  488. &lsquo;<samp>gnu</samp>&rsquo; dialect selects the original GNU scheme for supporting
  489. local and global dynamic TLS models. The &lsquo;<samp>gnu2</samp>&rsquo; dialect
  490. selects the GNU descriptor scheme, which provides better performance
  491. for shared libraries. The GNU descriptor scheme is compatible with
  492. the original scheme, but does require new assembler, linker and
  493. library support. Initial and local exec TLS models are unaffected by
  494. this option and always use the original scheme.
  495. </p>
  496. </dd>
  497. <dt><code>-mword-relocations</code></dt>
  498. <dd><a name="index-mword_002drelocations"></a>
  499. <p>Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
  500. This is enabled by default on targets (uClinux, SymbianOS) where the runtime
  501. loader imposes this restriction, and when <samp>-fpic</samp> or <samp>-fPIC</samp>
  502. is specified.
  503. </p>
  504. </dd>
  505. <dt><code>-mfix-cortex-m3-ldrd</code></dt>
  506. <dd><a name="index-mfix_002dcortex_002dm3_002dldrd"></a>
  507. <p>Some Cortex-M3 cores can cause data corruption when <code>ldrd</code> instructions
  508. with overlapping destination and base registers are used. This option avoids
  509. generating these instructions. This option is enabled by default when
  510. <samp>-mcpu=cortex-m3</samp> is specified.
  511. </p>
  512. </dd>
  513. <dt><code>-munaligned-access</code></dt>
  514. <dt><code>-mno-unaligned-access</code></dt>
  515. <dd><a name="index-munaligned_002daccess"></a>
  516. <a name="index-mno_002dunaligned_002daccess"></a>
  517. <p>Enables (or disables) reading and writing of 16- and 32- bit values
  518. from addresses that are not 16- or 32- bit aligned. By default
  519. unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
  520. ARMv8-M Baseline architectures, and enabled for all other
  521. architectures. If unaligned access is not enabled then words in packed
  522. data structures are accessed a byte at a time.
  523. </p>
  524. <p>The ARM attribute <code>Tag_CPU_unaligned_access</code> is set in the
  525. generated object file to either true or false, depending upon the
  526. setting of this option. If unaligned access is enabled then the
  527. preprocessor symbol <code>__ARM_FEATURE_UNALIGNED</code> is also
  528. defined.
  529. </p>
  530. </dd>
  531. <dt><code>-mneon-for-64bits</code></dt>
  532. <dd><a name="index-mneon_002dfor_002d64bits"></a>
  533. <p>Enables using Neon to handle scalar 64-bits operations. This is
  534. disabled by default since the cost of moving data from core registers
  535. to Neon is high.
  536. </p>
  537. </dd>
  538. <dt><code>-mslow-flash-data</code></dt>
  539. <dd><a name="index-mslow_002dflash_002ddata"></a>
  540. <p>Assume loading data from flash is slower than fetching instruction.
  541. Therefore literal load is minimized for better performance.
  542. This option is only supported when compiling for ARMv7 M-profile and
  543. off by default.
  544. </p>
  545. </dd>
  546. <dt><code>-masm-syntax-unified</code></dt>
  547. <dd><a name="index-masm_002dsyntax_002dunified"></a>
  548. <p>Assume inline assembler is using unified asm syntax. The default is
  549. currently off which implies divided syntax. This option has no impact
  550. on Thumb2. However, this may change in future releases of GCC.
  551. Divided syntax should be considered deprecated.
  552. </p>
  553. </dd>
  554. <dt><code>-mrestrict-it</code></dt>
  555. <dd><a name="index-mrestrict_002dit"></a>
  556. <p>Restricts generation of IT blocks to conform to the rules of ARMv8.
  557. IT blocks can only contain a single 16-bit instruction from a select
  558. set of instructions. This option is on by default for ARMv8 Thumb mode.
  559. </p>
  560. </dd>
  561. <dt><code>-mprint-tune-info</code></dt>
  562. <dd><a name="index-mprint_002dtune_002dinfo"></a>
  563. <p>Print CPU tuning information as comment in assembler file. This is
  564. an option used only for regression testing of the compiler and not
  565. intended for ordinary use in compiling code. This option is disabled
  566. by default.
  567. </p>
  568. </dd>
  569. <dt><code>-mpure-code</code></dt>
  570. <dd><a name="index-mpure_002dcode"></a>
  571. <p>Do not allow constant data to be placed in code sections.
  572. Additionally, when compiling for ELF object format give all text sections the
  573. ELF processor-specific section attribute <code>SHF_ARM_PURECODE</code>. This option
  574. is only available when generating non-pic code for ARMv7-M targets.
  575. </p>
  576. </dd>
  577. <dt><code>-mcmse</code></dt>
  578. <dd><a name="index-mcmse"></a>
  579. <p>Generate secure code as per the &quot;ARMv8-M Security Extensions: Requirements on
  580. Development Tools Engineering Specification&quot;, which can be found on
  581. <a href="http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf">http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf</a>.
  582. </p></dd>
  583. </dl>
  584. <hr>
  585. <div class="header">
  586. <p>
  587. Next: <a href="AVR-Options.html#AVR-Options" accesskey="n" rel="next">AVR Options</a>, Previous: <a href="ARC-Options.html#ARC-Options" accesskey="p" rel="prev">ARC Options</a>, Up: <a href="Submodel-Options.html#Submodel-Options" accesskey="u" rel="up">Submodel Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  588. </div>
  589. </body>
  590. </html>