Background
Compiler plugins (or loadable modules) make it possible for a developer to add new features to the compiler without having to modify the compiler itself. Plugin support is available in GCC version 4.5.0 and later. Plugin functionality provides several advantages:
- It shortens the time needed to build and test new features. Only the code needed to implement the new functionality needs to be compiled, i.e. GCC doesn't need to be bootstrapped.
- It allows the development and maintenance of compiler features that for one reason or another are not suitable for inclusion in the main GCC distribution.
- It simplifies the job of developers who need to modify GCC but do not have the time or inclination to delve too much into the compiler internals.
This page contains links to API documentation and provides a directory of known GCC plugins. If you have any questions about developing your own compiler plugin, please contact us at gcc@gcc.gnu.org .
Documentation
Plugins chapter in the GCC internals documentation.
Plugins branch page with links to design documents, discussions and TODO lists.
A series of posts on parsing C++ with GCC plugins: Part 1, Part 2, and Part 3.
slides in French of a Solutions Linux talk (march 2010) about les greffons de GCC (GCC plugins in French)
The july 2010 slides about extending GCC with MELT, while somewhat MELT centered, give some motivations and putative examples of application-specific or domain-specific GCC extensions, perhaps through plugins (or using MELT).
Compiler plugins repository
The following directory lists all the existing GCC plugins that we know about. Please note that these modules are not maintained by GCC developers, so asking about them on the GCC lists may not give you the answers you want (though, it is likely that plugin developers are also subscribed to the GCC lists).
If you have developed a plugin (under a GPL compatible license), add it to this list and let us know about it by posting an announcement on gcc@gcc.gnu.org .
Plugin |
Brief description |
URL |
Linux kernel |
||
Static analysis tool for C++ |
||
LLVM backend for GCC |
||
Multiple high-level ICI plugins for function level pass selection and reordering, static feature extraction for machine learning and optimization prediction, tuning of fine-grain program optimizations, program instrumentation and function run-time adaptation. |
development website Google Summer of Code'09 extensions development mailing list that eventually should merge with the main GCC mailing list |
|
Lisp dialect for middle end |
MiddleEndLispTranslator a framework for writing middle end analysis and passes in a Lisp like high level language |
|
ODB is an object-relational mapping (ORM) system for C++. It allows you to persist C++ objects to a relational database without having to deal with tables, columns, or SQL and without manually writing any mapping code. |
||
A gcc plugin, which can be loaded when debugging gcc, to show internal structures graphically |
||
Embeds a Python interpreter inside GCC, allowing various visualizations and static analysis |
||
Proof-of-concept extension allowing GCC to be extended in Guile Scheme |
||
C-family language extensions and run-time support for heterogeneous CPU/GPU programming |
||
Extensible shared-memory access instrumentation and dynamic analysis for debugging and understanding concurrent programs |
||
Automatic static instrumentation tool by rewriting GCC GENERIC tree at compile time |
||
Plugins to help with the task of creating a more secure kernel. |
https://www.grsecurity.net/features.php#tabs-gcc LWN articleSlides of PaX talk |