ARM compiler options: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## Contents | |
| 2 | + | ||
| 3 | + | * 1 Overview | |
| 4 | + | * 2 ABI | |
| 5 | + | * 3 Instruction sets | |
| 6 | + | * 4 Floating point support | |
| 7 | + | * 4.1 Interactions | |
| 8 | + | * 5 Other relevant options | |
| 9 | + | * 6 See also | |
| 10 | + | ||
| 1 | 11 | ## Overview | |
| 2 | 12 | ||
| 3 | - | ||
| 13 | + | The FPC compiler lets you create (cross)compilers for various [[ARM]] instruction sets, floating point units etc. | |
| 4 | 14 | ||
| 5 | 15 | 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 | 16 | ||
| 7 | - | ||
| 17 | + | 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 | 18 | ||
| 9 | 19 | ## ABI | |
| 10 | 20 | ||
| 11 | - | ||
| 21 | + | ABIs are selected using the -Ca switch. | |
| 12 | 22 | ||
| 13 | - | ||
| 23 | + |  **Note:** Normally, specifying an ABI is not needed. Source: <http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg35496.html> | |
| 14 | 24 | ||
| 15 | - | ||
| 16 | - | ||
| 17 | - | ||
| 25 | + | * default: ? | |
| 26 | + | * eabi: ? | |
| 27 | + | * 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 | 28 | ||
| 29 | + | ||
| 30 | + | ||
| 19 | 31 | ## Instruction sets | |
| 20 | 32 | ||
| 21 | - | ||
| 33 | + | Instructions sets are selected using the `-Cp` switch. Possible instruction sets (note many sets are backward compatible): | |
| 22 | 34 | ||
| 23 | - | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - | ||
| 35 | + | * ARMV3 | |
| 36 | + | * ARMV4 | |
| 37 | + | * ARMV4T | |
| 38 | + | * ARMV5 | |
| 39 | + | * ARMV5T | |
| 40 | + | * ARMV5TEJ | |
| 41 | + | * ARMV6: e.g. in Raspberry Pi; will probably work on most current hardware | |
| 42 | + | * ARMV6K | |
| 43 | + | * ARMV6T2 | |
| 44 | + | * ARMV6Z | |
| 45 | + | * ARMV7: e.g. in Nokia N900, Nokia N9, Nokia N950 | |
| 46 | + | * ARMV7A: e.g. in Odroid U2, Odroid U3 | |
| 47 | + | * ARMV7R | |
| 48 | + | * ARMV7M | |
| 49 | + | * ARMV7EM | |
| 38 | 50 | ||
| 39 | 51 | ## Floating point support | |
| 40 | 52 | ||
| 41 | - | ||
| 53 | + | Floating point support coprocessor (FPU) options are selected with the `-Cf` switch Possible FPU support options: | |
| 42 | 54 | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 55 | + | * soft: softfloat/no FPU support. | |
| 56 | + | * vfpv2: e.g. on Raspberry Pi?? | |
| 57 | + | * vfpv3: e.g. on Odroid U2, Odroid U3 | |
| 58 | + | * vfpv3_d16 | |
| 47 | 59 | ||
| 48 | - | ||
| 60 | + | ... | |
| 49 | 61 | ||
| 50 | 62 | ### Interactions | |
| 51 | 63 | ||
| 52 | - | ||
| 64 | + | Below adapted from: [[1]](<http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg28056.html>) | |
| 53 | 65 | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 66 | + | * armel and armhf indicate how floating point (fp) values are passed. | |
| 67 | + | * Armel means that all floating point values are always passed in integer registers. | |
| 68 | + | * Armhf means that fp values are generally passed in floating point registers. As indicated above, armhf is settable by `-dFPC_ARMHF`; see above) | |
| 57 | 69 | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 70 | + | * The softfp/vfpv2 distinction for armel indicates how the fp operations are performed. | |
| 71 | + | * Softfp means that all fp operations are performed by software | |
| 72 | + | * 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 | 73 | ||
| 62 | - | ||
| 74 | + | 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 | 75 | ||
| 64 | 76 | ## Other relevant options | |
| 65 | 77 | ||
| 66 | - | ||
| 78 | + | * 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 | 79 | ||
| 68 | 80 | ## See also | |
| 69 | 81 | ||
| 70 | - | ||
| 82 | + | * [[Setup Cross Compile For ARM]] | |
| 71 | 83 | ||
| 72 | 84 | --- | |
| 73 | - | ||
| 74 | - | ||
| 75 | - | ||
| 85 | + | *From the Free Pascal wiki, page "ARM compiler options", as the Internet Archive kept it on 2024-05-28. 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).* |
