mcc -- a backward compatible frontend to cc


mcc [option]... file...


mcc(CP) is a backward compatible frontend to cc(CP). By default, mcc turns on the -Xm option of cc and recognizes most of the common options of the C compiler in the previous release of SCO OpenServer Development System. It examines the options and filename suffixes of its file arguments, and then executes the proper compiler passes with appropriate options and arguments. The default filename of the resulting executable is a.out, which can be changed using option -o. If an old unsupported cc option is passed to mcc, it causes a compiler error and an error message is printed. The error message states explicitly that the option is not supported. This frontend is provided for backward compatibility reasons and may not be supported in future releases.

The filename suffixes recognized by mcc and the associated applicable compilation phases are:

A file that contains unprocessed C source; all phases are applicable.

A file that contains preprocessed C source; all phases except for preprocessing are applicable.

A file that contains assembly language source; only the assembling and linking phases are applicable.

.a, .o, .so
A file that contains input applicable only to the linking phase. This category commonly includes object files (.o), archive libraries (.a), and shared object libraries (.so).

By default, mcc invokes /usr/ccs/bin/cc as the C compiler driver. This default path can be overridden by setting the environment variable USLCC to be the path of an alternate binary.

Special characters that are normally interpreted by the shell are preserved when mcc parses its command line options.

Option -verbose and options in the group -Y[p02balSIP] are recognized by mcc but not by previous version of cc.

Supported options

The following options are supported:

Enforce strict adherence to the ANSI specifications for the C language.

Suppress the linking stage and do not create an executable file. Object files (.o files), if produced, are not removed.

In the preprocessed source, retain all comments unless they are on the same lines as preprocessing directives. These preserved comments can be used by lint(CP) later. The default is to remove all comments when preprocessing a file. This option may only be used together with -E or -P (see below).

Turn on optimization.

Turn off optimization.

Print out each command and its options and the argument before the invoked command is executed by mcc.

-D name[=string]
Define name to be a macro and replace this macro by the value of string. If the optional =string part is not given, the macro is replaced by 1. The effect of using this option is the same as if name is defined through a #define directive in the source file following this option. See the -a and -b options in the cc(CP) man page for more information on the default manifest defines. The -D option can be used several times on the command line, but it must not define the same name twice.

Suppress all phases but preprocessing, and send the result to the standard output. The result will contain lines similar to preprocessing directives and can be used for a subsequent compiling phase.

Rename the generated object file as object-filename instead of using the default name, file.o.

-Fe filename
Rename the executable file as filename.

Include debugging information in the output file. If -O is also specified, -g takes precedence.

Enforce strict Intel Binary Compatibility Standard 2 conformance.

-I directory
Search an include file in directory before searching the standard list of directories, if an absolute pathname is not used for the include file. If the -I option is used multiple times, these additional directories are first searched for included files in the order specified by -I.

Make the data type char to be unsigned by default.

Search library libname.a for unresolved function references.

All options and filenames that follow -link (and any options not recognized by the compiler) are passed directly to ld. No other compiler option can appear after the -link option.

-o filename
Use filename as the name of the executable file instead of using the default name a.out.

Turn off optimization.

Turn on optimization. If the option -g or -ql is also specified, optimization is turned off.

CAUTION: The following -O option arguments have no special effect. They all simply turn on optimization:

a c e f g h i l m n p r s t x z

To fine tune optimization, use cc(CP) with option -O or -K and their respective option arguments.

Generate and store extra codes into the executable program for program profiling. When the executable program is run, the profiling information is saved into the file mon.out, which can be later examined using prof(CP).

Pack structures. Each structure member is stored at the first available byte, without regard to int boundaries. Although this will save space, execution will be slower because of the extra time required to access 16-bit members that begin on odd boundaries.

Enforce strict POSIX conformance. The language is restricted to ANSI specifications. When using this option, you need to link in the math library (with -lm), because, unlike in the previous release, the math routines are not automatically linked in. Do not use the -ansi, -xpg4 or -xpg3 flags with this flag.

Preprocess only each source file. The result is placed in .i-suffixed file. Unlike -E, the result will contain no #line directives. Compiling this resultant .i file produces an executable whose line numbers match the .i file instead of the .c file.

Provide line profiling, that is, ``coverage'' and ``count'' statistics for each line of the program. The output from line profiling can be examined with lprof(CP).

This flag is equivalent to -p.

Perform an incremental link.

Instruct the linker to strip symbol table information from the executable output file.

Restrict the language to ANSI specifications.

Enforce SVID Issue 2 conformance.

Create an assembler file for each source file. The resulting assembler file has the same basename as the source file and has the suffix .s.

NOTE: The suffix is .s, not .asm. This is a change from previous behavior.

