The GNU Modula-2 front end to GCC

Development sources via git

Development sources can be downloaded via git but they must be grafted carefully onto an existing GCC release. The notes in this section document how this is achieved, however a prepared git and GCC release is available and it is created upon each commit.

The source code in the git can be browsed. However if you want to obtain the latest sources via git then type the following:

$ git clone -b gcc_4_7_4_gm2

This will checkout a copy of GNU Modula-2 into one subdirectory, gm2. The checkout also includes the complete testsuite and gm2 libraries.

This version of GNU Modula-2 needs to be placed on top of the GCC source tree and have various patches applied before GNU Modula-2 can be built. Please check the GNU Modula-2 homepage for details about which GCC releases are supported by GNU Modula-2.

Once you have downloaded the correct GCC release from or a mirror site you should unpack the GCC archive. Assuming that both the gcc-4.7.4 and gm2 directories are at the same level, you can graft gm2 onto gcc-4.7.4 by:

$ mkdir -p combined/gm2
$ mv gcc-4.7.4 combined/gm2/gcc-versionno
$ tar cf - gm2 | ( cd combined ; tar xf - )

If the directory combined/gm2/gcc-versionno/gcc/gm2/patches/gcc/4.7.4 exists then the patch files inside that directory can be applied to the gcc-versionno tree. This is done via:

$ cd combined/gm2/gcc-versionno
$ if [ -d gcc/gm2/patches/gcc/4.7.4 ] ; then
     for i in gcc/gm2/patches/gcc/4.7.4/* ; do
        if [ -f $i ] ; then
           patch -p1 < $i

Note that if you download a tarball from then any patching will have already been applied. .