Compiler options
The compiler recognizes many options. They are divided into
the following classes:
Final output options
The following options determine the final result:
- -o name Build the program name.
- -a name Build the library name.
- -c Stop after producing objects and keep
.o, .io, and .mo files.
- -C Stop after producing C code and keep
.ic and .mc files.
- -S Stop after producing assembly code and keep
.s, .is and .ms files.
At most one output option can be specified.
If none is present, "-o a.out" is assumed.
Diagnostic messages
The following options determine how much
m3 reports on stdout.
- -silent print only the error messages.
- -why explain why each compilation is needed.
- -commands print the compilation commands as they are started.
- -verbose print what happens to each file.
- -debug print everything, including internal debugging information.
- -times print a breakdown of elapsed time.
Front-end options
The following options are passed to the front-end:
- -A Do not generate code to check the <*ASSERT...*> pragmas.
- -D defPath Changes the search path to locate
Modula-3 interfaces and generic sources.
defPath is a list of directory names, separated by ":". If
this list is empty, the search path is set to empty. Otherwise, the
given directories are prepended to the current search path.
- -v
very verbose: show compilation steps as they are performed
(implies -verbose and -w0).
- -w [n] Print messages from level n and above. The default is
-w3.
The levels are:
(0) informational,
(1) "fussy" warnings,
(2) warnings,
and
(3) errors.
Back end options
The following options are passed to the back-end (i.e. passes 1, 6, 7, 8):
- -g generate debugging symbols.
- -gx Passed unchanged to pass 1.
- -O optimize.
- -Ox Passed unchanged to pass 1.
The actual arguments passed to the back-end for the
\-g and \-O
options are part of the
m3build configuration.
Linking options
The following options are passed to the linker when producing
a program and are used in "make" mode.
- -LlibPath Changes the search path to locate libraries.
libPath
is a list of directory names, separated by ":". If
this list is empty, the search path is set to empty. Otherwise, the
given directories are prepended to the current search path.
This argument is not passed to the linker since
m3
does the name resolution for libraries.
- -lname
Search for the library named
libname.a
along the library search path. If the library is found, the resolved
named is passed to the linker. Otherwise, the library should not
contain Modula-3 objects and this option is passed to the linker.
- -nostd
omit the standard libraries
from final link step.
The standard libraries are part of the
m3build configuration.
Miscellaneous options
The remaining options are:
- -Ffile
Process each non-blank line of file
as if it appeared as an argument on the command line.
- -keep
Keep intermediate files (.ic, .mc, .o,
.io, .mo and the initialization code file _m3main.c)
created by the compiler. Normally, these files are deleted.
-
-make
compile only those sources that are newer than their
corresponding objects or whose imports have changed
since they were last compiled. The default mode is for
m3
to compile all given sources.
The default invocation by
m3build
includes -make.
- -Xn@arg1[@arg2...]@
Add arg1 arg2 ...
to the arguments to pass
n
of the compiler. You can replace
@
by any character of your choice.
Pass 0 is the Modula-3 to IL compiler,
pass 1 is the C compiler,
pass 2 is the C compiler used as a linker,
pass 3 constructs library archives (ar),
pass 4 builds the table of contents for a library (ranlib),
pass 5 invokes the linker to build overlays,
pass 6 is the IL to assembly translator,
pass 7 is assembler,
and pass 8 is the object file patcher.
For example, normally the compiler generates Modula-3 line information in
the intermediate code; -X0@-C@ prevents that. If you want specialized
debugging or optimization flags,
you can pass the proper options to the C compiler,
for example -X1@-O@, -X1@-O2@ or -X1@-g3@.
- -Yn@Program[@arg1@arg2...]@
Substitute
Program arg1 arg2 ...
for pass
n
of the compiler. You can replace
@
by any character of your choice.
The passes are numbered as above.
The default values for each of the passes
is part of the site specific configuration described
below.
- -Z
Compile object files for line-based coverage analysis by
analyze_coverage(1).
Coverage data will be available only for those modules that have been
compiled with this option. To produce the coverage data, you must also
link your program with this option.
- -?
Print the executable used for the various passes as well as the value
of the search paths.
[Modula-3 home page]
m3-request@src.dec.com
Last modified on Mon Sep 25 18:31:51 PDT 1995 by heydon
modified on Thu Apr 21 12:15:56 PDT 1994 by kalsow
modified on Fri Feb 7 00:38:19 PST 1992 by muller