Welcome to GCCMVS (GCC for MVS, CMS and VSE) - a freely available 31-bit mainframe compiler

GCCMVS is a standalone compiler designed to run on MVS (from z/OS all the way back to MVS 3.8j, and probably beyond to PCP, but no-one has tested (or at least reported) back that far) or CMS (z/VM and predecessors) and VSE (z/VSE back to DOS/VS R34), plus MUSIC/SP. It consists of two distinct parts. Firstly, the standard GCC 3.2.3 compiler with some required code changes for MVS and CMS. Secondly, PDPCLIB, which is a C runtime library required for GCC to be able to run, and also for your own programs to be able to run. Both things are required, and both things are what is dubbed "GCCMVS". Note that the licence for the GCC part is GPL while PDPCLIB is public domain (explicit PD notice). Because PDPCLIB is pure public domain, it means that there are no licencing restrictions on executables you produce yourself. ie commercial use is fine, and you can even sell PDPCLIB (original or modified, including proprietary modifications, with or without source) if you find a market.

The source code and executables for GCCMVS can be found at sourceforge, in the "files" link. It is recommended that you use GCC 3.2.3 rather than 3.4.6 which is a bit buggy. The MVS version also works under PDOS/3X0.

Porting the compiler to the mainframe opened up the floodgates to lots of C code being able to be ported. The downloads section contains some such applications. The most impressive one is probably the "diff3" utility. If you have never heard of a three-way diff, you will not regret learning what it can do for you.

GCCMVS consumes a lot of memory when compiling large programs. More than the 24-bit address space of MVS 3.8j can handle in fact. Fortunately, even if you want to compile large programs, there now exists free 31-bit mainframe operating systems - the OS/380 suite. If you want, you can fire these up to do your compile and get a 24-bit module generated that is suitable for running on an existing 24-bit version of MVS. The GCCMVS and GCCCMS executables provided at the sourceforge site are 31-bit executables targeting (by default) 31-bit systems for MVS and 24-bit systems for CMS, although a 24-bit executable (suitable for small programs) is also provided for CMS. It is not needed for MVS. You are free to configure CMS to be 31-bit targeting 31-bit if you wish (and even within that configuration there are more options available e.g. whether to use a heap or not). The MVS executables are provided in XMIT format for the convenience of z/OS users. Note that z/OS is considered to be the primary target of GCCMVS, although most testing actually occurs on the "compatible" MVS/380.

There are a few introductory tutorials for using GCCMVS on MVS 3.8, although at time of writing they hadn't been updated to GCCMVS 9.0.

Most discussion of GCCMVS takes place here, although there are several other suitable places.


E-mail Paul Edwards here.