Changeset 331 for EcnlProtoTool/trunk/tcc-0.9.27/tcc.1
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/tcc-0.9.27
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/tcc-0.9.27/tcc.1
r279 r331 1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 2 .\" 3 .\" Standard preamble: 4 .\" ======================================================================== 5 .de Sh \" Subsection heading 6 .br 7 .if t .Sp 8 .ne 5 9 .PP 10 \fB\\$1\fR 11 .PP 12 .. 13 .de Sp \" Vertical space (when we can't use .PP) 14 .if t .sp .5v 15 .if n .sp 16 .. 17 .de Vb \" Begin verbatim text 18 .ft CW 19 .nf 20 .ne \\$1 21 .. 22 .de Ve \" End verbatim text 23 .ft R 24 .fi 25 .. 26 .\" Set up some character translations and predefined strings. \*(-- will 27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left 28 .\" double quote, and \*(R" will give a right double quote. | will give a 29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to 30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' 31 .\" expand to `' in nroff, nothing in troff, for use with C<>. 32 .tr \(*W-|\(bv\*(Tr 33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 34 .ie n \{\ 35 . ds -- \(*W- 36 . ds PI pi 37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch 38 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch 39 . ds L" "" 40 . ds R" "" 41 . ds C` "" 42 . ds C' "" 43 'br\} 44 .el\{\ 45 . ds -- \|\(em\| 46 . ds PI \(*p 47 . ds L" `` 48 . ds R" '' 49 'br\} 50 .\" 51 .\" If the F register is turned on, we'll generate index entries on stderr for 52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index 53 .\" entries marked with X<> in POD. Of course, you'll have to process the 54 .\" output yourself in some meaningful fashion. 55 .if \nF \{\ 56 . de IX 57 . tm Index:\\$1\t\\n%\t"\\$2" 58 .. 59 . nr % 0 60 . rr F 61 .\} 62 .\" 63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes 64 .\" way too many mistakes in technical documents. 65 .hy 0 66 .if n .na 67 .\" 68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 69 .\" Fear. Run. Save yourself. No user-serviceable parts. 70 . \" fudge factors for nroff and troff 71 .if n \{\ 72 . ds #H 0 73 . ds #V .8m 74 . ds #F .3m 75 . ds #[ \f1 76 . ds #] \fP 77 .\} 78 .if t \{\ 79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m) 80 . ds #V .6m 81 . ds #F 0 82 . ds #[ \& 83 . ds #] \& 84 .\} 85 . \" simple accents for nroff and troff 86 .if n \{\ 87 . ds ' \& 88 . ds ` \& 89 . ds ^ \& 90 . ds , \& 91 . ds ~ ~ 92 . ds / 93 .\} 94 .if t \{\ 95 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" 96 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' 97 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' 98 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' 99 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' 100 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' 101 .\} 102 . \" troff and (daisy-wheel) nroff accents 103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' 104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H' 105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] 106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' 107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' 108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] 109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] 110 .ds ae a\h'-(\w'a'u*4/10)'e 111 .ds Ae A\h'-(\w'A'u*4/10)'E 112 . \" corrections for vroff 113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' 114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' 115 . \" for low resolution devices (crt and lpr) 116 .if \n(.H>23 .if \n(.V>19 \ 117 \{\ 118 . ds : e 119 . ds 8 ss 120 . ds o a 121 . ds d- d\h'-1'\(ga 122 . ds D- D\h'-1'\(hy 123 . ds th \o'bp' 124 . ds Th \o'LP' 125 . ds ae ae 126 . ds Ae AE 127 .\} 128 .rm #[ #] #H #V #F C 129 .\" ======================================================================== 130 .\" 131 .IX Title "TCC 1" 132 .TH TCC 1 "2018-01-07" "0.9.27" "Tiny C Compiler" 133 .SH "NAME" 134 tcc \- Tiny C Compiler 135 .SH "SYNOPSIS" 136 .IX Header "SYNOPSIS" 137 usage: tcc [options] [\fIinfile1\fR \fIinfile2\fR...] [\fB\-run\fR \fIinfile\fR \fIargs\fR...] 138 .SH "DESCRIPTION" 139 .IX Header "DESCRIPTION" 140 \&\s-1TCC\s0 options are a very much like gcc options. The main difference is that \s-1TCC\s0 141 can also execute directly the resulting program and give it runtime 142 arguments. 143 .PP 144 Here are some examples to understand the logic: 145 .ie n .IP """\f(CBtcc \-run a.c\f(CW""" 4 146 .el .IP "\f(CW\f(CBtcc \-run a.c\f(CW\fR" 4 147 .IX Item "tcc -run a.c" 148 Compile \fIa.c\fR and execute it directly 149 .ie n .IP """\f(CBtcc \-run a.c arg1\f(CW""" 4 150 .el .IP "\f(CW\f(CBtcc \-run a.c arg1\f(CW\fR" 4 151 .IX Item "tcc -run a.c arg1" 152 Compile a.c and execute it directly. arg1 is given as first argument to 153 the \f(CW\*(C`main()\*(C'\fR of a.c. 154 .ie n .IP """\f(CBtcc a.c \-run b.c arg1\f(CW""" 4 155 .el .IP "\f(CW\f(CBtcc a.c \-run b.c arg1\f(CW\fR" 4 156 .IX Item "tcc a.c -run b.c arg1" 157 Compile \fIa.c\fR and \fIb.c\fR, link them together and execute them. arg1 is given 158 as first argument to the \f(CW\*(C`main()\*(C'\fR of the resulting program. 159 .ie n .IP """\f(CBtcc \-o myprog a.c b.c\f(CW""" 4 160 .el .IP "\f(CW\f(CBtcc \-o myprog a.c b.c\f(CW\fR" 4 161 .IX Item "tcc -o myprog a.c b.c" 162 Compile \fIa.c\fR and \fIb.c\fR, link them and generate the executable \fImyprog\fR. 163 .ie n .IP """\f(CBtcc \-o myprog a.o b.o\f(CW""" 4 164 .el .IP "\f(CW\f(CBtcc \-o myprog a.o b.o\f(CW\fR" 4 165 .IX Item "tcc -o myprog a.o b.o" 166 link \fIa.o\fR and \fIb.o\fR together and generate the executable \fImyprog\fR. 167 .ie n .IP """\f(CBtcc \-c a.c\f(CW""" 4 168 .el .IP "\f(CW\f(CBtcc \-c a.c\f(CW\fR" 4 169 .IX Item "tcc -c a.c" 170 Compile \fIa.c\fR and generate object file \fIa.o\fR. 171 .ie n .IP """\f(CBtcc \-c asmfile.S\f(CW""" 4 172 .el .IP "\f(CW\f(CBtcc \-c asmfile.S\f(CW\fR" 4 173 .IX Item "tcc -c asmfile.S" 174 Preprocess with C preprocess and assemble \fIasmfile.S\fR and generate 175 object file \fIasmfile.o\fR. 176 .ie n .IP """\f(CBtcc \-c asmfile.s\f(CW""" 4 177 .el .IP "\f(CW\f(CBtcc \-c asmfile.s\f(CW\fR" 4 178 .IX Item "tcc -c asmfile.s" 179 Assemble (but not preprocess) \fIasmfile.s\fR and generate object file 180 \&\fIasmfile.o\fR. 181 .ie n .IP """\f(CBtcc \-r \-o ab.o a.c b.c\f(CW""" 4 182 .el .IP "\f(CW\f(CBtcc \-r \-o ab.o a.c b.c\f(CW\fR" 4 183 .IX Item "tcc -r -o ab.o a.c b.c" 184 Compile \fIa.c\fR and \fIb.c\fR, link them together and generate the object file \fIab.o\fR. 185 .PP 186 Scripting: 187 .PP 188 \&\s-1TCC\s0 can be invoked from \fIscripts\fR, just as shell scripts. You just 189 need to add \f(CW\*(C`#!/usr/local/bin/tcc \-run\*(C'\fR at the start of your C source: 190 .PP 191 .Vb 2 192 \& #!/usr/local/bin/tcc -run 193 \& #include <stdio.h> 194 .Ve 195 .PP 196 .Vb 5 197 \& int main() 198 \& { 199 \& printf("Hello World\en"); 200 \& return 0; 201 \& } 202 .Ve 203 .PP 204 \&\s-1TCC\s0 can read C source code from \fIstandard input\fR when \fB\-\fR is used in 205 place of \fBinfile\fR. Example: 206 .PP 207 .Vb 1 208 \& echo 'main(){puts("hello");}' | tcc -run - 209 .Ve 210 .SH "OPTIONS" 211 .IX Header "OPTIONS" 212 .IP "\fB\-c\fR" 4 213 .IX Item "-c" 214 Generate an object file. 215 .IP "\fB\-o outfile\fR" 4 216 .IX Item "-o outfile" 217 Put object file, executable, or dll into output file \fIoutfile\fR. 218 .IP "\fB\-run source [args...]\fR" 4 219 .IX Item "-run source [args...]" 220 Compile file \fIsource\fR and run it with the command line arguments 221 \&\fIargs\fR. In order to be able to give more than one argument to a 222 script, several \s-1TCC\s0 options can be given \fIafter\fR the 223 \&\fB\-run\fR option, separated by spaces: 224 .Sp 225 .Vb 1 226 \& tcc "-run -L/usr/X11R6/lib -lX11" ex4.c 227 .Ve 228 .Sp 229 In a script, it gives the following header: 230 .Sp 231 .Vb 1 232 \& #!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11 233 .Ve 234 .IP "\fB\-v\fR" 4 235 .IX Item "-v" 236 Display \s-1TCC\s0 version. 237 .IP "\fB\-vv\fR" 4 238 .IX Item "-vv" 239 Show included files. As sole argument, print search dirs. \-vvv shows tries too. 240 .IP "\fB\-bench\fR" 4 241 .IX Item "-bench" 242 Display compilation statistics. 243 .PP 244 Preprocessor options: 245 .IP "\fB\-Idir\fR" 4 246 .IX Item "-Idir" 247 Specify an additional include path. Include paths are searched in the 248 order they are specified. 249 .Sp 250 System include paths are always searched after. The default system 251 include paths are: \fI/usr/local/include\fR, \fI/usr/include\fR 252 and \fIPREFIX/lib/tcc/include\fR. (\fI\s-1PREFIX\s0\fR is usually 253 \&\fI/usr\fR or \fI/usr/local\fR). 254 .IP "\fB\-Dsym[=val]\fR" 4 255 .IX Item "-Dsym[=val]" 256 Define preprocessor symbol \fBsym\fR to 257 val. If val is not present, its value is \fB1\fR. Function-like macros can 258 also be defined: \fB\-DF(a)=a+1\fR 259 .IP "\fB\-Usym\fR" 4 260 .IX Item "-Usym" 261 Undefine preprocessor symbol \fBsym\fR. 262 .IP "\fB\-E\fR" 4 263 .IX Item "-E" 264 Preprocess only, to stdout or file (with \-o). 265 .PP 266 Compilation flags: 267 .PP 268 Note: each of the following options has a negative form beginning with 269 \&\fB\-fno\-\fR. 270 .IP "\fB\-funsigned\-char\fR" 4 271 .IX Item "-funsigned-char" 272 Let the \f(CW\*(C`char\*(C'\fR type be unsigned. 273 .IP "\fB\-fsigned\-char\fR" 4 274 .IX Item "-fsigned-char" 275 Let the \f(CW\*(C`char\*(C'\fR type be signed. 276 .IP "\fB\-fno\-common\fR" 4 277 .IX Item "-fno-common" 278 Do not generate common symbols for uninitialized data. 279 .IP "\fB\-fleading\-underscore\fR" 4 280 .IX Item "-fleading-underscore" 281 Add a leading underscore at the beginning of each C symbol. 282 .IP "\fB\-fms\-extensions\fR" 4 283 .IX Item "-fms-extensions" 284 Allow a \s-1MS\s0 C compiler extensions to the language. Currently this 285 assumes a nested named structure declaration without an identifier 286 behaves like an unnamed one. 287 .IP "\fB\-fdollars\-in\-identifiers\fR" 4 288 .IX Item "-fdollars-in-identifiers" 289 Allow dollar signs in identifiers 290 .PP 291 Warning options: 292 .IP "\fB\-w\fR" 4 293 .IX Item "-w" 294 Disable all warnings. 295 .PP 296 Note: each of the following warning options has a negative form beginning with 297 \&\fB\-Wno\-\fR. 298 .IP "\fB\-Wimplicit\-function\-declaration\fR" 4 299 .IX Item "-Wimplicit-function-declaration" 300 Warn about implicit function declaration. 301 .IP "\fB\-Wunsupported\fR" 4 302 .IX Item "-Wunsupported" 303 Warn about unsupported \s-1GCC\s0 features that are ignored by \s-1TCC\s0. 304 .IP "\fB\-Wwrite\-strings\fR" 4 305 .IX Item "-Wwrite-strings" 306 Make string constants be of type \f(CW\*(C`const char *\*(C'\fR instead of \f(CW\*(C`char 307 *\*(C'\fR. 308 .IP "\fB\-Werror\fR" 4 309 .IX Item "-Werror" 310 Abort compilation if warnings are issued. 311 .IP "\fB\-Wall\fR" 4 312 .IX Item "-Wall" 313 Activate all warnings, except \fB\-Werror\fR, \fB\-Wunusupported\fR and 314 \&\fB\-Wwrite\-strings\fR. 315 .PP 316 Linker options: 317 .IP "\fB\-Ldir\fR" 4 318 .IX Item "-Ldir" 319 Specify an additional static library path for the \fB\-l\fR option. The 320 default library paths are \fI/usr/local/lib\fR, \fI/usr/lib\fR and \fI/lib\fR. 321 .IP "\fB\-lxxx\fR" 4 322 .IX Item "-lxxx" 323 Link your program with dynamic library libxxx.so or static library 324 libxxx.a. The library is searched in the paths specified by the 325 \&\fB\-L\fR option and \fB\s-1LIBRARY_PATH\s0\fR variable. 326 .IP "\fB\-Bdir\fR" 4 327 .IX Item "-Bdir" 328 Set the path where the tcc internal libraries (and include files) can be 329 found (default is \fIPREFIX/lib/tcc\fR). 330 .IP "\fB\-shared\fR" 4 331 .IX Item "-shared" 332 Generate a shared library instead of an executable. 333 .IP "\fB\-soname name\fR" 4 334 .IX Item "-soname name" 335 set name for shared library to be used at runtime 336 .IP "\fB\-static\fR" 4 337 .IX Item "-static" 338 Generate a statically linked executable (default is a shared linked 339 executable). 340 .IP "\fB\-rdynamic\fR" 4 341 .IX Item "-rdynamic" 342 Export global symbols to the dynamic linker. It is useful when a library 343 opened with \f(CW\*(C`dlopen()\*(C'\fR needs to access executable symbols. 344 .IP "\fB\-r\fR" 4 345 .IX Item "-r" 346 Generate an object file combining all input files. 347 .IP "\fB\-Wl,\-rpath=path\fR" 4 348 .IX Item "-Wl,-rpath=path" 349 Put custom search path for dynamic libraries into executable. 350 .IP "\fB\-Wl,\-\-enable\-new\-dtags\fR" 4 351 .IX Item "-Wl,--enable-new-dtags" 352 When putting a custom search path for dynamic libraries into the executable, 353 create the new \s-1ELF\s0 dynamic tag \s-1DT_RUNPATH\s0 instead of the old legacy \s-1DT_RPATH\s0. 354 .IP "\fB\-Wl,\-\-oformat=fmt\fR" 4 355 .IX Item "-Wl,--oformat=fmt" 356 Use \fIfmt\fR as output format. The supported output formats are: 357 .RS 4 358 .ie n .IP """elf32\-i386""" 4 359 .el .IP "\f(CWelf32\-i386\fR" 4 360 .IX Item "elf32-i386" 361 \&\s-1ELF\s0 output format (default) 362 .ie n .IP """binary""" 4 363 .el .IP "\f(CWbinary\fR" 4 364 .IX Item "binary" 365 Binary image (only for executable output) 366 .ie n .IP """coff""" 4 367 .el .IP "\f(CWcoff\fR" 4 368 .IX Item "coff" 369 \&\s-1COFF\s0 output format (only for executable output for TMS320C67xx target) 370 .RE 371 .RS 4 372 .RE 373 .IP "\fB\-Wl,\-subsystem=console/gui/wince/...\fR" 4 374 .IX Item "-Wl,-subsystem=console/gui/wince/..." 375 Set type for \s-1PE\s0 (Windows) executables. 376 .IP "\fB\-Wl,\-[Ttext=# | section\-alignment=# | file\-alignment=# | image\-base=# | stack=#]\fR" 4 377 .IX Item "-Wl,-[Ttext=# | section-alignment=# | file-alignment=# | image-base=# | stack=#]" 378 Modify executable layout. 379 .IP "\fB\-Wl,\-Bsymbolic\fR" 4 380 .IX Item "-Wl,-Bsymbolic" 381 Set \s-1DT_SYMBOLIC\s0 tag. 382 .IP "\fB\-Wl,\-(no\-)whole\-archive\fR" 4 383 .IX Item "-Wl,-(no-)whole-archive" 384 Turn on/off linking of all objects in archives. 385 .PP 386 Debugger options: 387 .IP "\fB\-g\fR" 4 388 .IX Item "-g" 389 Generate run time debug information so that you get clear run time 390 error messages: \f(CW\*(C` test.c:68: in function 'test5()': dereferencing 391 invalid pointer\*(C'\fR instead of the laconic \f(CW\*(C`Segmentation 392 fault\*(C'\fR. 393 .IP "\fB\-b\fR" 4 394 .IX Item "-b" 395 Generate additional support code to check 396 memory allocations and array/pointer bounds. \fB\-g\fR is implied. Note 397 that the generated code is slower and bigger in this case. 398 .Sp 399 Note: \fB\-b\fR is only available on i386 when using libtcc for the moment. 400 .IP "\fB\-bt N\fR" 4 401 .IX Item "-bt N" 402 Display N callers in stack traces. This is useful with \fB\-g\fR or 403 \&\fB\-b\fR. 404 .PP 405 Misc options: 406 .IP "\fB\-MD\fR" 4 407 .IX Item "-MD" 408 Generate makefile fragment with dependencies. 409 .IP "\fB\-MF depfile\fR" 4 410 .IX Item "-MF depfile" 411 Use \fIdepfile\fR as output for \-MD. 412 .IP "\fB\-print\-search\-dirs\fR" 4 413 .IX Item "-print-search-dirs" 414 Print the configured installation directory and a list of library 415 and include directories tcc will search. 416 .IP "\fB\-dumpversion\fR" 4 417 .IX Item "-dumpversion" 418 Print version. 419 .PP 420 Target specific options: 421 .IP "\fB\-mms\-bitfields\fR" 4 422 .IX Item "-mms-bitfields" 423 Use an algorithm for bitfield alignment consistent with \s-1MSVC\s0. Default is 424 gcc's algorithm. 425 .IP "\fB\-mfloat\-abi (\s-1ARM\s0 only)\fR" 4 426 .IX Item "-mfloat-abi (ARM only)" 427 Select the float \s-1ABI\s0. Possible values: \f(CW\*(C`softfp\*(C'\fR and \f(CW\*(C`hard\*(C'\fR 428 .IP "\fB\-mno\-sse\fR" 4 429 .IX Item "-mno-sse" 430 Do not use sse registers on x86_64 431 .IP "\fB\-m32, \-m64\fR" 4 432 .IX Item "-m32, -m64" 433 Pass command line to the i386/x86_64 cross compiler. 434 .PP 435 Note: \s-1GCC\s0 options \fB\-Ox\fR, \fB\-fx\fR and \fB\-mx\fR are 436 ignored. 437 .SH "ENVIRONMENT" 438 .IX Header "ENVIRONMENT" 439 Environment variables that affect how tcc operates. 440 .IP "\fB\s-1CPATH\s0\fR" 4 441 .IX Item "CPATH" 442 .PD 0 443 .IP "\fBC_INCLUDE_PATH\fR" 4 444 .IX Item "C_INCLUDE_PATH" 445 .PD 446 A colon-separated list of directories searched for include files, 447 directories given with \fB\-I\fR are searched first. 448 .IP "\fB\s-1LIBRARY_PATH\s0\fR" 4 449 .IX Item "LIBRARY_PATH" 450 A colon-separated list of directories searched for libraries for the 451 \&\fB\-l\fR option, directories given with \fB\-L\fR are searched first. 452 .SH "SEE ALSO" 453 .IX Header "SEE ALSO" 454 \&\fIcpp\fR\|(1), 455 \&\fIgcc\fR\|(1) 456 .SH "AUTHOR" 457 .IX Header "AUTHOR" 458 Fabrice Bellard
Note:
See TracChangeset
for help on using the changeset viewer.