3 cc, pc, m2 \- MINIX 3 C, Pascal, and Modula-2 compilers
10 .RB [ "\-D \fIname\fR[\fB=\fIvalue" ]]
14 .RB [ "\-I \fIdirectory" ]
41 .RB [ \-W\fIname\fB\-\fIoption ]
44 .RB [ "\-o \fIoutfile" ]
45 .RB [ "\-L \fIdirectory" ]
51 .RB [ "\-stack \fIsize" ]
61 .RB [ "\-D\fIname\fR[\fB=\fIvalue" ]]
65 .RB [ "\-I\fIdirectory" ]
90 .RB [ "\-o \fIoutfile" ]
91 .RB [ "\-L\fIdirectory" ]
104 are the call names of the MINIX 3 C, Pascal, and Modula-2 compilers from
105 the Amsterdam Compiler Kit (ACK).
107 All these call names are links to the
111 uses the driver description file
113 that describes the steps necessary to compile a source file. The
115 manual page describes a few more flags, like
117 that may be useful for debugging compiler problems.
119 Minix-86 uses a C program as the compiler driver. This driver is not as
120 flexible as the one implemented with the
122 driver, and offers a smaller number of options. The second line of
123 the synopsis above shows the options that the Minix-86 driver supports. The
124 rest of this manual page is geared towards the
126 driver. People writing software for Minix-86, or that should be
127 portable to all MINIX 3 versions should stick to the options listed under
128 the Minix-86 compiler.
130 The transformations done by the compiler are modified by the following
131 options. They are a superset of the options required by \s-2POSIX\s+2,
132 with the MINIX 3 or compiler specific ones are marked as such. Options
133 for one specific compiler are ignored for others. Read the OPTIONS section
136 for the driver specific options.
139 .BI \-D " name\fR[\fB=\fIvalue\fR]"
141 .BI #define " name value"
146 is omitted. This argument, like all the other double arguments, may also
147 be given as a single argument. (I.e. either as
151 (The Minix-86 driver is not so flexible, the proper form can be seen in
155 Undefine the pre-defined symbol
159 Extend the include directory path with the given directory. These
160 directories are searched for include files in the given order before the
161 standard places. The standard place for the C compiler is
163 and for the Modula-2 compiler it is
167 Act as if a source file with the given suffix is present on the command line.
168 For each language found on the command line the appropriate libraries are
169 selected. The first language mentioned selects the runtime startoff.
170 The call name of the driver also chooses the language, so \fBcc\fP is an
173 The runtime startoff can be omitted by specifying
175 for those rare cases where you want to supply your own startoff. (MINIX 3)
178 Transform the input files to object files and stop. The
180 option may be used under MINIX 3 to set the name of the object file.
183 .BI "cc \-c" " dir/file" .c
186 in the current directory, but
187 .BI "cc \-c" " dir/file" .c
188 .BI \-o " dir/file" .o
193 expects it to be by its builtin
196 (Minix-86 can only use
198 to name an executable.)
201 Run the preprocessor over the input files and send the result to standard
202 output or the file named by
204 Standard input is read if an input file is named "\fB\-\fR".
207 Run the preprocessor over the input files and put the result to files
210 File and line number information is omitted from the output. Use
212 under MINIX 3 to omit this info for
217 Transform the input files to assembly files with suffix
221 Transform the input files to files with the given suffix. This can only
222 succeed if there is a valid transformation from the input file to the
223 given suffix. The same goes for
225 and other options that are just special cases of this option, except for
228 keeps the line number info. The option
230 makes the driver transform the input files to object files and add them to a
231 library. (So you do not need to know how the archiver works.) Note that you
232 need to give object files as arguments if you want to replace old object
233 files. Transformed files are added under a (unique) temporary name. With
235 you can name the library. (MINIX 3) (Minix-86 can't do
239 Optimize code. This option is a no-op, because all the compilers already
242 optimization level to get code of reasonable quality. Use
244 to turn off optimization to speed up compilation at debug time.
247 Compile with the given optimization level. (MINIX 3)
253 Optimize for space or for time. (MINIX 3)
257 Compile the C source with debugging information. (The way
262 interact is left unspecified.)
265 Omit the file and line number tracking that is used for runtime error reports
266 from Pascal or Modula-2 programs. The
268 flag is normally used to compile library modules, but may also be useful to
269 make a program smaller and faster once debugged. (Pascal & Modula-2)
272 Enable assertions, i.e. statements of the form \fBassert\fI\ test\fR
273 that cause a descriptive runtime error if the boolean expression
275 evaluates false. (Pascal & Modula-2)
278 Disable runtime checks like overflow checking. (Pascal & Modula-2)
281 Enable array bound checks. (Pascal & Modula-2)
284 Strip the resulting executable of its symbol table.
290 Use software floating point instead of hardware floating point. This is
291 a loader flag, but in general it is best to specify this flag in all
292 phases of the compilation. (MINIX 3)
296 Ignored. Used under Minix-vmd to omit floating point printing/scanning
297 code. The standard MINIX 3 compiler figures this out automatically using
298 a special loader trick. (MINIX 3)
301 Do not produce warnings about dubious C language constructs. Normally
302 the compiler is configured to do the maximum amount of checking
303 without being too annoying. (MINIX 3)
306 Omit warnings about old (K&R) style. (MINIX 3)
309 Omit strict warnings. (MINIX 3)
312 Omit all warnings. (MINIX 3)
315 Only accept 3rd edition Modula-2. (Modula-2)
318 Allow underscores in Pascal or Modula-2 identifiers, but not at the beginning
319 of an identifier. (Pascal & Modula-2)
321 .BI \-W name \- option
324 is the name of the compiler this driver is working for, then
326 is activated for that compiler. See below for a per-compiler list. Any other
328 option is ignored. (\fB\-W\fP is described by \s-2POSIX\s+2 as an optional
329 flag to send options to the different compiler passes with a totally
330 different (and nicely ignored) syntax as described here.) (Minix-86 ignores
336 Under Minix-86 this option transforms the function declarations (prototypes)
337 to the old K&R form, i.e. the arguments declarations are removed. This saves
338 a lot of memory in the compiler and may allow a large program to be compiled.
339 One must make sure that function arguments are properly type-cast where
343 Set the target architecture for a cross compiler. Normally the compiler
344 produces code for the same architecture it itself is compiled for. The
346 environment variable may also be used to set the architecture. Architectures
349 (Intel 8086 and 286),
351 (Intel 386, 486, ...),
353 (Motorola MC68000 & MC68010, 16-bit ints),
355 (Motorola MC68000 & MC68010, 32-bit ints),
357 (Motorola MC68020, 32-bit ints),
359 (Sun SPARC). (MINIX 3) (Ignored under Minix-86.)
362 Set the output file for the
367 options, or choose the executable name instead of the default
369 (Minix-86 can only choose the executable name.)
372 Extend the library search path with
374 These directories are searched for libraries named by
376 in the given order before the standard places. The standard places are
382 The search for libaries in directories added with
391 is the machine architecture name. This is
392 MINIX 3 dependent, compilers on other systems usually only look in
398 as the standard places.)
404 Create a Separate I&D or a common I&D executable. The text segment of a
405 separate I&D executable is read-only and shareable. For an
407 binary this also means that the text and data segment can each be 64
408 kilobytes large instead of just 64 kilobytes together. Separate I&D is the
409 default. Common I&D is probably only useful for the bootstraps. The
411 option has the same meaning as
413 but should no longer be used.
418 Makes the loader produce a relocatable object file, i.e. a file that
419 may be loaded again. The runtime startoff and the default libraries are
420 omitted, only the files mentioned are combined. (MINIX 3)
425 bytes of heap and stack.
427 is a C-style decimal, octal, or hexadecimal number, optionally followed by
434 for mega (1024*1024), kilo (1024), "word" (2 or 4), and byte (1). Uppercase
435 letters are accepted too. A size of
437 is used by default, translating to 64k for
439 and 132k for other architectures. Too large a size is rounded down to keep
440 the data segment within 64 kilobytes for the
444 All leftover operands are treated as files to be compiled, with one
445 exception. The construct
447 is used to denote a library, usually
448 .BI lib library .a\fR,
449 that is to be searched in the directories mentioned with
451 or the standard places. These libraries keep their place among the
452 (transformed) input files when presented to the loader. (It is a common
454 .BR "cc\ \-lcurses\ x.c"
456 .BR "cc\ x.c\ \-lcurses" .)
458 The MINIX 3 compiler implementation uses the ACK compilers adapted for use
459 under MINIX 3 as described below. Read
461 for more detailed information on the ACK compilers themselves.
462 .SS "Feature test macros"
463 The preprocessors are given these arguments to define feature test macros:
465 tells what compiler is used.
467 tells that this is MINIX 3.
469 tells the architecture.
470 (More macros are defined, but they are only to be used in the include files.)
472 The symbols above are predefined by the preprocessor so that your program is
473 able to "sense" the environment it is in. It is also possible for your
474 program to do the opposite, to tell what kind of environment it likes to
477 compiles a standard C program. If you want the extensions described in
478 POSIX.1 to become visible, then you have to set
479 .BR _POSIX_SOURCE " to " 1
480 at the start of your program.
481 To enable \s-2UNIX\s+2 or MINIX 3 extensions you need to also set
482 .BR _MINIX " to " 1 .
483 If you don't want to clutter your source files with these symbols then you
485 .B cc \-D_MINIX \-D_POSIX_SOURCE
486 to get the POSIX.1 and the MINIX 3 extensions.
488 Pascal, Modula-2, EM source (see below), and Assembly source are
489 preprocessed by the C preprocessor if the very first character in the file
490 is a '\fB#\fP' character.
491 .SS "Assembly dialects"
492 No two compilers use the same assembly language. To be able to use the same
493 assembly dialect for the low level support routines an assembly converter is
494 provided. The input of this converter can be of type
499 and the output can be of type
504 The suffix of the file tells the assembly dialect (see below), or one can
507 to tell the driver what the dialect of a plain
509 file is. The assembly converter is not as smart as the assembler, the
510 translation is more or less a text substitution. It leaves a lot of
511 checking to the target assembler. You have to restrict yourself to a subset
512 that is understood by both assemblers. The ACK assembler for instance
513 doesn't care if you use `ax' or `eax' for a 32 bit register, it looks at the
514 instruction type. The GNU assembler doesn't like this, so you have to use
515 the proper register name in ACK assembly that is to be translated to GNU
516 assembly. Expressions are converted as is, even if the operator precedence
517 rules of the two assembly languages differ. So use parentheses. The
518 converter does promise one thing: compiler output can be properly
519 translated. (Note that under Minix-86
521 is ignored. All assembly should therefore be in the "ncc" dialect.)
525 The compiler description file.
528 Suffix of a C source file.
537 Preprocessed C source.
540 ACK machine independent compact EM code produced by the C, Pascal, or
541 Modula-2 front end (or any other ACK front end.) The ACK compilers are
542 based on the UNCOL idea where several front ends compile to a common
543 intermediate language, and several back ends transform the intermediate
544 language to the target machine language. The ACK intermediate language
548 Peephole optimized EM.
551 Result of the (optional) EM global optimizer.
554 Result of the second EM peephole optimizer used after the global optimizer.
557 Human readable EM. (Human created or decoded compact EM.)
560 Target machine assembly. (Current compiler dialect.)
566 ACK Xenix style assembly. This dialect is used by the 16 bit ACK ANSI C
573 BCC assembly. (Used by the Bruce Evans' BCC compiler, for many years the
574 compiler for Minix-386.)
583 Default output executable.
588 Kees J. Bot (kjb@cs.vu.nl)