⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcc.1

📁 tcc
💻 1
字号:
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13.\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings.  \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote.  | will give a.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'.\" expand to `' in nroff, nothing in troff, for use with C<>..tr \(*W-|\(bv\*(Tr.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\.    ds -- \(*W-.    ds PI pi.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch.    ds L" "".    ds R" "".    ds C` "".    ds C' ""'br\}.el\{\.    ds -- \|\(em\|.    ds PI \(*p.    ds L" ``.    ds R" '''br\}.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..if \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.\".\" For nroff, turn off justification.  Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..hy 0.if n .na.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear.  Run.  Save yourself.  No user-serviceable parts..    \" fudge factors for nroff and troff.if n \{\.    ds #H 0.    ds #V .8m.    ds #F .3m.    ds #[ \f1.    ds #] \fP.\}.if t \{\.    ds #H ((1u-(\\\\n(.fu%2u))*.13m).    ds #V .6m.    ds #F 0.    ds #[ \&.    ds #] \&.\}.    \" simple accents for nroff and troff.if n \{\.    ds ' \&.    ds ` \&.    ds ^ \&.    ds , \&.    ds ~ ~.    ds /.\}.if t \{\.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u".    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}.    \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E.    \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'.    \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\.    ds : e.    ds 8 ss.    ds o a.    ds d- d\h'-1'\(ga.    ds D- D\h'-1'\(hy.    ds th \o'bp'.    ds Th \o'LP'.    ds ae ae.    ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "TCC 1".TH TCC 1 "2003-10-05" " " " ".SH "NAME"tcc \- Tiny C Compiler.SH "SYNOPSIS".IX Header "SYNOPSIS"usage: tcc [options] [\fIinfile1\fR \fIinfile2\fR...] [\fB\-run\fR \fIinfile\fR \fIargs\fR...].SH "DESCRIPTION".IX Header "DESCRIPTION"\&\s-1TCC\s0 options are a very much like gcc options. The main difference is that \s-1TCC\s0can also execute directly the resulting program and give it runtimearguments..PPHere are some examples to understand the logic:.ie n .IP """\f(CBtcc \-run a.c\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-run a.c\f(CW\fR" 4.IX Item "tcc -run a.c"Compile \fIa.c\fR and execute it directly.ie n .IP """\f(CBtcc \-run a.c arg1\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-run a.c arg1\f(CW\fR" 4.IX Item "tcc -run a.c arg1"Compile a.c and execute it directly. arg1 is given as first argument tothe \f(CW\*(C`main()\*(C'\fR of a.c..ie n .IP """\f(CBtcc a.c \-run b.c arg1\f(CW""" 4.el .IP "\f(CW\f(CBtcc a.c \-run b.c arg1\f(CW\fR" 4.IX Item "tcc a.c -run b.c arg1"Compile \fIa.c\fR and \fIb.c\fR, link them together and execute them. arg1 is givenas first argument to the \f(CW\*(C`main()\*(C'\fR of the resulting program. Becausemultiple C files are specified, \fB\-\-\fR are necessary to clearly separate theprogram arguments from the \s-1TCC\s0 options..ie n .IP """\f(CBtcc \-o myprog a.c b.c\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-o myprog a.c b.c\f(CW\fR" 4.IX Item "tcc -o myprog a.c b.c"Compile \fIa.c\fR and \fIb.c\fR, link them and generate the executable \fImyprog\fR..ie n .IP """\f(CBtcc \-o myprog a.o b.o\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-o myprog a.o b.o\f(CW\fR" 4.IX Item "tcc -o myprog a.o b.o"link \fIa.o\fR and \fIb.o\fR together and generate the executable \fImyprog\fR..ie n .IP """\f(CBtcc \-c a.c\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-c a.c\f(CW\fR" 4.IX Item "tcc -c a.c"Compile \fIa.c\fR and generate object file \fIa.o\fR..ie n .IP """\f(CBtcc \-c asmfile.S\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-c asmfile.S\f(CW\fR" 4.IX Item "tcc -c asmfile.S"Preprocess with C preprocess and assemble \fIasmfile.S\fR and generateobject file \fIasmfile.o\fR..ie n .IP """\f(CBtcc \-c asmfile.s\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-c asmfile.s\f(CW\fR" 4.IX Item "tcc -c asmfile.s"Assemble (but not preprocess) \fIasmfile.s\fR and generate object file\&\fIasmfile.o\fR..ie n .IP """\f(CBtcc \-r \-o ab.o a.c b.c\f(CW""" 4.el .IP "\f(CW\f(CBtcc \-r \-o ab.o a.c b.c\f(CW\fR" 4.IX Item "tcc -r -o ab.o a.c b.c"Compile \fIa.c\fR and \fIb.c\fR, link them together and generate the object file \fIab.o\fR..PPScripting:.PP\&\s-1TCC\s0 can be invoked from \fIscripts\fR, just as shell scripts. You justneed to add \f(CW\*(C`#!/usr/local/bin/tcc \-run\*(C'\fR at the start of your C source:.PP.Vb 2\&        #!/usr/local/bin/tcc -run\&        #include <stdio.h>.Ve.PP.Vb 5\&        int main() \&        {\&            printf("Hello World\en");\&            return 0;\&        }.Ve.SH "OPTIONS".IX Header "OPTIONS".IP "\fB\-v\fR" 4.IX Item "-v"Display current \s-1TCC\s0 version..IP "\fB\-c\fR" 4.IX Item "-c"Generate an object file (\fB\-o\fR option must also be given)..IP "\fB\-o outfile\fR" 4.IX Item "-o outfile"Put object file, executable, or dll into output file \fIoutfile\fR..IP "\fB\-Bdir\fR" 4.IX Item "-Bdir"Set the path where the tcc internal libraries can be found (default is\&\fIPREFIX/lib/tcc\fR)..IP "\fB\-bench\fR" 4.IX Item "-bench"Output compilation statistics..IP "\fB\-run source [args...]\fR" 4.IX Item "-run source [args...]"Compile file \fIsource\fR and run it with the command line arguments\&\fIargs\fR. In order to be able to give more than one argument to ascript, several \s-1TCC\s0 options can be given \fIafter\fR the\&\fB\-run\fR option, separated by spaces. Example:.Sp.Vb 1\&        tcc "-run -L/usr/X11R6/lib -lX11" ex4.c.Ve.SpIn a script, it gives the following header:.Sp.Vb 6\&        #!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11\&        #include <stdlib.h>\&        int main(int argc, char **argv)\&        {\&            ...\&        }.Ve.PPPreprocessor options:.IP "\fB\-Idir\fR" 4.IX Item "-Idir"Specify an additional include path. Include paths are searched in theorder they are specified..SpSystem include paths are always searched after. The default systeminclude paths are: \fI/usr/local/include\fR, \fI/usr/include\fRand \fIPREFIX/lib/tcc/include\fR. (\fI\s-1PREFIX\s0\fR is usually\&\fI/usr\fR or \fI/usr/local\fR)..IP "\fB\-Dsym[=val]\fR" 4.IX Item "-Dsym[=val]"Define preprocessor symbol \fBsym\fR toval. If val is not present, its value is \fB1\fR. Function-like macros canalso be defined: \fB\-DF(a)=a+1\fR.IP "\fB\-Usym\fR" 4.IX Item "-Usym"Undefine preprocessor symbol \fBsym\fR..PPWarning options:.IP "\fB\-w\fR" 4.IX Item "-w"Disable all warnings..PPNote: each of the following warning options has a negative form beginning with\&\fB\-Wno\-\fR..IP "\fB\-Wunsupported\fR" 4.IX Item "-Wunsupported"Warn about unsupported \s-1GCC\s0 features that are ignored by \s-1TCC\s0..IP "\fB\-Wwrite\-strings\fR" 4.IX Item "-Wwrite-strings"Make string constants being of type \f(CW\*(C`const char *\*(C'\fR intead of \f(CW\*(C`char*\*(C'\fR..IP "\fB\-Werror\fR" 4.IX Item "-Werror"Abort compilation if warnings are issued..IP "\fB\-Wall\fR" 4.IX Item "-Wall"Activate all warnings, except \fB\-Werror\fR, \fB\-Wunusupported\fR and\&\fB\-Wwrite\-strings\fR (currently not useful)..PPLinker options:.IP "\fB\-Ldir\fR" 4.IX Item "-Ldir"Specify an additional static library path for the \fB\-l\fR option. Thedefault library paths are \fI/usr/local/lib\fR, \fI/usr/lib\fR and \fI/lib\fR..IP "\fB\-lxxx\fR" 4.IX Item "-lxxx"Link your program with dynamic library libxxx.so or static librarylibxxx.a. The library is searched in the paths specified by the\&\fB\-L\fR option..IP "\fB\-shared\fR" 4.IX Item "-shared"Generate a shared library instead of an executable (\fB\-o\fR optionmust also be given)..IP "\fB\-static\fR" 4.IX Item "-static"Generate a statically linked executable (default is a shared linkedexecutable) (\fB\-o\fR option must also be given)..IP "\fB\-rdynamic\fR" 4.IX Item "-rdynamic"Export global symbols to the dynamic linker. It is useful when a libraryopened with \f(CW\*(C`dlopen()\*(C'\fR needs to access executable symbols..IP "\fB\-r\fR" 4.IX Item "-r"Generate an object file combining all input files (\fB\-o\fR option mustalso be given)..PPDebugger options:.IP "\fB\-g\fR" 4.IX Item "-g"Generate run time debug information so that you get clear run timeerror messages: \f(CW\*(C` test.c:68: in function 'test5()': dereferencinginvalid pointer\*(C'\fR instead of the laconic \f(CW\*(C`Segmentationfault\*(C'\fR..IP "\fB\-b\fR" 4.IX Item "-b"Generate additional support code to checkmemory allocations and array/pointer bounds. \fB\-g\fR is implied. Notethat the generated code is slower and bigger in this case..IP "\fB\-bt N\fR" 4.IX Item "-bt N"Display N callers in stack traces. This is useful with \fB\-g\fR or\&\fB\-b\fR..PPNote: \s-1GCC\s0 options \fB\-Ox\fR, \fB\-fx\fR and \fB\-mx\fR areignored..SH "SEE ALSO".IX Header "SEE ALSO"\&\fIgcc\fR\|(1).SH "AUTHOR".IX Header "AUTHOR"Fabrice Bellard

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -