GCC R323 for VM/ESA

This memo describes the initial release of a GCC R323 for VM.
The code is mostly take from Paul Edward's native MVS port from
( http://www.softlib.org/GCCMVS/gccmvs) which in turn is based
on Dave Pitts IBM390 port of GCC (http://www.cozx.com/~dpitts/gcc.html)


Download Instructions

You can download the current GCCR323 distribution from here: GCCDIST VMARC. *UPDATED*

Upload the GCCDIST VMARC file to your VM system in binary mode and make sure that it is in record format "F", with a logical record length of 80. If the uploaded GCCDIST VMARC file is not in the correct format, this simple PIPE command will create one that is:

PIPE < fn VMARC A | fblock 80 00 | > fn VMARC A F 80

Unpack the resultant file using VMARC:

VMARC UNPACK GCCDIST VMARC A = = A

Licenses

The COMPILER is covered by the GNU public license. The run time library
contained in "CLIBXA TEXT" is Public Domain and you are free to use it
in commercial code.

Note:- Users requiring the source should download the latest version
from spftools and merge it with the library source provided here.


Overview

This file contains a GCC compiler that runs on any XA or ESA complient
version of VM and small run time library. The compiler produces standard
ASSEMBLER code that is assembled by the High Level Assembler. This means
that "C" programs which use only the ANSI "C" library can be compiled and
run on any version of ESA and z/VM. The compiler uses only tradional CMS
and CMS emulated MVS system calls and so is an "almost" native GCC.


Warning

The compiler and library has had minimal testing. It does contain bugs.
It also has number of restrictions, as below.

Note. Work is in hand to correct the above.


Contents of Release

The object release contains the following items-

  1. GCC MODULE - The compiler module. Converts "C" code to 390 assembler.
  2. GCCREPL MODULE - Post Processor - Get round some missing macros.
  3. GCC EXEC - A wrapper EXEC which calls the compiler, the post processor, and the High Level Assembler.
  4. CLIBXA TEXT - A run time library, PDPCLIB.
  5. CLOADXA EXEC - An exec to load the output from GCC with CLIBXA and produce a module.
  6. Include File - A collect of "H" files needed to access PDPCLIB.
  7. Source Files - The "C" and "Assembler" source for PDPCLIB
  8. GCCESA MEMO - This File - Release notes.
  9. MKCLIBXA EXEC - Re-builds CLIBXA from TEXT Files.
  10. CMPCLIB EXEC - re-comiples CLIB, use MKCLIB afterwards
  11. ZCALC C - Sample Program.

Installing the Compiler

Users of the compiler will need access to items 1 thru 7 above.
Take care if you have another "C" compiler installed. When using GCC
the "H" files supplied above must be on a disk prior to any other "H"
files.

If you don't have another compiler these files could be installed on
the "Y" disk. If you do you will need to use another disk.


Using the Compiler

In its simplest form using the compiler is a two stage process.
For example to create "ZCALC MODULE" from "ZCALC C" the following
commands are issued:-

GCC ZCALC
CLOADXA ZCALC

The first compiles and assembles ZCALC. The second loads and GENMODS.
ZCALC can then be run by using the

ZCALC

A more detailed description of the commands follows:-

o GCC EXEC

Because GCC expects UNIX format commands the GCC EXEC has a slightly
odd format. Its format is as follows:-

GCC <fn <ft <fm>> <(options>

Where fn, ft and fm are the CMS file sepcifiers of the source and
options are "normal" GCC options. The compiler proper creates a work
file, "fn $WORK$". This is converted into "fn ASSEMBLER" by GCCREPL.
"ASMAHL" is then called to assemble this file.

If <fm> is specified, and points to a writable disk, the $WORK$ and
ASSEMBLE files are placed on this disk. Otherwise they are placed on
the users "A" disk.

*** WARNING ***
1) If "fm" is specified and a "fn ASSEMBLE" exists on a disk earlier in
access order it will be assembled, not the output of the compiler.

2) The location fo the TEXT deck is left entireley to the assembler.

o CLOADXA EXEC

The CLOADXA exec calls the loader to load one or more TEXT files
together with CLIBXA TEXT and generate a CMS MODULE file. Its format is

CLOADXA text1 <text2 text3... textn>

The module is generated as "text1 MODULE".


Run Time Library Notes

Opening Files

File names may be passed to the open routines in three forms:-

fn.ft - Opens CMS file "fn ft"
fn ft - Opens CMS file "fn ft"
dd:dsn - Opens file filedefed as "dsn"

stdin/stdout

stdin/stdout map to OS DD names SYSIN and SYSPRINT. The start-up code
checks for presence of these DSNs and if they are not found assigned
the device to the CONSOLE.


BUGS
====

Please report any bugs to g8mqw@yahoo.com.


Cast List and acknowledgments.


Many thanks go to the following:-

Dave Pitts - Producing the I370 definitions for GCC
Paul Edwards - Producing PDPLCIB & the MVS3.8 port of GCC
Phil Roberts - Testing and enhancing the above.
Jay Maynard - Creater of Hercules - used for inital port to VM/370R6.
Dave Jones - Providing access to his z/VM system