|
@@ -554,7 +554,7 @@ ppc386 -k-lc foo.pp
|
|
|
|
|
|
For classes that are compiled in the \var{\{\$M+ \}} or \var{\{\$TYPEINFO ON\}}
|
|
|
state, the compiler will generate Run-Time Type Information (RTTI). All
|
|
|
-descendent objects of an object that was compiled in the \var{$M+} state
|
|
|
+descendent objects of an object that was compiled in the \var{\{\$M+\}} state
|
|
|
will get RTTI information too, as well as any published classes.
|
|
|
By default, no Run-Time Type Information is generated. The \var{TPersistent}
|
|
|
object that is present in the FCL (Free Component Library) is generated in
|
|
@@ -4452,8 +4452,8 @@ Either the result will not link, or the binary will give errors.
|
|
|
compiler needs to know about (a new default assembler mechanism, for
|
|
|
example).
|
|
|
\end{enumerate}
|
|
|
-How to know if one of these things has occurred ? There is no way to know.
|
|
|
-(except by mailing the \fpc team) Iff you cannot recompile the compiler
|
|
|
+How to know if one of these things has occurred ? There is no way to know,
|
|
|
+except by mailing the \fpc team. If you cannot recompile the compiler
|
|
|
when you first compile the RTL, then try the other way.
|
|
|
|
|
|
\section{Compiling using \file{make}}
|
|
@@ -4475,7 +4475,7 @@ The above instructions will do the following:
|
|
|
\begin{enumerate}
|
|
|
\item Using the current compiler, the RTL is compiled in the correct
|
|
|
directory, which is determined by the OS you are under. e.g. under \linux,
|
|
|
-the rtl is compile in diretory \file{rtl/linux}.
|
|
|
+the RTL is compiled in directory \file{rtl/linux}.
|
|
|
\item The compiler is compiled using the newly compiled RTL. If successful,
|
|
|
the newly compiled compiler executable is copied to a temporary executable.
|
|
|
\item Using the temporary executable from the previous step, the RTL is
|
|
@@ -4517,7 +4517,7 @@ compiler:
|
|
|
make cycle PP=./ppc386
|
|
|
\end{verbatim}
|
|
|
This will do the \var{make cycle} from above, but will start with the compiler
|
|
|
-that was generated by the var{make all} instruction.
|
|
|
+that was generated by the \var{make all} instruction.
|
|
|
|
|
|
In all cases, many options can be passed to \var{make} to influence the
|
|
|
compile process. In general, the makefiles add any needed compiler options
|
|
@@ -4528,7 +4528,7 @@ specify additional options (e.g. optimization options) by passing them in
|
|
|
\section{Compiling by hand}
|
|
|
|
|
|
Compiling by hand is difficult and tedious, but can be done. We'll treat the
|
|
|
-compilation of RTl and compiler separately.
|
|
|
+compilation of RTL and compiler separately.
|
|
|
|
|
|
\subsection{Compiling the RTL}
|
|
|
To recompile the RTL, so a new compiler can be built, at least the following
|
|
@@ -4536,7 +4536,7 @@ units must be built, in the order specified:
|
|
|
\begin{enumerate}
|
|
|
\item[loaders] the program stubs, that are the startup code for each pascal
|
|
|
program. These files have the \file{.as} extension, because they are written
|
|
|
-in assembler. They must be assembled with the gnu as assembler. These stubs
|
|
|
+in assembler. They must be assembled with the \gnu \file{as} assembler. These stubs
|
|
|
are in the OS-dependent directory, except for \linux, where they are in a
|
|
|
processor dependent subdirectory of the linux directory (\file{i386} or
|
|
|
\file{m68k}).
|
|
@@ -4553,7 +4553,8 @@ This unit resides in the OS-depentent subirectories of the RTL.
|
|
|
subdirectory of the RTL.
|
|
|
\item[dos] The \file{dos} unit. It resides in the OS-dependent subdirectory
|
|
|
of the RTL. Possibly other units will be compiled as a consequence of trying
|
|
|
-to compile this unit (e.g. on \linux, the \file{linux} unit will be compiled)
|
|
|
+to compile this unit (e.g. on \linux, the \file{linux} unit will be
|
|
|
+compiled, on go32, the \file{go32} unit will be compiled).
|
|
|
\item[objects] the objects unit. It resides in the \file{inc} subdirectory
|
|
|
of the RTL.
|
|
|
\end{enumerate}
|
|
@@ -4575,16 +4576,19 @@ Depending on the target OS there are other units that you may wish to
|
|
|
compile, but which are not strictly needed to recompile the compiler.
|
|
|
The following units are available for all plaforms:
|
|
|
\begin{description}
|
|
|
-\item[objpas] Needed for Delphi mode. needs \var{-S2} as an option. Resides
|
|
|
-in the \file{inc} subdirectory.
|
|
|
+\item[objpas] Needed for Delphi mode. Needs \var{-S2} as an option. Resides
|
|
|
+in the \file{objpas} subdirectory.
|
|
|
\item[sysutils] many utility functions, like in Delphi. Resides in the
|
|
|
-\file{inc} directory, and needs \var{-S2}
|
|
|
-\item[typinfo] functions to access RTTI information, like Delphi.
|
|
|
-\item[math] math functions like in Delphi.
|
|
|
+\file{objpas} directory, and needs \var{-S2} to compile.
|
|
|
+\item[typinfo] functions to access RTTI information, like Delphi. Resides in
|
|
|
+the \file{objpas} directory.
|
|
|
+\item[math] math functions like in Delphi. Resides in the \file{objpas}
|
|
|
+directory.
|
|
|
\item[mmx] extensions for MMX class Intel processors. Resides in
|
|
|
in the \file{i386} directory.
|
|
|
-\item[getopts] a GNU compatible getopts unit.
|
|
|
-\item[heaptrc] to debug the heap.
|
|
|
+\item[getopts] a GNU compatible getopts unit. resides in the \file{inc}
|
|
|
+directory.
|
|
|
+\item[heaptrc] to debug the heap. resides in the \file{inc} directory.
|
|
|
\end{description}
|
|
|
|
|
|
\subsection{Compiling the compiler}
|
|
@@ -4610,12 +4614,12 @@ the compiler you're using.
|
|
|
\item A path to an RTL. Can be skipped if a correct ppc386.cfg configuration
|
|
|
is on your system. If you want to compile with the RTL you compiled first,
|
|
|
this should be \file{../rtl/OS} (replace the OS with the appropriate
|
|
|
-operating system subdirectory of the RTL)
|
|
|
+operating system subdirectory of the RTL).
|
|
|
\item A define with the processor you're compiling for. is required.
|
|
|
\item \var{-dGDB} is not strictly needed, but is better to add since
|
|
|
otherwise you won't be able to compile with debug information.
|
|
|
\item \var{-Sg} is needed, some parts of the compiler use \var{goto}
|
|
|
-statements.
|
|
|
+statements (to be specific: the scanner).
|
|
|
\end{enumerate}
|
|
|
So the absolute minimal command line is
|
|
|
\begin{verbatim}
|
|
@@ -4623,7 +4627,27 @@ ppc386 -di386 -Sg pp.pas
|
|
|
\end{verbatim}
|
|
|
|
|
|
You can define some other command-line options, but the above are the
|
|
|
-minimum. A list of recognised options can be found in the source, in
|
|
|
-\file{pp.pas}.
|
|
|
-
|
|
|
+minimum. A list of recognised options can be found in \seet{FPCdefines}.
|
|
|
+
|
|
|
+\begin{FPCltable}{ll}{Possible defines when compiling FPC}{FPCdefines}
|
|
|
+Define & does what \\ \hline
|
|
|
+USE\_RHIDE & Generates errors and warnings in a format recognized\\
|
|
|
+& by \file{RHIDE}. \\
|
|
|
+TP & Needed to compile the compiler with Turbo or Borland Pascal. \\
|
|
|
+Delphi & Needed to compile the compiler with Delphi from Borland. \\
|
|
|
+GDB & Support of the GNU Debugger. \\
|
|
|
+I386 & Generate a compiler for the Intel i386+ processor family. \\
|
|
|
+M68K & Generate a compiler for the M68000 processor family. \\
|
|
|
+USEOVERLAY & Compiles a TP version which uses overlays. \\
|
|
|
+EXTDEBUG & Some extra debug code is executed. \\
|
|
|
+SUPPORT\_MMX & only i386: enables the compiler switch \var{MMX} which \\
|
|
|
+ &allows the compiler to generate MMX instructions.\\
|
|
|
+EXTERN\_MSG & Don't compile the msgfiles in the compiler, always use \\
|
|
|
+& external messagefiles (default for TP).\\
|
|
|
+NOAG386INT & no Intel Assembler output.\\
|
|
|
+NOAG386NSM & no NASM output.\\
|
|
|
+NOAG386BIN & leaves out the binary writer.\\ \hline
|
|
|
+\end{FPCltable}
|
|
|
+This list may be subject to change, the source file \file{pp.pas} always
|
|
|
+contains an up-to-date list.
|
|
|
\end{document}
|