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.

278 satır
13KB

  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 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 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>MSP430 Options (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="MSP430 Options (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="MSP430 Options (Using the GNU Compiler Collection (GCC))">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  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="NDS32-Options.html#NDS32-Options" rel="next" title="NDS32 Options">
  31. <link href="Moxie-Options.html#Moxie-Options" rel="prev" title="Moxie Options">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="MSP430-Options"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="NDS32-Options.html#NDS32-Options" accesskey="n" rel="next">NDS32 Options</a>, Previous: <a href="Moxie-Options.html#Moxie-Options" accesskey="p" rel="prev">Moxie 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>
  65. </div>
  66. <hr>
  67. <a name="MSP430-Options-1"></a>
  68. <h4 class="subsection">3.19.33 MSP430 Options</h4>
  69. <a name="index-MSP430-Options"></a>
  70. <p>These options are defined for the MSP430:
  71. </p>
  72. <dl compact="compact">
  73. <dt><code>-masm-hex</code></dt>
  74. <dd><a name="index-masm_002dhex"></a>
  75. <p>Force assembly output to always use hex constants. Normally such
  76. constants are signed decimals, but this option is available for
  77. testsuite and/or aesthetic purposes.
  78. </p>
  79. </dd>
  80. <dt><code>-mmcu=</code></dt>
  81. <dd><a name="index-mmcu_003d"></a>
  82. <p>Select the MCU to target. This is used to create a C preprocessor
  83. symbol based upon the MCU name, converted to upper case and pre- and
  84. post-fixed with &lsquo;<samp>__</samp>&rsquo;. This in turn is used by the
  85. <samp>msp430.h</samp> header file to select an MCU-specific supplementary
  86. header file.
  87. </p>
  88. <p>The option also sets the ISA to use. If the MCU name is one that is
  89. known to only support the 430 ISA then that is selected, otherwise the
  90. 430X ISA is selected. A generic MCU name of &lsquo;<samp>msp430</samp>&rsquo; can also be
  91. used to select the 430 ISA. Similarly the generic &lsquo;<samp>msp430x</samp>&rsquo; MCU
  92. name selects the 430X ISA.
  93. </p>
  94. <p>In addition an MCU-specific linker script is added to the linker
  95. command line. The script&rsquo;s name is the name of the MCU with
  96. <samp>.ld</samp> appended. Thus specifying <samp>-mmcu=xxx</samp> on the <code>gcc</code>
  97. command line defines the C preprocessor symbol <code>__XXX__</code> and
  98. cause the linker to search for a script called <samp>xxx.ld</samp>.
  99. </p>
  100. <p>The ISA and hardware multiply supported for the different MCUs is hard-coded
  101. into GCC. However, an external &lsquo;<samp>devices.csv</samp>&rsquo; file can be used to
  102. extend device support beyond those that have been hard-coded.
  103. </p>
  104. <p>GCC searches for the &lsquo;<samp>devices.csv</samp>&rsquo; file using the following methods in the
  105. given precedence order, where the first method takes precendence over the
  106. second which takes precedence over the third.
  107. </p>
  108. <dl compact="compact">
  109. <dt>Include path specified with <code>-I</code> and <code>-L</code></dt>
  110. <dd><p>&lsquo;<samp>devices.csv</samp>&rsquo; will be searched for in each of the directories specified by
  111. include paths and linker library search paths.
  112. </p></dd>
  113. <dt>Path specified by the environment variable &lsquo;<samp>MSP430_GCC_INCLUDE_DIR</samp>&rsquo;</dt>
  114. <dd><p>Define the value of the global environment variable
  115. &lsquo;<samp>MSP430_GCC_INCLUDE_DIR</samp>&rsquo;
  116. to the full path to the directory containing devices.csv, and GCC will search
  117. this directory for devices.csv. If devices.csv is found, this directory will
  118. also be registered as an include path, and linker library path. Header files
  119. and linker scripts in this directory can therefore be used without manually
  120. specifying <code>-I</code> and <code>-L</code> on the command line.
  121. </p></dd>
  122. <dt>The &lsquo;<samp>msp430-elf{,bare}/include/devices</samp>&rsquo; directory</dt>
  123. <dd><p>Finally, GCC will examine &lsquo;<samp>msp430-elf{,bare}/include/devices</samp>&rsquo; from the
  124. toolchain root directory. This directory does not exist in a default
  125. installation, but if the user has created it and copied &lsquo;<samp>devices.csv</samp>&rsquo;
  126. there, then the MCU data will be read. As above, this directory will
  127. also be registered as an include path, and linker library path.
  128. </p>
  129. </dd>
  130. </dl>
  131. <p>If none of the above search methods find &lsquo;<samp>devices.csv</samp>&rsquo;, then the
  132. hard-coded MCU data is used.
  133. </p>
  134. </dd>
  135. <dt><code>-mwarn-mcu</code></dt>
  136. <dt><code>-mno-warn-mcu</code></dt>
  137. <dd><a name="index-mwarn_002dmcu"></a>
  138. <a name="index-mno_002dwarn_002dmcu"></a>
  139. <p>This option enables or disables warnings about conflicts between the
  140. MCU name specified by the <samp>-mmcu</samp> option and the ISA set by the
  141. <samp>-mcpu</samp> option and/or the hardware multiply support set by the
  142. <samp>-mhwmult</samp> option. It also toggles warnings about unrecognized
  143. MCU names. This option is on by default.
  144. </p>
  145. </dd>
  146. <dt><code>-mcpu=</code></dt>
  147. <dd><a name="index-mcpu_003d-4"></a>
  148. <p>Specifies the ISA to use. Accepted values are &lsquo;<samp>msp430</samp>&rsquo;,
  149. &lsquo;<samp>msp430x</samp>&rsquo; and &lsquo;<samp>msp430xv2</samp>&rsquo;. This option is deprecated. The
  150. <samp>-mmcu=</samp> option should be used to select the ISA.
  151. </p>
  152. </dd>
  153. <dt><code>-msim</code></dt>
  154. <dd><a name="index-msim-6"></a>
  155. <p>Link to the simulator runtime libraries and linker script. Overrides
  156. any scripts that would be selected by the <samp>-mmcu=</samp> option.
  157. </p>
  158. </dd>
  159. <dt><code>-mlarge</code></dt>
  160. <dd><a name="index-mlarge"></a>
  161. <p>Use large-model addressing (20-bit pointers, 32-bit <code>size_t</code>).
  162. </p>
  163. </dd>
  164. <dt><code>-msmall</code></dt>
  165. <dd><a name="index-msmall"></a>
  166. <p>Use small-model addressing (16-bit pointers, 16-bit <code>size_t</code>).
  167. </p>
  168. </dd>
  169. <dt><code>-mrelax</code></dt>
  170. <dd><a name="index-mrelax-3"></a>
  171. <p>This option is passed to the assembler and linker, and allows the
  172. linker to perform certain optimizations that cannot be done until
  173. the final link.
  174. </p>
  175. </dd>
  176. <dt><code>mhwmult=</code></dt>
  177. <dd><a name="index-mhwmult_003d"></a>
  178. <p>Describes the type of hardware multiply supported by the target.
  179. Accepted values are &lsquo;<samp>none</samp>&rsquo; for no hardware multiply, &lsquo;<samp>16bit</samp>&rsquo;
  180. for the original 16-bit-only multiply supported by early MCUs.
  181. &lsquo;<samp>32bit</samp>&rsquo; for the 16/32-bit multiply supported by later MCUs and
  182. &lsquo;<samp>f5series</samp>&rsquo; for the 16/32-bit multiply supported by F5-series MCUs.
  183. A value of &lsquo;<samp>auto</samp>&rsquo; can also be given. This tells GCC to deduce
  184. the hardware multiply support based upon the MCU name provided by the
  185. <samp>-mmcu</samp> option. If no <samp>-mmcu</samp> option is specified or if
  186. the MCU name is not recognized then no hardware multiply support is
  187. assumed. <code>auto</code> is the default setting.
  188. </p>
  189. <p>Hardware multiplies are normally performed by calling a library
  190. routine. This saves space in the generated code. When compiling at
  191. <samp>-O3</samp> or higher however the hardware multiplier is invoked
  192. inline. This makes for bigger, but faster code.
  193. </p>
  194. <p>The hardware multiply routines disable interrupts whilst running and
  195. restore the previous interrupt state when they finish. This makes
  196. them safe to use inside interrupt handlers as well as in normal code.
  197. </p>
  198. </dd>
  199. <dt><code>-minrt</code></dt>
  200. <dd><a name="index-minrt"></a>
  201. <p>Enable the use of a minimum runtime environment - no static
  202. initializers or constructors. This is intended for memory-constrained
  203. devices. The compiler includes special symbols in some objects
  204. that tell the linker and runtime which code fragments are required.
  205. </p>
  206. </dd>
  207. <dt><code>-mtiny-printf</code></dt>
  208. <dd><a name="index-mtiny_002dprintf"></a>
  209. <p>Enable reduced code size <code>printf</code> and <code>puts</code> library functions.
  210. The &lsquo;<samp>tiny</samp>&rsquo; implementations of these functions are not reentrant, so
  211. must be used with caution in multi-threaded applications.
  212. </p>
  213. <p>Support for streams has been removed and the string to be printed will
  214. always be sent to stdout via the <code>write</code> syscall. The string is not
  215. buffered before it is sent to write.
  216. </p>
  217. <p>This option requires Newlib Nano IO, so GCC must be configured with
  218. &lsquo;<samp>--enable-newlib-nano-formatted-io</samp>&rsquo;.
  219. </p>
  220. </dd>
  221. <dt><code>-mcode-region=</code></dt>
  222. <dt><code>-mdata-region=</code></dt>
  223. <dd><a name="index-mcode_002dregion"></a>
  224. <a name="index-mdata_002dregion"></a>
  225. <p>These options tell the compiler where to place functions and data that
  226. do not have one of the <code>lower</code>, <code>upper</code>, <code>either</code> or
  227. <code>section</code> attributes. Possible values are <code>lower</code>,
  228. <code>upper</code>, <code>either</code> or <code>any</code>. The first three behave
  229. like the corresponding attribute. The fourth possible value -
  230. <code>any</code> - is the default. It leaves placement entirely up to the
  231. linker script and how it assigns the standard sections
  232. (<code>.text</code>, <code>.data</code>, etc) to the memory regions.
  233. </p>
  234. </dd>
  235. <dt><code>-msilicon-errata=</code></dt>
  236. <dd><a name="index-msilicon_002derrata"></a>
  237. <p>This option passes on a request to assembler to enable the fixes for
  238. the named silicon errata.
  239. </p>
  240. </dd>
  241. <dt><code>-msilicon-errata-warn=</code></dt>
  242. <dd><a name="index-msilicon_002derrata_002dwarn"></a>
  243. <p>This option passes on a request to the assembler to enable warning
  244. messages when a silicon errata might need to be applied.
  245. </p>
  246. </dd>
  247. <dt><code>-mwarn-devices-csv</code></dt>
  248. <dt><code>-mno-warn-devices-csv</code></dt>
  249. <dd><a name="index-mwarn_002ddevices_002dcsv"></a>
  250. <a name="index-mno_002dwarn_002ddevices_002dcsv"></a>
  251. <p>Warn if &lsquo;<samp>devices.csv</samp>&rsquo; is not found or there are problem parsing it
  252. (default: on).
  253. </p>
  254. </dd>
  255. </dl>
  256. <hr>
  257. <div class="header">
  258. <p>
  259. Next: <a href="NDS32-Options.html#NDS32-Options" accesskey="n" rel="next">NDS32 Options</a>, Previous: <a href="Moxie-Options.html#Moxie-Options" accesskey="p" rel="prev">Moxie 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>
  260. </div>
  261. </body>
  262. </html>