for more information on these options, see also Programmers guide
-
-a
- Tells the compiler not to delete the assembler files it generates (not when using the
internal assembler). This also counts for the (possibly) generated batch script.
-
-al
- Tells the compiler to include the sourcecode lines in the assembler file as comments.
-
-an
- Tells the compiler to write node information in the assember 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
- tells the compiler to list register allocation and release info in the assembler file. This
is primarily intended for debugging the code generated by the compiler.
-
-at
- tells the compiler to list information about temporary allocations and deallocations in
the assembler file.
-
-Axxx
- specifies 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.
-
nasmcoff
- coff (Go32v2) file using Nasm.
-
nasmelf
- elf32 (Linux) file using Nasm.
-
nasmwin32
- Windows 32-bit file using Nasm.
-
nasmwdosx
- Windows 32-bit/DOSX file using Nasm.
-
nasmobj
- object file using Nasm.
-
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.
-
-B
- tells the compiler to re-compile all used units, even if the unit sources didn’t change since the
last compilation.
-
-b
- tells the compiler to 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
- is the same as -b but also generates information about local variables, types and
procedures.
-
-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.
-
-Cg
- enable generation of PIC code.
-
-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.
-
-Co
- Generate Integer overflow checking code. In case of integer errors, a run-time error will be
generated by your program.
-
-CpXXX
- set the processor type to XXX
-
-Cr
- Generate Range checking code. In case your program acesses an array element with an invalid
index, or if it increases an enumerated type beyond it’s 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.
-
-Csxxx
- Set stack size to xxx.
-
-Ct
- generate stack checking code. In case your program performs a faulty stack operation, a
run-rime error will be generated.
-
-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)
-
- -E Same as -Cn.
-
-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.
-
-gd
- generate debugging info for dbx.
-
-gg
- idem 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.)
-
-gv
- emit info for valgrind.
-
-gw
- emit dwarf debugging info.
-
-kxxx
- pass xxx to the linker.
-
-Oxxx
- optimize the compiler’s output; xxx can have one of the following values :
-
a
- specify alignment of structures.
-
g
- optimize for size, try to generate smaller code.
-
G
- optimize for time, try to generate faster code (default).
-
r
- keep certain variables in registers (experimental, use with caution).
-
u
- Uncertain optimizations
-
1
- Level 1 optimizations (quick optimizations).
-
2
- Level 2 optimizations (-O1 plus some slower optimizations).
-
3
- Level 3 optimizations (-O2 plus -Ou).
-
Pn
- (Intel only) Specify processor: n can be one of
-
1
- optimize for 386/486
-
2
- optimize for Pentium/PentiumMMX (tm)
-
3
- optimizations for PentiumPro/PII/Cyrix 6x86/K6 (tm)
The exact effect of these optimizations can be found in the Programmers guide.
-
-oxxx
- Tells the compiler to use xxx as the name of the output file (executable). 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.
-
-s
- Tells the compiler not to 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 some 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 must be run)
-
r
- Skip register allocation phase (optimizations will be disabled).
-
-Txxx
- Specifies the target operating system. xxx can be one of the following:
- emx : OS/2 via EMX (and DOS via EMX extender)
- freebsd : FreeBSD.
- go32v2 : dos and version 2 of the DJ DELORIE extender.
- 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.
- wince : Windows for handhelds (ARM processor) bit.
-
-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
-
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.
-
F
- Generate a FS application (+) or a console application (-).
-
G
- Generate a GUI application (+) or a console application (-).
-
N
- Do not generate relocation section.
-
R
- Generate a relocation section.
-
T
- Generate a TOOL application (+) or a console application (-).
-
-Xx
- 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 don’t 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)
- MXXX : Set the name of the program entry routine The default is ’main’.
- PXXX : Prepend binutils names with XXX for cross-compiling.
- rXXX : set library path to XXX.
- s : Strip the symbols from the executable.
- S : Link with static units (defines the FPC_LINK_STATIC symbol)
- t : link static. It passes the -static option to the linker.
- X : Link with smartlinked units (defines the FPC_LINK_SMART symbol)