Compiler & Tools ||
Ulm's Modula-2 System:
m2c - Modula-2 compiler
[ option ] ... file ...
is Ulm's Modula-2 compiler.
It accepts several types of arguments:
Arguments whose names end with `.m2' are taken to be
Modula-2 source programs; they are compiled, and
each object program is left on the file
whose name is that of the source with `.o' substituted
Further a reference file with suffix `.r' is left. See
for more information.
Names ending with `.d' are taken to be Modula-2 definition modules
and compiled, producing a `.sy' file.
The `.o' file is normally deleted, however, if a single
Modula-2 program is compiled and loaded all at one go.
Symbol files and reference files may be archived in
the files `SYM' and `REF'. If these archives exist,
tries to archive the corresponding output files.
In the same way,
arguments whose names end with `.s' are taken to be assembly source programs
and are assembled, producing a `.o' file.
The following options are interpreted by
for load-time options.
- Suppress archiving of the reference and symbol files even if
`SYM' and `REF' exist.
as an alternative library directory.
If string is omitted, `old' is taken as default.
- Suppress the loading phase of the compilation, and force
an object file to be produced even if only one program is compiled.
- Support code generation of procedures with huge stack consumptions.
This option should only be given if it is explicitly requested by
an error message of the compiler because less efficient code will be
- Request the compiler to produce null-valued symbol file keys.
This may be useful for regression or steady-state tests
of symbol files.
- Arrange the compiler to produce a listing for each source file
in a corresponding `.l' file,
or in a `.ld' file if the source is a definition module.
- The following argument is taken to be the main module.
Necessary only if no main module exists.
- -o output
Name the final output file
If this option is used, the file `a.out' will be left undisturbed.
- This compiler supports three versions of Modula-2:
unrevised Modula-2 as defined in 1st and 2nd edition of
Wirth's Programming in Modula-2 (N = 0),
revised Modula-2 as defined in the Revisions and Amendments to Modula-2
(N = 1),
and revised Modula-2 as defined in the 3rd edition (default: N = 2).
All compile versions are full compatible.
- Suppress clean up of temporary files.
- Compile the named Modula-2 programs, and leave the
assembler-language output on corresponding files suffixed `.s'.
Allocate the temporary files of the compiler in the directory
- Verbose flag.
prints all executed commands to standard error.
to be either loader option arguments, or Modula-2 compatible
object programs, typically produced by an earlier
or perhaps libraries of Modula-2 compatible routines.
These programs, together with the results of any
compilations specified, are loaded (in the order
given) to produce an executable program with name
looks for two environment parameters:
calls the compiler passes in the directory
specifies a list of directories, separated with colons (like
Each of these directories consists of a
archive of symbol files, a
archive of reference files and archives with suffix `.a'.
If the compiler looks for a symbol file or ld(1) for
library modules, this search path is used.
||main or implementation module
||archive with symbol files
||archive with reference files
||file with error messages
||symbol files of the std library
||reference files of the std library
Programming in Modula-2,
1982 (1st ed.) and 1985 (3rd ed.)
Revisions and Amendments to Modula-2,
ld(1), mdb, mmm, mtags
The diagnostics produced by Modula-2 itself are intended to be
Some symbol file key mismatches lead to error messages of
the loader similar to following example:
Undefined first referenced
symbol in file
ld: fatal: Symbol referencing errors. No output written to main
A module named XXX was imported by YYY.
While XXX was expected to have the symbol file key
857052922_16922_120, the loader happened to find another
version of XXX which is incompatible to that version
which was seen by m2c on compilation of YYY.
In such cases it may be useful to remove all objects,
to update all makefiles (using mmm -u), and to call make(1)
The first 11 characters of the module name should be identical to the
Edited by: borchert, last change: 1999/02/10, revision: 1.6, converted to HTML: 1999/02/10
Compiler & Tools ||