blob: 30d9152e03924d0d0ed6659298d62f8c33058c6a [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2015 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
"GNU Free Documentation License".
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using the GNU Compiler Collection (GCC): MSP430 Options</title>
<meta name="description" content="Using the GNU Compiler Collection (GCC): MSP430 Options">
<meta name="keywords" content="Using the GNU Compiler Collection (GCC): MSP430 Options">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Submodel-Options.html#Submodel-Options" rel="up" title="Submodel Options">
<link href="NDS32-Options.html#NDS32-Options" rel="next" title="NDS32 Options">
<link href="Moxie-Options.html#Moxie-Options" rel="prev" title="Moxie Options">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="MSP430-Options"></a>
<div class="header">
<p>
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>
</div>
<hr>
<a name="MSP430-Options-1"></a>
<h4 class="subsection">3.17.31 MSP430 Options</h4>
<a name="index-MSP430-Options"></a>
<p>These options are defined for the MSP430:
</p>
<dl compact="compact">
<dt><code>-masm-hex</code></dt>
<dd><a name="index-masm_002dhex"></a>
<p>Force assembly output to always use hex constants. Normally such
constants are signed decimals, but this option is available for
testsuite and/or aesthetic purposes.
</p>
</dd>
<dt><code>-mmcu=</code></dt>
<dd><a name="index-mmcu_003d"></a>
<p>Select the MCU to target. This is used to create a C preprocessor
symbol based upon the MCU name, converted to upper case and pre- and
post- fixed with <code>__</code>. This in turn will be used by the
<code>msp430.h</code> header file to select an MCU specific supplimentary
header file.
</p>
<p>The option also sets the ISA to use. If the MCU name is one that is
known to only support the 430 ISA then that is selected, otherwise the
430X ISA is selected. A generic MCU name of <code>msp430</code> can also be
used to select the 430 ISA. Similarly the generic <code>msp430x</code> MCU
name will select the 430X ISA.
</p>
<p>In addition an MCU specific linker script will be added to the linker
command line. The script&rsquo;s name is the name of the MCU with
<code>.ld</code> appended. Thus specifying <samp>-mmcu=xxx</samp> on the gcc
command line will define the C preprocessor symbol <code>__XXX__</code> and
cause the linker to search for a script called <samp>xxx.ld</samp>.
</p>
<p>This option is also passed on to the assembler.
</p>
</dd>
<dt><code>-mcpu=</code></dt>
<dd><a name="index-_002dmcpu_003d"></a>
<p>Specifies the ISA to use. Accepted values are <code>msp430</code>,
<code>msp430x</code> and <code>msp430xv2</code>. This option is deprecated. The
<samp>-mmcu=</samp> option should be used to select the ISA.
</p>
</dd>
<dt><code>-msim</code></dt>
<dd><a name="index-msim-5"></a>
<p>Link to the simulator runtime libraries and linker script. Overrides
any scripts that would be selected by the <samp>-mmcu=</samp> option.
</p>
</dd>
<dt><code>-mlarge</code></dt>
<dd><a name="index-mlarge"></a>
<p>Use large-model addressing (20-bit pointers, 32-bit <code>size_t</code>).
</p>
</dd>
<dt><code>-msmall</code></dt>
<dd><a name="index-msmall"></a>
<p>Use small-model addressing (16-bit pointers, 16-bit <code>size_t</code>).
</p>
</dd>
<dt><code>-mrelax</code></dt>
<dd><a name="index-mrelax-3"></a>
<p>This option is passed to the assembler and linker, and allows the
linker to perform certain optimizations that cannot be done until
the final link.
</p>
</dd>
<dt><code>mhwmult=</code></dt>
<dd><a name="index-mhwmult_003d"></a>
<p>Describes the type of hardware multiply supported by the target.
Accepted values are <code>none</code> for no hardware multiply, <code>16bit</code>
for the original 16-bit-only multiply supported by early MCUs.
<code>32bit</code> for the 16/32-bit multiply supported by later MCUs and
<code>f5series</code> for the 16/32-bit multiply supported by F5-series MCUs.
A value of <code>auto</code> can also be given. This tells GCC to deduce
the hardware multiply support based upon the MCU name provided by the
<samp>-mmcu</samp> option. If no <samp>-mmcu</samp> option is specified then
<code>32bit</code> hardware multiply support is assumed. <code>auto</code> is the
default setting.
</p>
<p>Hardware multiplies are normally performed by calling a library
routine. This saves space in the generated code. When compiling at
<code>-O3</code> or higher however the hardware multiplier is invoked
inline. This makes for bigger, but faster code.
</p>
<p>The hardware multiply routines disable interrupts whilst running and
restore the previous interrupt state when they finish. This makes
them safe to use inside interrupt handlers as well as in normal code.
</p>
</dd>
<dt><code>-minrt</code></dt>
<dd><a name="index-minrt"></a>
<p>Enable the use of a minimum runtime environment - no static
initializers or constructors. This is intended for memory-constrained
devices. The compiler will include special symbols in some objects
that tell the linker and runtime which code fragments are required.
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
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>
</div>
</body>
</html>