-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathARM-Options.html
More file actions
278 lines (232 loc) · 20 KB
/
ARM-Options.html
File metadata and controls
278 lines (232 loc) · 20 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<html lang="en">
<head>
<title>ARM Options - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Submodel-Options.html#Submodel-Options" title="Submodel Options">
<link rel="prev" href="ARC-Options.html#ARC-Options" title="ARC Options">
<link rel="next" href="AVR-Options.html#AVR-Options" title="AVR Options">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005 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.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``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.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="ARM-Options"></a>
Next: <a rel="next" accesskey="n" href="AVR-Options.html#AVR-Options">AVR Options</a>,
Previous: <a rel="previous" accesskey="p" href="ARC-Options.html#ARC-Options">ARC Options</a>,
Up: <a rel="up" accesskey="u" href="Submodel-Options.html#Submodel-Options">Submodel Options</a>
<hr>
</div>
<h4 class="subsection">3.17.2 ARM Options</h4>
<p><a name="index-ARM-options-737"></a>
These `<samp><span class="samp">-m</span></samp>' options are defined for Advanced RISC Machines (ARM)
architectures:
<dl>
<dt><code>-mabi=</code><var>name</var><dd><a name="index-mabi-738"></a>Generate code for the specified ABI. Permissible values are: `<samp><span class="samp">apcs-gnu</span></samp>',
`<samp><span class="samp">atpcs</span></samp>', `<samp><span class="samp">aapcs</span></samp>', `<samp><span class="samp">aapcs-linux</span></samp>' and `<samp><span class="samp">iwmmxt</span></samp>'.
<br><dt><code>-mapcs-frame</code><dd><a name="index-mapcs_002dframe-739"></a>Generate a stack frame that is compliant with the ARM Procedure Call
Standard for all functions, even if this is not strictly necessary for
correct execution of the code. Specifying <samp><span class="option">-fomit-frame-pointer</span></samp>
with this option will cause the stack frames not to be generated for
leaf functions. The default is <samp><span class="option">-mno-apcs-frame</span></samp>.
<br><dt><code>-mapcs</code><dd><a name="index-mapcs-740"></a>This is a synonym for <samp><span class="option">-mapcs-frame</span></samp>.
<br><dt><code>-mthumb-interwork</code><dd><a name="index-mthumb_002dinterwork-741"></a>Generate code which supports calling between the ARM and Thumb
instruction sets. Without this option the two instruction sets cannot
be reliably used inside one program. The default is
<samp><span class="option">-mno-thumb-interwork</span></samp>, since slightly larger code is generated
when <samp><span class="option">-mthumb-interwork</span></samp> is specified.
<br><dt><code>-mno-sched-prolog</code><dd><a name="index-mno_002dsched_002dprolog-742"></a>Prevent the reordering of instructions in the function prolog, or the
merging of those instruction with the instructions in the function's
body. This means that all functions will start with a recognizable set
of instructions (or in fact one of a choice from a small set of
different function prologues), and this information can be used to
locate the start if functions inside an executable piece of code. The
default is <samp><span class="option">-msched-prolog</span></samp>.
<br><dt><code>-mhard-float</code><dd><a name="index-mhard_002dfloat-743"></a>Generate output containing floating point instructions. This is the
default.
<br><dt><code>-msoft-float</code><dd><a name="index-msoft_002dfloat-744"></a>Generate output containing library calls for floating point.
<strong>Warning:</strong> the requisite libraries are not available for all ARM
targets. Normally the facilities of the machine's usual C compiler are
used, but this cannot be done directly in cross-compilation. You must make
your own arrangements to provide suitable library functions for
cross-compilation.
<p><samp><span class="option">-msoft-float</span></samp> changes the calling convention in the output file;
therefore, it is only useful if you compile <em>all</em> of a program with
this option. In particular, you need to compile <samp><span class="file">libgcc.a</span></samp>, the
library that comes with GCC, with <samp><span class="option">-msoft-float</span></samp> in order for
this to work.
<br><dt><code>-mfloat-abi=</code><var>name</var><dd><a name="index-mfloat_002dabi-745"></a>Specifies which ABI to use for floating point values. Permissible values
are: `<samp><span class="samp">soft</span></samp>', `<samp><span class="samp">softfp</span></samp>' and `<samp><span class="samp">hard</span></samp>'.
<p>`<samp><span class="samp">soft</span></samp>' and `<samp><span class="samp">hard</span></samp>' are equivalent to <samp><span class="option">-msoft-float</span></samp>
and <samp><span class="option">-mhard-float</span></samp> respectively. `<samp><span class="samp">softfp</span></samp>' allows the generation
of floating point instructions, but still uses the soft-float calling
conventions.
<br><dt><code>-mlittle-endian</code><dd><a name="index-mlittle_002dendian-746"></a>Generate code for a processor running in little-endian mode. This is
the default for all standard configurations.
<br><dt><code>-mbig-endian</code><dd><a name="index-mbig_002dendian-747"></a>Generate code for a processor running in big-endian mode; the default is
to compile code for a little-endian processor.
<br><dt><code>-mwords-little-endian</code><dd><a name="index-mwords_002dlittle_002dendian-748"></a>This option only applies when generating code for big-endian processors.
Generate code for a little-endian word order but a big-endian byte
order. That is, a byte order of the form `<samp><span class="samp">32107654</span></samp>'. Note: this
option should only be used if you require compatibility with code for
big-endian ARM processors generated by versions of the compiler prior to
2.8.
<br><dt><code>-mcpu=</code><var>name</var><dd><a name="index-mcpu-749"></a>This specifies the name of the target ARM processor. GCC uses this name
to determine what kind of instructions it can emit when generating
assembly code. Permissible names are: `<samp><span class="samp">arm2</span></samp>', `<samp><span class="samp">arm250</span></samp>',
`<samp><span class="samp">arm3</span></samp>', `<samp><span class="samp">arm6</span></samp>', `<samp><span class="samp">arm60</span></samp>', `<samp><span class="samp">arm600</span></samp>', `<samp><span class="samp">arm610</span></samp>',
`<samp><span class="samp">arm620</span></samp>', `<samp><span class="samp">arm7</span></samp>', `<samp><span class="samp">arm7m</span></samp>', `<samp><span class="samp">arm7d</span></samp>', `<samp><span class="samp">arm7dm</span></samp>',
`<samp><span class="samp">arm7di</span></samp>', `<samp><span class="samp">arm7dmi</span></samp>', `<samp><span class="samp">arm70</span></samp>', `<samp><span class="samp">arm700</span></samp>',
`<samp><span class="samp">arm700i</span></samp>', `<samp><span class="samp">arm710</span></samp>', `<samp><span class="samp">arm710c</span></samp>', `<samp><span class="samp">arm7100</span></samp>',
`<samp><span class="samp">arm7500</span></samp>', `<samp><span class="samp">arm7500fe</span></samp>', `<samp><span class="samp">arm7tdmi</span></samp>', `<samp><span class="samp">arm7tdmi-s</span></samp>',
`<samp><span class="samp">arm8</span></samp>', `<samp><span class="samp">strongarm</span></samp>', `<samp><span class="samp">strongarm110</span></samp>', `<samp><span class="samp">strongarm1100</span></samp>',
`<samp><span class="samp">arm8</span></samp>', `<samp><span class="samp">arm810</span></samp>', `<samp><span class="samp">arm9</span></samp>', `<samp><span class="samp">arm9e</span></samp>', `<samp><span class="samp">arm920</span></samp>',
`<samp><span class="samp">arm920t</span></samp>', `<samp><span class="samp">arm922t</span></samp>', `<samp><span class="samp">arm946e-s</span></samp>', `<samp><span class="samp">arm966e-s</span></samp>',
`<samp><span class="samp">arm968e-s</span></samp>', `<samp><span class="samp">arm926ej-s</span></samp>', `<samp><span class="samp">arm940t</span></samp>', `<samp><span class="samp">arm9tdmi</span></samp>',
`<samp><span class="samp">arm10tdmi</span></samp>', `<samp><span class="samp">arm1020t</span></samp>', `<samp><span class="samp">arm1026ej-s</span></samp>',
`<samp><span class="samp">arm10e</span></samp>', `<samp><span class="samp">arm1020e</span></samp>', `<samp><span class="samp">arm1022e</span></samp>',
`<samp><span class="samp">arm1136j-s</span></samp>', `<samp><span class="samp">arm1136jf-s</span></samp>', `<samp><span class="samp">mpcore</span></samp>', `<samp><span class="samp">mpcorenovfp</span></samp>',
`<samp><span class="samp">arm1176jz-s</span></samp>', `<samp><span class="samp">arm1176jzf-s</span></samp>', `<samp><span class="samp">xscale</span></samp>', `<samp><span class="samp">iwmmxt</span></samp>',
`<samp><span class="samp">ep9312</span></samp>'.
<dt><code>-mtune=</code><var>name</var><dd><a name="index-mtune-750"></a>This option is very similar to the <samp><span class="option">-mcpu=</span></samp> option, except that
instead of specifying the actual target processor type, and hence
restricting which instructions can be used, it specifies that GCC should
tune the performance of the code as if the target were of the type
specified in this option, but still choosing the instructions that it
will generate based on the cpu specified by a <samp><span class="option">-mcpu=</span></samp> option.
For some ARM implementations better performance can be obtained by using
this option.
<br><dt><code>-march=</code><var>name</var><dd><a name="index-march-751"></a>This specifies the name of the target ARM architecture. GCC uses this
name to determine what kind of instructions it can emit when generating
assembly code. This option can be used in conjunction with or instead
of the <samp><span class="option">-mcpu=</span></samp> option. Permissible names are: `<samp><span class="samp">armv2</span></samp>',
`<samp><span class="samp">armv2a</span></samp>', `<samp><span class="samp">armv3</span></samp>', `<samp><span class="samp">armv3m</span></samp>', `<samp><span class="samp">armv4</span></samp>', `<samp><span class="samp">armv4t</span></samp>',
`<samp><span class="samp">armv5</span></samp>', `<samp><span class="samp">armv5t</span></samp>', `<samp><span class="samp">armv5te</span></samp>', `<samp><span class="samp">armv6</span></samp>', `<samp><span class="samp">armv6j</span></samp>',
`<samp><span class="samp">iwmmxt</span></samp>', `<samp><span class="samp">ep9312</span></samp>'.
<br><dt><code>-mfpu=</code><var>name</var><dt><code>-mfpe=</code><var>number</var><dt><code>-mfp=</code><var>number</var><dd><a name="index-mfpu-752"></a><a name="index-mfpe-753"></a><a name="index-mfp-754"></a>This specifies what floating point hardware (or hardware emulation) is
available on the target. Permissible names are: `<samp><span class="samp">fpa</span></samp>', `<samp><span class="samp">fpe2</span></samp>',
`<samp><span class="samp">fpe3</span></samp>', `<samp><span class="samp">maverick</span></samp>', `<samp><span class="samp">vfp</span></samp>'. <samp><span class="option">-mfp</span></samp> and <samp><span class="option">-mfpe</span></samp>
are synonyms for <samp><span class="option">-mfpu</span></samp>=`<samp><span class="samp">fpe</span></samp>'<var>number</var>, for compatibility
with older versions of GCC.
<p>If <samp><span class="option">-msoft-float</span></samp> is specified this specifies the format of
floating point values.
<br><dt><code>-mstructure-size-boundary=</code><var>n</var><dd><a name="index-mstructure_002dsize_002dboundary-755"></a>The size of all structures and unions will be rounded up to a multiple
of the number of bits set by this option. Permissible values are 8, 32
and 64. The default value varies for different toolchains. For the COFF
targeted toolchain the default value is 8. A value of 64 is only allowed
if the underlying ABI supports it.
<p>Specifying the larger number can produce faster, more efficient code, but
can also increase the size of the program. Different values are potentially
incompatible. Code compiled with one value cannot necessarily expect to
work with code or libraries compiled with another value, if they exchange
information using structures or unions.
<br><dt><code>-mabort-on-noreturn</code><dd><a name="index-mabort_002don_002dnoreturn-756"></a>Generate a call to the function <code>abort</code> at the end of a
<code>noreturn</code> function. It will be executed if the function tries to
return.
<br><dt><code>-mlong-calls</code><dt><code>-mno-long-calls</code><dd><a name="index-mlong_002dcalls-757"></a><a name="index-mno_002dlong_002dcalls-758"></a>Tells the compiler to perform function calls by first loading the
address of the function into a register and then performing a subroutine
call on this register. This switch is needed if the target function
will lie outside of the 64 megabyte addressing range of the offset based
version of subroutine call instruction.
<p>Even if this switch is enabled, not all function calls will be turned
into long calls. The heuristic is that static functions, functions
which have the `<samp><span class="samp">short-call</span></samp>' attribute, functions that are inside
the scope of a `<samp><span class="samp">#pragma no_long_calls</span></samp>' directive and functions whose
definitions have already been compiled within the current compilation
unit, will not be turned into long calls. The exception to this rule is
that weak function definitions, functions with the `<samp><span class="samp">long-call</span></samp>'
attribute or the `<samp><span class="samp">section</span></samp>' attribute, and functions that are within
the scope of a `<samp><span class="samp">#pragma long_calls</span></samp>' directive, will always be
turned into long calls.
<p>This feature is not enabled by default. Specifying
<samp><span class="option">-mno-long-calls</span></samp> will restore the default behavior, as will
placing the function calls within the scope of a `<samp><span class="samp">#pragma
long_calls_off</span></samp>' directive. Note these switches have no effect on how
the compiler generates code to handle function calls via function
pointers.
<br><dt><code>-mnop-fun-dllimport</code><dd><a name="index-mnop_002dfun_002ddllimport-759"></a>Disable support for the <code>dllimport</code> attribute.
<br><dt><code>-msingle-pic-base</code><dd><a name="index-msingle_002dpic_002dbase-760"></a>Treat the register used for PIC addressing as read-only, rather than
loading it in the prologue for each function. The run-time system is
responsible for initializing this register with an appropriate value
before execution begins.
<br><dt><code>-mpic-register=</code><var>reg</var><dd><a name="index-mpic_002dregister-761"></a>Specify the register to be used for PIC addressing. The default is R10
unless stack-checking is enabled, when R9 is used.
<br><dt><code>-mcirrus-fix-invalid-insns</code><dd><a name="index-mcirrus_002dfix_002dinvalid_002dinsns-762"></a><a name="index-mno_002dcirrus_002dfix_002dinvalid_002dinsns-763"></a>Insert NOPs into the instruction stream to in order to work around
problems with invalid Maverick instruction combinations. This option
is only valid if the <samp><span class="option">-mcpu=ep9312</span></samp> option has been used to
enable generation of instructions for the Cirrus Maverick floating
point co-processor. This option is not enabled by default, since the
problem is only present in older Maverick implementations. The default
can be re-enabled by use of the <samp><span class="option">-mno-cirrus-fix-invalid-insns</span></samp>
switch.
<br><dt><code>-mpoke-function-name</code><dd><a name="index-mpoke_002dfunction_002dname-764"></a>Write the name of each function into the text section, directly
preceding the function prologue. The generated code is similar to this:
<pre class="smallexample"> t0
.ascii "arm_poke_function_name", 0
.align
t1
.word 0xff000000 + (t1 - t0)
arm_poke_function_name
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
</pre>
<p>When performing a stack backtrace, code can inspect the value of
<code>pc</code> stored at <code>fp + 0</code>. If the trace function then looks at
location <code>pc - 12</code> and the top 8 bits are set, then we know that
there is a function name embedded immediately preceding this location
and has length <code>((pc[-3]) & 0xff000000)</code>.
<br><dt><code>-mthumb</code><dd><a name="index-mthumb-765"></a>Generate code for the 16-bit Thumb instruction set. The default is to
use the 32-bit ARM instruction set.
<br><dt><code>-mtpcs-frame</code><dd><a name="index-mtpcs_002dframe-766"></a>Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all non-leaf functions. (A leaf function is one that does
not call any other functions.) The default is <samp><span class="option">-mno-tpcs-frame</span></samp>.
<br><dt><code>-mtpcs-leaf-frame</code><dd><a name="index-mtpcs_002dleaf_002dframe-767"></a>Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all leaf functions. (A leaf function is one that does
not call any other functions.) The default is <samp><span class="option">-mno-apcs-leaf-frame</span></samp>.
<br><dt><code>-mcallee-super-interworking</code><dd><a name="index-mcallee_002dsuper_002dinterworking-768"></a>Gives all externally visible functions in the file being compiled an ARM
instruction set header which switches to Thumb mode before executing the
rest of the function. This allows these functions to be called from
non-interworking code.
<br><dt><code>-mcaller-super-interworking</code><dd><a name="index-mcaller_002dsuper_002dinterworking-769"></a>Allows calls via function pointers (including virtual functions) to
execute correctly regardless of whether the target code has been
compiled for interworking or not. There is a small overhead in the cost
of executing a function pointer if this option is enabled.
<br><dt><code>-mtp=</code><var>name</var><dd><a name="index-mtp-770"></a>Specify the access model for the thread local storage pointer. The valid
models are <samp><span class="option">soft</span></samp>, which generates calls to <code>__aeabi_read_tp</code>,
<samp><span class="option">cp15</span></samp>, which fetches the thread pointer from <code>cp15</code> directly
(supported in the arm6k architecture), and <samp><span class="option">auto</span></samp>, which uses the
best available method for the selected processor. The default setting is
<samp><span class="option">auto</span></samp>.
</dl>
</body></html>