cc.1
来自「minix操作系统最新版本(3.1.1)的源代码」· 1 代码 · 共 589 行 · 第 1/2 页
1
589 行
Ignored. Used under Minix-vmd to omit floating point printing/scanningcode. The standard MINIX 3 compiler figures this out automatically usinga special loader trick. (MINIX 3).TP.B \-wDo not produce warnings about dubious C language constructs. Normallythe compiler is configured to do the maximum amount of checkingwithout being too annoying. (MINIX 3).TP.B \-woOmit warnings about old (K&R) style. (MINIX 3).TP.B \-wsOmit strict warnings. (MINIX 3).TP.B \-waOmit all warnings. (MINIX 3).TP.B \-3Only accept 3rd edition Modula-2. (Modula-2).TP.B \-_Allow underscores in Pascal or Modula-2 identifiers, but not at the beginningof an identifier. (Pascal & Modula-2).TP.BI \-W name \- optionIf.I nameis the name of the compiler this driver is working for, then.I optionis activated for that compiler. See below for a per-compiler list. Any other.B \-Woption is ignored. (\fB\-W\fP is described by \s-2POSIX\s+2 as an optionalflag to send options to the different compiler passes with a totallydifferent (and nicely ignored) syntax as described here.) (Minix-86 ignoresany.B \-Wflag.).TP.B \-mUnder Minix-86 this option transforms the function declarations (prototypes)to the old K&R form, i.e. the arguments declarations are removed. This savesa lot of memory in the compiler and may allow a large program to be compiled.One must make sure that function arguments are properly type-cast wherenecessary. (MINIX 3).TP.BI \-m archSet the target architecture for a cross compiler. Normally the compilerproduces code for the same architecture it itself is compiled for. The.B ARCHenvironment variable may also be used to set the architecture. Architecturesnames are:.B i86(Intel 8086 and 286),.B i386(Intel 386, 486, ...),.B m68000(Motorola MC68000 & MC68010, 16-bit ints),.B m68010(Motorola MC68000 & MC68010, 32-bit ints),.B m68020(Motorola MC68020, 32-bit ints),.B sparc(Sun SPARC). (MINIX 3) (Ignored under Minix-86.).TP.BI \-o " outfile"Set the output file for the.BR \-c ,.BR \-c.a ,and.BR \-Eoptions, or choose the executable name instead of the default.BR a.out .(Minix-86 can only choose the executable name.).TP.BI \-L " directory"Extend the library search path with.IR directory .These directories are searched for libraries named by.B \-lin the given order before the standard places. The standard places are.B /lib/\c.IR arch ,and.B /usr/lib/\c.IR arch .The search for libaries in directories added with.B \-Llooks in.IB directory /\c.IR archand.I directoryitself..RI ( Archis the machine architecture name. This isMINIX 3 dependent, compilers on other systems usually only look in.IR directory .)(Minix-86 only has.B /liband.B /usr/libas the standard places.).PP.B \-sep.br.B \-com.RSCreate a Separate I&D or a common I&D executable. The text segment of aseparate I&D executable is read-only and shareable. For an.B i86binary this also means that the text and data segment can each be 64kilobytes large instead of just 64 kilobytes together. Separate I&D is thedefault. Common I&D is probably only useful for the bootstraps. The.B \-ioption has the same meaning as.BR \-sep ,but should no longer be used.(MINIX 3).RE.TP.B \-rMakes the loader produce a relocatable object file, i.e. a file thatmay be loaded again. The runtime startoff and the default libraries areomitted, only the files mentioned are combined. (MINIX 3).TP.BI \-stack " size"Allow the process.I sizebytes of heap and stack..I Sizeis a C-style decimal, octal, or hexadecimal number, optionally followed bythe multipliers.BR m ,.BR k ,.BR w ,and.B bfor mega (1024*1024), kilo (1024), "word" (2 or 4), and byte (1). Uppercaseletters are accepted too. A size of.B 32kwis used by default, translating to 64k for.BR i86 ,and 132k for other architectures. Too large a size is rounded down to keepthe data segment within 64 kilobytes for the.BR i86 .(MINIX 3).SH OPERANDSAll leftover operands are treated as files to be compiled, with oneexception. The construct.BI \-l " library"is used to denote a library, usually.BI lib library .a\fR,that is to be searched in the directories mentioned with.B \-Lor the standard places. These libraries keep their place among the(transformed) input files when presented to the loader. (It is a commonmistake to write.BR "cc\ \-lcurses\ x.c"instead of.BR "cc\ x.c\ \-lcurses" .).SH IMPLEMENTATIONThe MINIX 3 compiler implementation uses the ACK compilers adapted for useunder MINIX 3 as described below. Read.BR ACK (7)for more detailed information on the ACK compilers themselves..SS "Feature test macros"The preprocessors are given these arguments to define feature test macros:.B \-D__ACK__tells what compiler is used..B \-D__minixtells that this is MINIX 3..BI \-D__ archtells the architecture.(More macros are defined, but they are only to be used in the include files.).PPThe symbols above are predefined by the preprocessor so that your program isable to "sense" the environment it is in. It is also possible for yourprogram to do the opposite, to tell what kind of environment it likes tohave. By default,.B cccompiles a standard C program. If you want the extensions described inPOSIX.1 to become visible, then you have to set.BR _POSIX_SOURCE " to " 1at the start of your program.To enable \s-2UNIX\s+2 or MINIX 3 extensions you need to also set.BR _MINIX " to " 1 .If you don't want to clutter your source files with these symbols then youcan use.B cc \-D_MINIX \-D_POSIX_SOURCEto get the POSIX.1 and the MINIX 3 extensions..SS "Preprocessing"Pascal, Modula-2, EM source (see below), and Assembly source arepreprocessed by the C preprocessor if the very first character in the fileis a '\fB#\fP' character..SS "Assembly dialects"No two compilers use the same assembly language. To be able to use the sameassembly dialect for the low level support routines an assembly converter isprovided. The input of this converter can be of type.BR ack ,.BR ncc ,or.BR bas ,and the output can be of type.BR ack ,.BR ncc ,or.BR gnu .The suffix of the file tells the assembly dialect (see below), or one canuse the option.BI \-Was\- dialectto tell the driver what the dialect of a plain.B .sfile is. The assembly converter is not as smart as the assembler, thetranslation is more or less a text substitution. It leaves a lot ofchecking to the target assembler. You have to restrict yourself to a subsetthat is understood by both assemblers. The ACK assembler for instancedoesn't care if you use `ax' or `eax' for a 32 bit register, it looks at theinstruction type. The GNU assembler doesn't like this, so you have to usethe proper register name in ACK assembly that is to be translated to GNUassembly. Expressions are converted as is, even if the operator precedencerules of the two assembly languages differ. So use parentheses. Theconverter does promise one thing: compiler output can be properlytranslated. (Note that under Minix-86.B \-Wis ignored. All assembly should therefore be in the "ncc" dialect.).SH FILES.TP 10.B /usr/lib/descrThe compiler description file..TP.B .cSuffix of a C source file..TP.B .modModula-2..TP.B .pPascal..TP.B .iPreprocessed C source..TP.B .kACK machine independent compact EM code produced by the C, Pascal, orModula-2 front end (or any other ACK front end.) The ACK compilers arebased on the UNCOL idea where several front ends compile to a commonintermediate language, and several back ends transform the intermediatelanguage to the target machine language. The ACK intermediate languageis named "EM"..TP.B .mPeephole optimized EM..TP.B .gkResult of the (optional) EM global optimizer..TP.B .gResult of the second EM peephole optimizer used after the global optimizer..TP.B .eHuman readable EM. (Human created or decoded compact EM.).TP.B .sTarget machine assembly. (Current compiler dialect.).TP.B .ack.sACK assembly..TP.B .ncc.sACK Xenix style assembly. This dialect is used by the 16 bit ACK ANSI Ccompiler..TP.B .gnu.sGNU assembly..TP.B .bas.sBCC assembly. (Used by the Bruce Evans' BCC compiler, for many years thecompiler for Minix-386.).TP.B .oObject code..TP.B .aObject code library..TP.B a.outDefault output executable..SH "SEE ALSO".BR acd (1),.BR ACK (7)..SH AUTHORKees J. Bot (kjb@cs.vu.nl)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?