For more information on these options, see Programmer’s Guide.
-
-a
- Do not delete the assembler files (not applicable when using the internal assembler).
This also applies to the (possibly) generated batch script.
-
-al
- Include the source code lines in the assembler file as comments.
-
-an
- Write node information in the assembler file (nodes are the way the compiler represents
statements or parts thereof internally). This is primarily intended for debugging the
code generated by the compiler.
-
-ap
- Use pipes instead of creating temporary assembler files. This may speed up the compiler
on os/2 and linux. Only with assemblers (such as gnu if the internal assembler is
used.
-
-ar
- List register allocation and release info in the assembler file. This is primarily intended
for debugging the code generated by the compiler.
-
-at
- List information about temporary allocations and deallocations in the assembler file.
-
-Axxx
- specify what kind of assembler should be generated. Here xxx is one of the following
:
-
default
- Use the built-in default.
-
as
- Assemble using gnu as.
-
gas
- Assemble using gnu gas.
-
gas-darwin
- Assemble using gnu gas for darwin Mach-O64.
-
nasmcoff
- Coff (Go32v2) file using Nasm.
-
nasmelf
- Elf32 (linux) file using Nasm.
-
nasmwin32
- Windows 32-bit file using Nasm.
-
nasmwin64
- Windows 64-bit file using Nasm.
-
nasmwdosx
- Windows 32-bit/DOSX file using Nasm.
-
nasmdarwin
- Object file using Nasm.darwin Mach-O64 using GNU GAS
-
macho
- Mach-O (Darwin, Intel 32 bit) using internal writer.
-
masm
- Object file using Masm (Microsoft).
-
tasm
- Object file using Tasm (Borland).
-
elf
- Elf32 (linux) using internal writer.
-
coff
- Coff object file (Go32v2) using the internal binary object writer.
-
pecoff
- PECoff object file (Win32) using the internal binary object writer.
-
wasm
- Object file using wasm (Watcom).
-
yasm
- Object file using yasm (experimental).
-
-B
- Re-compile all used units, even if the unit sources didn’t change since the last compilation.
-
-b
- Generate browser info. This information can be used by an Integrated Development
Environment (IDE) to provide information on classes, objects, procedures, types and
variables in a unit.
-
-bl
- The same as -b but also generates information about local variables, types and
procedures.
-
-C3
- Turn on (or off) IEEE error checking for constants.
-
-Caxxx
- Set the ABI (Application Binary Interface) to xxx. The -i option gives the possible values
for xxx.
-
-Cb
- Generate big-endian code.
-
-Cc
- Set the default calling convention used by the compiler.
-
-CD
- Create a dynamic library. This is used to transform units into dynamically linkable libraries
on linux.
-
-Ce
- Emulate floating point operations.
-
-Cfxxx
- Set the used floating point processor to xxx. fpc -i lists all possible values.
-
-CFNN
- Set the minimal floating point precision to NN. Possible values are 32 and
64.
-
-Cg
- Enable generation of PIC code. This should only be necessary when generating libraries on
linux or other Unices.
-
-Chxxx
- Reserves xxx bytes heap. xxx should be between 1024 and 67107840.
-
-Ci
- Generate Input/Output checking code. In case some input/output code of your program
returns an error status, the program will exit with a run-time error. Which error is generated
depends on the I/O error.
-
-Cn
- Omit the linking stage.
-
-CN
- Generate nil-pointer checks (AIX-only).
-
-Co
- Generate Integer overflow checking code. In case of integer errors, a run-time error will be
generated by your program.
-
-CO
- Check for possible overflow of integer operations.
-
-CpXXX
- Set the processor type to XXX.
-
-CPX=N
- Set the packing for X to N. X can be PACKSET, PACKENUM or PACKRECORDS,
and N can be a value of 1,2,4,8 or one of the keywords DEFAULT (0) or NORMAL.
PACKRECORDS supports also values 16 and 32. (see the Programmer’s Guide for more
info).
-
-Cr
- Generate Range checking code. If your program accesses an array element with an invalid
index, or if it increases an enumerated type beyond its scope, a run-time error will be
generated.
-
-CR
- Generate checks when calling methods to verify if the virtual method table for that object is
valid. It will also insert an type check in case of typecasts.
-
-Csxxx
- Set stack size to xxx.
-
-Ct
- Generate stack checking code. If your program performs a faulty stack operation, a run-rime
error will be generated.
-
-CTNNN
- Target specific code generation options:
-
cld
- Emit a CLD instruction before using the x86 string instructions
-
-CX
- Create a smartlinked unit when writing a unit. Smartlinking will only link in the code parts
that are actually needed by the program. All unused code is left out. This can lead to
substantially smaller binaries.
-
-dxxx
- Define the symbol name xxx. This can be used to conditionally compile parts of your
code.
-
-D
- Generate a DEF file (for OS/2).
-
-Dd
- Set the description of the executable/library (Windows).
-
-Dv
- Set the version of the executable/library (Windows).
-
-Dw
- PM application (for OS/2)
-
-E
- Same as -Cn.
-
-fPIC
- same as -Cg.
-
-g
- Generate debugging information for debugging with gdb.
-
-gc
- Generate checks for pointers. This must be used with the -gh command line option.
When this options is enabled, it will verify that all pointer accesses are within the
heap.
-
-gg
- Same as -g.
-
-gh
- Use the heaptrc unit (see Unit Reference). (Produces a report about heap usage after the
program exits)
-
-gl
- Use the lineinfo unit (see Unit Reference). (Produces file name/line number information if the
program exits due to an error.)
-
-goXXX
- set debug information options. One of the options is dwarfsets: It enables
dwarf set debug information (this does not work with gdb versions prior to 6.5.
stabsabsincludes tells the compiler to store absolute/full include file paths in stabs.
dwarfmethodclassprefix tells the compiler to prefix method names in DWARF with class
name. item [-gp] Preserve case in stabs symbol names. Default is to uppercase all
names.
-
-gs
- Write stabs debug information.
-
-gt
- Trash local variables. This writes a random value to local variables at procedure start.
This can be used to detect uninitialized variables. The t can be specified multiple
times
-
-gv
- Emit info for valgrind. Note: this will include the cmem unit in your executable, replacing the
default memory manager with the C memory manager.
-
-gw
- Emit dwarf debugging info (version 2).
-
-gw2
- Emit dwarf debugging info (version 2).
-
-gw3
- Emit dwarf debugging info (version 3).
-
-gw4
- Emit dwarf debugging info (version 4, experimental).
-
-kxxx
- Pass xxx to the linker.
-
-Oxxx
- Optimize the compiler’s output; xxx can have one of the following values :
-
aPARAM=VALUE
- Specify alignment of structures and code. PARAM determines
what should be aligned; VALUE specifies the alignment boundary. See the
Programmer’s Guide for a description of the possible values.
-
1
- Level 1 optimizations (quick and debugger-friendly optimizations).
-
2
- Level 2 optimizations (-O1 plus quick optimizations).
-
3
- Level 3 optimizations (-O2 plus slower optimizations).
-
4
- Level 4 optimizations (-O3 plus optimizations that might have side effects).
-
oNNN
- Specify individual optimizations: NNN can be one of
-
REGVAR
- Use register variables
-
UNCERTAIN
- Uncertain optimizations (use with care)
-
STACKFRAME
- Skip stack frames
-
PEEPHOLE
- Peephole optimizations
-
ASMCSE
- Common subexpression elimination at the assembler level (i386-only,
deprecated)
-
LOOPUNROLL
- Unroll (small) loops
-
TAILREC
- Change tail recursion to non-recursive loop
-
CSE
- Common subexpression elimination
-
DFA
- Enable Data Flow Analysis
-
USEEBP
- Use the EBP/RBP register to hold variables (x86-only)
-
ORDERFIELDS
- Reorder class instance fields if this results in better alignment
-
FASTMATH
- Fast math operations (may reduce floating point precision)
-
REMOVEEMPTYPROCS
- Remove calls to empty procedures.
-
CONSTPROP
- Constant propagation (experimental, requires -Oodfa)
-
pxxx
- select processor xxx to optimize for. fpc -i lists all available processor instruction
sets.
-
Wxxx
- Generate Whole-Program-Optimization information for feature xxx. fpc -i will
generate a list of possible values.
-
wxxx
- Perform Whole-Program-Optimization information for feature xxx. fpc -i will
generate a list of possible values.
-
s
- Optimize for size rather than speed.
The exact effect of some of these optimizations can be found in the Programmer’s
Guide.
-
-oxxx
- Use xxx as the name of the output file (executable). For use only with programs. The
output filename can contain a path, and if it does, it will override any previous
-FE setting. If the output filename does not contain a path, the -FE setting is
observed.
-
-pg
- Generate profiler code for gprof. This will define the symbol FPC_PROFILE, which can be used
in conditional defines.
-
-PB
- Show default Target CPU compiler binary
-
-PP
- Show default target cpu
-
-Pxxx
- Set target CPU (arm,avr,i386,jvm,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64)
]
-
-s
- Do not call the assembler and linker. Instead, the compiler writes a script, PPAS.BAT under
dos, or ppas.sh under linux, which can then be executed to produce an executable. This can
be used to speed up the compiling process or to debug the compiler’s output. This option can
take an extra parameter, mainly used for cross-compilation. It can have one of the following
values:
-
h
- Generate script to link on host. The generated script can be run on the compilation
platform (host platform).
-
t
- Generate script to link on target platform. The generated script can be run on the
target platform. (where the binary is intended to be run)
-
r
- Skip register allocation phase (optimizations will be disabled).
-
-Txxx
- Specify the target operating system. xxx can be one of the following:
- darwin : Darwin Mac OS/X.
- emx : OS/2 via EMX (and DOS via EMX extender).
- freebsd : FreeBSD.
- go32v2 : dos and version 2 of the DJ DELORIE extender.
- iphonesim : iPhone simulator.
- linux : linux.
- netbsd : NetBSD.
- netware : Novell Netware Module (clib).
- netwlibc : Novell Netware Module (libc).
- openbsd : OpenBSD.
- os2 : OS/2 (2.x) using the EMX extender.
- sunos : SunOS/Solaris.
- watcom : Watcom compatible DOS extender
- wdosx : WDOSX extender.
- win32 : Windows 32 bit.
- win64 : Windows 64 bit.
- wince : Windows for handhelds (ARM processor).
The available list of targets depends on the actual compiler binary. Use fpc -i to get a list
of targets supported by the compiler binary.
-
-uxxx
- Undefine the symbol xxx. This is the opposite of the -d option.
-
-Ur
- Generate release unit files. These files will not be recompiled, even when the sources are
available. This is useful when making release distributions. This also overrides the -B option
for release mode units.
-
-W
- Set some Windows or os/2 attributes of the generated binary. It can be one or more of the
following
-
A
- Specify native type application (Windows)
-
b
- Create a bundle instead of a library (Darwin)
-
B
- Create arelocatable image (Windows)
-
Bhhh
- Set preferred base address to hhh (a hexadecimal address)
-
C
- Generate a console application (+) or a gui application (-).
-
D
- Force use of Def file for exports.
-
e
- Use external resources (Darwin)
-
F
- Generate a FS application (+) or a console application (-).
-
G
- Generate a GUI application (+) or a console application (-).
-
i
- Use internal (FPC) resources (Darwin)
-
I
- Turn on/off the usage of import sections (Windows)
-
Mnnn
- Minimum Mac OS X deployment version: nnn equals 10.4, 10.5.1, ... (Darwin)
-
N
- Do not generate a relocation section.
-
PXXX
- Minimum iOS deployment version needed (iphonesim) XXX is one of 8.0,
8.0.2, etc.
-
R
- Generate a relocation section.
-
T
- Generate a TOOL application (+) or a console application (-).
-
X
- Enable use of an executable stack (Linux)
-
-Xx
- Specify executable options. This tells the compiler what kind of executable should be
generated. The parameter x can be one of the following:
- c : (linux only) Link with the C library. You should only use this when you start
to port Free Pascal to another operating system.
- d Do not use the standard library path. This is needed for cross-compilation, to
avoid linking with the host platform’s libraries.
- D : Link with dynamic libraries (defines the FPC_LINK_DYNAMIC symbol)
- e use external (GNU) linker.
- f Substitute pthread library name for linking (BSD).
- g Create debug information in a separate file and add a debuglink section to
executable.
- i use internal linker.
- LA Define library name substitutions for the linking stage.
- LO Define the order of library linking.
- LD Exclude default order of standard libraries.
- MXXX : Set the name of the program entry routine. The default is ’main’.
- m : Generate linker map file.
- n : Use target system native linker instead of GNU ld (Solaris, AIX)
- pXXX : First search for the compiler binary in the directory XXX. (fpc command
only).
- PXXX : Prepend binutils names with XXX for cross-compiling.
- rXXX : Set library path to XXX.
- Rxxx Prepend xxx to all linker search paths. (used for cross compiling).
- s : Strip the symbols from the executable.
- S : Link with static units (defines the FPC_LINK_STATIC symbol).
- t : Link static (passes the -static option to the linker).
- v : Generate table for Virtual Entry calls.
- X : Link with smartlinked units (defines the FPC_LINK_SMART symbol).