Sign in Join
Wiki copytemporary

Compiler development articles: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Compiler development articles

OldNewLine
1+> **Warning:** *As of 2021-May-21. the current compiler version is 3.2.2, so it is possible some of the details listed below may have changed.*
2+
3+The current FPC version under developement is 2.5.1. Compiler internals are documented at the evolving [[FPC internals]] page.
4+
5+## General
6+
7+[[How to start]]
8+
9+[[FPC internals]]
10+
11+[[Language related articles]]
12+
13+[[Coding style]]
14+
15+[[Porting Free Pascal]]
16+
17+[[Testing FPC]]
18+
19+### Enable new style smartlinking (FreeBSD, Linux)
20+
21+- in i_*.pas add tf_smartlink_sections to the flags field of the platform description record for your OS/CPU combo (in my case i_bsd.pas, the system_i386_freebsd_info record)
22+- in ogelf.pas scroll down to nearly the bottom, and add af_smartlink_sections to the flags field of as_i386_elf32_info
23+- run "(g)make all OPT='-Aas -k--gc-sections' at the toplevel to build using new smartlinking routines.
24+
25+### C++ linking
26+
27+Note that FPC doesn't have negative VMT offsets due to GNU LD limitations.
28+
29+The fundament of above C++ \<-\> OPas lies in COM interfaces: (quote from Rudy Velthuis)
30+
31+"Well, all compilers must be able to create COM interfaces. Since in C++, these are simply pure abstract classes, and Delphi must have the same layout, for many reasons, they are all compatible. In fact, a pure abstract class pointer points to a structure of which the first entry is a VMT. This is also how interfaces are built"
32+
33+## Processor dependent
34+
35+See also [[Platform list|platform list]].
36+
37+[[Passing Pascal Types to C Routines]]
38+
39+### i386
40+
41+[[PIC information]]
42+
43+### PowerPC
44+
45+[[PPC Calling conventions]]
46+
47+### Internal Linker
48+
49+[[Internal Linker]]
50+
51+## Packages
52+
53+[[packages|Packages]]
54+
55+---
56+*From the Free Pascal wiki, page "Compiler development articles", as it stood on 2021-06-10 after a change by Trev, out of the wiki's dump of 2024-05-26. 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).*
57+Category: FPC
58+Category: FPC development

Back to history