Sign in Join
Wiki copytemporary

ARM compiler options: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: ARM compiler options

OldNewLine
1+## Overview
2+
3+The FPC compiler lets you create (cross)compilers for various [[ARM]] instruction sets, floating point units etc.
4+
5+Current (FPC 2.6.x/2.7.x) compilers (and RTL PPUs etc) are built for just one ABI and cannot output other ABIs once built - e.g. adding `-dFPC_ARMHF` when compiling a program will not change anything: <http://lists.freepascal.org/lists/fpc-devel/2013-May/032093.html>
6+
7+The options below are passed in OPTS= when building FPC. When building a cross compiler, some of them can/should be passed in CROSSOPT as well.
8+
9+## ABI
10+
11+ABIs are selected using the -Ca switch.
12+
13+> **Note:** Normally, specifying an ABI is not needed. Source: <http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg35496.html>
14+
15+- default: ?
16+- eabi: ?
17+- EABI HF is selected using `-dFPC_ARMHF`; the `-Ca eabihf` option is present but is not necessary (but may not hurt). (Source: <http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg35487.html>)
18+
19+## Instruction sets
20+
21+Instructions sets are selected using the `-Cp` switch. Possible instruction sets (note many sets are backward compatible):
22+
23+- ARMV3
24+- ARMV4
25+- ARMV4T
26+- ARMV5
27+- ARMV5T
28+- ARMV5TEJ
29+- ARMV6: e.g. in Raspberry Pi; will probably work on most current hardware
30+- ARMV6K
31+- ARMV6T2
32+- ARMV6Z
33+- ARMV7: e.g. in Nokia N900, Nokia N9, Nokia N950
34+- ARMV7A: e.g. in Odroid U2, Odroid U3
35+- ARMV7R
36+- ARMV7M
37+- ARMV7EM
38+
39+## Floating point support
40+
41+Floating point support coprocessor (FPU) options are selected with the `-Cf` switch Possible FPU support options:
42+
43+- soft: softfloat/no FPU support.
44+- vfpv2: e.g. on Raspberry Pi??
45+- vfpv3: e.g. on Odroid U2, Odroid U3
46+- vfpv3_d16
47+
48+...
49+
50+### Interactions
51+
52+Below adapted from: [1](http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg28056.html)
53+
54+- armel and armhf indicate how floating point (fp) values are passed.
55+ - Armel means that all floating point values are always passed in integer registers.
56+ - Armhf means that fp values are generally passed in floating point registers. As indicated above, armhf is settable by `-dFPC_ARMHF`; see above)
57+
58+- The softfp/vfpv2 distinction for armel indicates how the fp operations are performed.
59+ - Softfp means that all fp operations are performed by software
60+ - vfpv2, vfpv3 means that fp operations are performed by the hardware. Although fp values are still passed in integer registers, they're copied to fp registers before performing the operation.
61+
62+From an ABI point of view softfp and vfpv2 are compatible. However, vfpv2 executables will crash if run on a processor not having vfpv2 hardware.
63+
64+## Other relevant options
65+
66+- If you are using FPC 2.7.1+ and want to speed up floating point, you can also specify `-OoFASTMATH` to sacrifice precision for performance.
67+
68+## See also
69+
70+- [[Setup Cross Compile For ARM]]
71+
72+---
73+*From the Free Pascal wiki, page "ARM compiler options", as it stood on 2014-07-11 after a change by BigChimp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
74+Category: ARM
75+Category: FPC

Back to history