ARM compiler options: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | - | ||
| 4 | - | ||
| 5 | - | ||
| 6 | - | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 11 | 1 | ## Overview | |
| 12 | 2 | ||
| 13 | - | ||
| 3 | + | The FPC compiler lets you create (cross)compilers for various [[ARM]] instruction sets, floating point units etc. | |
| 14 | 4 | ||
| 15 | 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> | |
| 16 | 6 | ||
| 17 | - | ||
| 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. | |
| 18 | 8 | ||
| 19 | 9 | ## ABI | |
| 20 | 10 | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - | ||
| 11 | + | ABIs are selected using the -Ca switch. | |
| 24 | 12 | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - | ||
| 13 | + | > **Note:** Normally, specifying an ABI is not needed. Source: <http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg35496.html> | |
| 28 | 14 | ||
| 29 | - | ||
| 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>) | |
| 30 | 18 | ||
| 31 | 19 | ## Instruction sets | |
| 32 | 20 | ||
| 33 | - | ||
| 21 | + | Instructions sets are selected using the `-Cp` switch. Possible instruction sets (note many sets are backward compatible): | |
| 34 | 22 | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 40 | - | ||
| 41 | - | ||
| 42 | - | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 47 | - | ||
| 48 | - | ||
| 49 | - | ||
| 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 | |
| 50 | 38 | ||
| 51 | 39 | ## Floating point support | |
| 52 | 40 | ||
| 53 | - | ||
| 41 | + | Floating point support coprocessor (FPU) options are selected with the `-Cf` switch Possible FPU support options: | |
| 54 | 42 | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 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 | |
| 59 | 47 | ||
| 60 | - | ||
| 48 | + | ... | |
| 61 | 49 | ||
| 62 | 50 | ### Interactions | |
| 63 | 51 | ||
| 64 | - | ||
| 52 | + | Below adapted from: [1](http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg28056.html) | |
| 65 | 53 | ||
| 66 | - | ||
| 67 | - | ||
| 68 | - | ||
| 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) | |
| 69 | 57 | ||
| 70 | - | ||
| 71 | - | ||
| 72 | - | ||
| 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. | |
| 73 | 61 | ||
| 74 | - | ||
| 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. | |
| 75 | 63 | ||
| 76 | 64 | ## Other relevant options | |
| 77 | 65 | ||
| 78 | - | ||
| 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. | |
| 79 | 67 | ||
| 80 | 68 | ## See also | |
| 81 | 69 | ||
| 82 | - | ||
| 70 | + | - [[Setup Cross Compile For ARM]] | |
| 83 | 71 | ||
| 84 | 72 | --- | |
| 85 | - | ||
| 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 |