Eliminate all manifest defines.

Undefine definition as if by a #undef directive, even if definition is a predefined macro (including those that begin with __) or is also the subject of a -D option. This option is passed to the preprocessor.

Generate verbose output, showing how other mcc options are converted to equivalent cc options. See also INFOCC in ``Environment variables.''

-W tool,list
Pass the comma-separated list of arguments list (in order) to the single compilation pass named by tool. To include a comma in an argument in list, precede the comma by a \ character. This option is passed to cc unchanged. See the man page cc(CP) for further details.

-W level
Set the compiler warning message level. level is a digit 0 through 3, letter x or X. This option does not affect the text of compiler error messages.

Do not issue any warning messages.

Issue most warning messages (the default level).

Issue even more warning messages, including some warnings about behavioral changes from K&R C (see -Xk) to ANSI C.

Issue all of the above warning messages, and more. Use -w2 or -w3 when initially porting K&R code to an ANSI environment. See UNRESOLVED XREF-0 for more details.

x, X
Cause all compiler warnings to be fatal. This can be combined with -w0, -w1, -w2, or -w3.

-xpg3, -xpg4
Enforce strict XPG4 conformance. The language is restricted to ANSI specifications. When using this option, you need to link in the math library (with -lm), because, unlike in the previous release, the math routines are not automatically linked in. Do not use the -ansi or -posix flags with this flag.

-xpg3plus, -xpg4plus
Closely represent a true X/Open conforming implementation with SCO OpenServer added value. Some of the added value is non-conforming since it pollutes the user's name space.

Do not search the standard directories for the included files.

-Y pass,dir
Find the item(s) named by pass in the directory dir. The option argument pass is one or more of the following:




basic block profiler



If more than one conceptual phase is implemented by a single tool and differing directories are specified for the phases, it is unspecified which directory is used. In addition, any one of the following can also be used as the option argument pass:

Change the directory searched last to dir for preprocessing phase include files.

Change the linking phase default library search path to dir.

Change the linking phase default library search path to be the colon-separated list of one or more directories, dir. More directories can be added to the front of the path due to other options. This option is incompatible with -YU and -YL and will cause an error if it is used with either one of them.

Changes the directory to dir in which to find the start-up object files(crt files).

Change the linking phase library search path LIBDIR to dir.

Print out each command with its options and arguments as invoked by mcc but do not execute these commands.

Enforce strict adherence to the ANSI specifications for the C language.

-Zd, -Zi
Include information for the screen-oriented debuggers dbxtra and dbXtra and the symbolic debugger (sdb) in the output file. This option is equivalent to the -g option.

Pack structure members in memory. The argument n can only be one of the following:

Allocate alignment to 1

Allocate alignment to 2

Allocate alignment to 4 (default)

Ignored options

Not all options accepted by the previous version of cc are supported by mcc. Some of these options are silently ignored and do not cause an error. The following options are in this group and are ignored:

-Fnum -Gs -i -K -LARGE
-M[3es] -n -quiet -unix  

                   -Fnum     -Gs   -i       -K      -LARGE
                   -M[3es]   -n    -quiet   -unix

Unsupported options

Options in this group are supported by the previous version of cc and still recognized by mcc. However, they will cause a fatal compiler error if any of them are passed to mcc. This group includes the following options:

-Barg -compat -dos -EP -FP
-F[aclms] -Gc -H -help -L
-m -Marg[+] -nl -N[DMT] -os2
-S[lps] -Tc -V -x2.3 -xenix
-xout -Z[egls]      

                -Barg       -compat    -dos   -EP       -FP
                -F[aclms]   -Gc        -H     -help     -L
                -m          -Marg      -nl    -N[DMT]   -os2
                -S[lps]     -Tc        -V     -x2.3     -xenix
                -xout       -Z[egls]

+ excluding the option arguments listed in ``Ignored options''

Environment variables

In addition to the shell environment variables that are supported by cc(CP), mcc also supports the following two environment variables:

When this environment variable is set to any non-empty string, mcc prints various information messages about how old options are converted by mcc to the equivalent options that are supported by cc. Its use is recommended when you port old Makefiles and the like for use with this C compiler.

Invokes an alternate binary, USLCC, as the C compiler driver. If this environment variable is not set, mcc invokes /usr/ccs/bin/cc.

Exit value

Upon successful completion, the exit status of mcc is 0, otherwise the exit status is non-zero.


a shell driver, which invokes /usr/ccs/bin/cc and enables some extensions provided in the previous release of cc(CP)

a link to /usr/ccs/bin/mcc

See also

ar(CP), cc(CP), lint(CP), lprof(CP), nm(CP), strip(CP)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005