As of 20-Apr-2009, the branch is closed. All plugin functionality has been merged into mainline.
See also the Plugins chapter of the internal GCC documentation.
A repository of GCC plugins is now available at http://gcc.gnu.org/wiki/plugins.
Distributed GCC plugins should be GPLv3 compatible free software.
Last updated: 20-Apr-2009
This project adds a commonly used mechanism for extending software functionality: plugins. With this, it will be possible for a developer to add new features to the compiler without having to modify the compiler itself. 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.
The code is being developed in the SVN branch plugins. The API being implemented is described here, it is still not finalized and will likely change frequently. To get the latest version of the branch:
$ svn co svn://gcc.gnu.org/svn/gcc/branches/plugins
The usual rules for contributing to branches apply to this branch:
- Contributors must have copyright assignments on file with the FSF.
Messages and patches to the lists should have their subject prefixed with [plugins].
ChangeLog entries should be written to ChangeLog.plugins.
To run plugin-specific tests, go to the top-level of the build tree and do
$ make check-gcc RUNTESTFLAGS="plugin.exp"
- As of 2009-04-20 the branch is closed. All the plugin functionality has been merged into mainline.
- Committed new testcases and dejagnu support for plugin mechanism on 2009-03-25 at revision 145075.
- Committed the fix for a bug in plugin argument option parsing on 2009-03-10 at revision 144758.
- Initial implementation was committed to the branch on 2009-02-25 at revision 144439.
- The branch was created on 2009-02-06.
Things/Projects To Do
- Provide mechanism for plugins to specify required GCC versions and for GCC to emit warnings or errors for incompatible plugins.
- Warn or err based on some command line flag or internal mechanism (like having a table of compatible versions for plugin ABIs).
- Do we need a (separate) plugin API revision number and provide a function to obtain this number or we associate it uniquely with the GCC version?
- Add -fdisable-plugin-version-check to suppress error/warning messages.
- Need to have pre/post checks at the point of plugin insertion.
- Document APIs in the internals manual. (Add a new file doc/plugin.texi linked from gccint.texi).
- Decide whether to have configurable plugin insertion points.
- Add support for plugins to register ggc roots with GCC for better memory management integration.
There should be a way to invoke cc1 in plugin mode even without any source input files, perhaps gcc -fplugin=whatever -force-cc1
- Better support of GCC pass management that provides all of the pass enumeration/positioning/registration services for core GCC and plugins to use.
- Figure out how and where to package/install the GCC header files (including some of those that are generated) needed by plugins so that people can write plugins with only the installed GCC (i.e. without GCC source/build trees available).