GCC is an open-source compiler that is used by many researchers as the platform for implementing application-specific compilers. The applications of custom compilers include systems security, dependability, and others. Usually, a new compiler extension is implemented by modifying the source code of the compiler directly. This, however, complicates the distribution of the compiler extension because the end users have to download the new version of the compiler to enjoy the benefits of the specialized compiler.
The goal of this project is to create a framework for writing compiler extensions as dynamically loaded modules. The idea of this project is similar to that of the the Linux Security Modules project whose goal is to facilitate the development of security modules for the Linux kernel. With GEM the developers need to distribute the source code of the compiler extension only. The GEM-patched compiler loads at run time a GEM module specified as the arguments of its -fextension-module option.
The current version of GEM defines a set of hooks in the preprocessor, the AST, and the assembly code generation components of GCC.
- 12/5/2006: GEM 1.7 released. RTL hooks added, a portable RAD implemented as an example.
- 11/4/2006: GEM 1.6 released. gem_build_tree_cfg() hook added. Thanks to Bjorn Skoglund.
- 10/30/2006: GEM 1.5.1 released. gem_finish_decl() hook modified.
- 4/16/2006: GEM 1.5 released. GCC 4.1.0 patch added, patch generation script included.
- 2/5/2006: GEM 1.1 released. size_t and void bugs fixed, other bug fixes in CFO example.
- January 2006: GEM 1.0 released. Includes CFO example.
- January 2006: GEM Wikibook written.
- GEM Wikibook http://en.wikibooks.org/wiki/GNU_C_Compiler_Internals
- GCC Hacks, presented at Graduate Research Conference 2006, SUNY Stony Brook, April 21, 2006 (ppt).