MAN page from OpenSuSE fpc-3.2.2-bp154.2.37.x86_64.rpm
Section: Free Pascal Compiler (1)
Updated: 22 feb 2002Index
fpc - Free Pascal Compiler (FPC) binary
fpc [options] [sourcefile]
This binary is the main binary of theFree Pascal Compiler (FPC)
which is aTurbo Pascal
compatible standalone (non GCC frontend) multitarget Pascal compiler.
The compiler usesLD(1)and can useAS(1)(see parameter -Aas), but also has its own binary object writer.
The current main targets areGo32V2(Dos DJGPP extender),Freebsd,Linux,MacOS,MacOSX,MorphOS,Netware,OS/2andWin32.The other targets (M68K compilers for Atari and Amiga) are either based on olderversions of the compiler or are still in development.
This manpage is meant for quick-reference only. FPC comes with a great (2000+ pages)manual, which is updated constantly, while this man page can be out of date.
Starting with release 1.0, a new versioning system has been implemented. If the last number is even (1.0, 1.0.2), it is stable, and if the last number is odd it is a daily changing development version.(1.0.5, 1.1) just like the linux kernel.
Version 0.99.5 however is a stable release. It was made before the even/odd versionnaming system was introduced.
The compilation process is started by typingfpcfollowed by a sourcefile name (normally with .pas or .pp extension). Before processing the actual processing of the source file,fpc.cfg(5)the configuration file of the compiler is read which contains the location of theRTL, other packages (FCL, FreeVision), and optionally default values for someswitches. See the separate manpage offpc.cfg(5)for more information.
- if you specify this option, the compiler outputs a list of all options,and exits after that.
- idem as -h, but waiting after every screenfull for the enter key.
- This option tells the compiler to print the copyright information.
You can give it an option, as -ixxx where "xxx" can be one of thefollowing:
- Returns the compiler date.
- Returns the compiler version.
- Returns the compiler OS.
- Returns the compiler processor.
- Returns the target OS.
- Returns the target Processor.
- At the top print a line stating which program this is and its version.
- Tells the compiler not to read the configuration filefpc.cfg(5)
Options for getting feedback
- Be verbose. "xxx" is a combination of the following:
- Tells the compiler to show only errors. This option is on by default.
- Tells the compiler to show some general information.
- Tells the compiler to issue warnings.
- Tells the compiler to issue notes.
- Tells the compiler to issue hints.
- Tells the compiler to show the line numbers as it processes afile. Numbers are shown per 100.
- Tells the compiler to print the names of the files it opens.
- Tells the compiler to print the names of the files it triesto open.
- Tells the compiler to print the names of procedures andfunctions as it is processing them.
- Tells the compiler to warn you when it processes aconditional.
- Tells the compiler to write which macros are defined.
- Tells the compiler to write other debugging info.
- Tells the compiler to write all possible info. (this is thesame as specifying all options)
- Tells the compiler to write no messages. This is useful whenyou want to override the default setting in the configuration file.
- Tells the compiler to show all procedure declarations if anoverloaded function error occurs.
- Tells the compiler to output some executable info (for Win32platform only).
- Rhide/GCC compatibility mode: formats the error differently, so theyare understood by RHIDE.
Options concerning files and directories
- tells the compiler that xxxis the directory where it can find the executables as (the assembler) and ld (the linker).
- same as-e.
- This option tells the compiler to write errors, etc. tothe file xxx
- set the executable/unit output path toxxx
- adds xxxto the path where the compiler searches for its include files.
- Adds xxxto the library searching path, and is passe to the linker.
- ( Linux only) Tells the compiler to use xxxas the dynamic linker. Default this is /lib/ld-linux.so.2, orlib/ld-linux.so.1, depending on which one is found.
- Adds xxxto the object file path. This path is usedwhen looking for files that need to be linked in.
- tells the compiler that xxxcontains the compiler messages. Default the compiler has built-in messages. Specifying this option will override the default messages.(useful if you want to use a language other than the default language).
- Addsxxxto the unit path.By default, the compiler only searches for units in the current directoryand the directory where the compiler itself resides. This option tells thecompiler also to look in the directory xxx
- Tells the compiler to write units in directory xxxinstead of the current directory.
- Add xxxto the include file search path.This path is used when looking for include files.
Options controlling the kind of outputfor more information on these options, see also the programmers manual.
- Tells the compiler not to delete the assembler file.This also counts for the (possibly) generated batch script.
- Tells the compiler to include the sourcecode linesin the assembler file as comments.
- Tells the compiler to include node information in the generated assembler file.This is mainly for use by the compiler developers.
- Tells the compiler to use pipes to communicate with the assembler.
- Tells the compiler to include register allocation/deallocation information.
- Tells the compiler to include temporary register allocation/deallocation information.
- specifies what kind of assembler should be generated . Herexxxis one of the following :
- A unix .o (object) file, usingGNU AS
- coff object file (go32) using internal writer.
- Use the default writer for the current platform.
- elf object file (linux, 32-bit only) using internal writer.
- a coff file using thenasmassembler.
- a ELF32 file (LINUX only) using thenasmassembler.
- a obj file using thenasmassembler.
- An obj file using the Microsoftmasmassembler.
- pecoff object file (win32) using internal writer.
- An obj file using the Borlandtasmassembler.
- An obj file using the Watcom assembler.
- set the default calling convention to XXX.
- Create dynamic library.
- Compile using emulated floating point instructions.
- Set the used floating point instruction set to xxx.
- Generate PIC code.
- Reserves xxxbytes heap. xxxshould be between 1024 and 67107840.
- Generate Input/Output checking code.
- Omit the linking stage.
- Generate Integer overflow checking code.
- Verify object call validity (method calls mustbe valid).
- Generate Range checking code.
- Set stack size to xxxbytes.
- generate stack checking code.
- Create a smartlinked library.
- Define the symbol name xxxThis can be used to conditionally compile parts of your code.
- Same as -Cn.
- Generate debugging information for debugging withGDB
- idem as -g.
- generate debugging info for dbx.
- use the heaptrc unit (see the units part of the FPC manual).
- use the lineinfo unit for line information (see the units part of the FPC manual).
- Generate information for debugging with valgrind.
- Generate DWARF debugging information.
- optimize the compiler's output; xxxcan have one of the following values :
- optimize for size, try to generate smaller code.
- optimize for time, try to generate faster code (default).
- keep certain variables in registers (experimental, use with caution).
- uncertain optimizations
- Level 1 optimizations (quick optimizations).
- Level 2 optimizations (-O1 plus some slower optimizations).
- Level 3 optimizations (-O2 plus -Ou).
- Specify processor : n can be one of
- optimize for 386/486
- optimize for Pentium/PentiumMMX (tm)
- optimizations for PentiumPro / P-II / Cyrix 6x86 / K6 (tm)
The exact effect of these effects can be found in the programmers part of the manual.
- Tells the compiler to use xxxas the name of the output file (executable). Only with programs.
- Generate profiler code for gprof.
- Tells the compiler not to call the assembler and linker.Instead, the compiler writes a script, PPAS.BAT under DOS, orppas.sh under Linux, which can then be executed to produce anexecutable.
- Tells the compiler to generate a script that can be used to assemble and link on the host system, not on the target system. Use this when cross-compiling.
- Skip register allocation stage in compiler (use with -ar)
- Tells the compiler to generate a script that can be used to assemble and link on the target system, not on the host system. Use this when cross-compiling.
- Specifies the target operating system. xxxcan be one of the following:
- OS/2 and DOS via the EMX extender.
- DOS and version 2 of the DJ DELORIE extender.
- Novell Netware module (clib)
- Novell Netware module (libc)
- OS/2 (native mode)
- Solaris SunOS
- WatCOM dos extender
- WDosX Dos extender
- Windows 32 bit.
- undefine the symbol xxxif it is defined. This is the opposite of the -d option.
- Executable options. These tell the compiler whatkind of executable should be generated. the parameter xcan be one of the following:
- (Linux only, obsolete) Link with the C library. You should only use this whenyou start to port Free Pascal to another operating system.
- Link with dynamic libraries (defines the FPC_LINK_DYNAMIC symbol)
- Don't use the standard library path. Use this when cross-compiling, to avoidlinking with the host OS libraries.
- Prepend the names of binutils (as, ld) with xxx. For use when cross-compiling.
- Set the library search path to xxx.
- Strip the symbols from the executable.
- Link with static libraries (defines the FPC_LINK_STATIC symbol)
- Link statically (passes -static to the linker)
- Link smart. Using this option sets the FPC_LINK_SMART symbol.
Options concerning the sources (language options)for more information on these options, see also in the Programmers Manual
- Specify the language mode. modecan be one of the following:
- Delphi-compatibility mode. This loads the objpas unit, and switches on ansistring mode (-Sh).
- Default mode.
- GNU pascal mode (does nothing at the moment)
- Mac pascal mode. This loads the macpas unit and switches on some Mac extensions(mainly macros)
- Object Pascal mode. This loads the objpas unit.
- Turbo Pascal mode.
- Specifies what assembler you use in your "asm" assembler codeblocks. Here xxxis one of the following:
- Asm blocks contain AT&T assembler.
- Asm blocks contain Intel assembler.
- Use default assembler for the selected platform.
- Switch on Delphi 2 extensions.
- Generate code for assertions.
- Support C-style operators, i.e. *=, +=, /= and -=.
- Tries to be Delphi compatible
- The compiler stops after the first error. Normally,the compiler tries to continue compiling after an error, until 50 errors arereached, or a fatal error is reached, and then it stops. With this switch,the compiler will stop after the first error.
- Support the label and goto commands.
- use ansistrings by default.
- Specify the kind of interfaces. xxxcan be one of the following:
- use COM interfaces. (all interfaces descend from IUnknown)
- use CORBA interfaces. (no inheritance is supposed)
- Support C++ style INLINE.
- Support C-style macros.
- Try to be Borland TP 7.0 compatible (no functionoverloading etc.).
- Try to beGPC (GNU Pascal Compiler)compatible.
- The name of constructors must be "init", and thename of destructors should be "done".
- Allow the "static" keyword in objects.
- Do not check the unit name. Normally, the unit nameis the same as the filename. This option allows both to be different.
- Create a release unit. This sets a special flag in the unit, causing the compiler not to look for sources.
- Compile a system unit. This option causes thecompiler to define only some very basic types.
- Version number
- SEE ALSO
This document was created byman2html,using the manual pages.