67 |
|
|
68 |
@example |
@example |
69 |
@c man begin SYNOPSIS |
@c man begin SYNOPSIS |
70 |
usage: tcc [@option{-v}] [@option{-c}] [@option{-o}@var{outfile}] [@option{-B}@var{dir}] [@option{-bench}] [@option{-I}@var{dir}] [@option{-D}@var{sym[=val]}] [@option{-U}@var{sym}] |
usage: tcc [options] [@var{infile1} @var{infile2}@dots{}] [@option{-run} @var{infile} @var{args}@dots{}] |
|
[@option{-g}] [@option{-b}] [@option{-bt}@var{N}] [@option{-L}@var{dir}] [@option{-l}@var{lib}] [@option{-shared}] [@option{-static}] |
|
|
[@var{infile1} @var{infile2}@dots{}] [@option{run} @var{infile} @var{args}@dots{}] |
|
71 |
@c man end |
@c man end |
72 |
@end example |
@end example |
73 |
|
|
179 |
Undefine preprocessor symbol @samp{sym}. |
Undefine preprocessor symbol @samp{sym}. |
180 |
@end table |
@end table |
181 |
|
|
182 |
|
Warning options: |
183 |
|
|
184 |
|
Note: each warning option has a negative form beginning with @option{-Wno-}. |
185 |
|
|
186 |
|
@table @option |
187 |
|
@item -Wunsupported |
188 |
|
Warn about unsupported GCC features that are ignored by TCC. |
189 |
|
|
190 |
|
@item -Wwrite-strings |
191 |
|
Make string constants being of type @code{const char *} intead of @code{char |
192 |
|
*}. |
193 |
|
|
194 |
|
@item -Werror |
195 |
|
Abort compilation if warnings are issued. |
196 |
|
|
197 |
|
@item -Wall |
198 |
|
Activate all warnings, except @option{-Werror}, @option{-Wunusupported} and |
199 |
|
@option{-Wwrite-strings} (currently not useful). |
200 |
|
|
201 |
|
@end table |
202 |
|
|
203 |
Linker options: |
Linker options: |
204 |
|
|
205 |
@table @option |
@table @option |
220 |
Generate a statically linked executable (default is a shared linked |
Generate a statically linked executable (default is a shared linked |
221 |
executable) (@option{-o} option must also be given). |
executable) (@option{-o} option must also be given). |
222 |
|
|
223 |
|
@item -rdynamic |
224 |
|
Export global symbols to the dynamic linker. It is useful when a library |
225 |
|
opened with @code{dlopen()} needs to access executable symbols. |
226 |
|
|
227 |
@item -r |
@item -r |
228 |
Generate an object file combining all input files (@option{-o} option must |
Generate an object file combining all input files (@option{-o} option must |
229 |
also be given). |
also be given). |
250 |
|
|
251 |
@end table |
@end table |
252 |
|
|
253 |
Note: GCC options @option{-Ox}, @option{-Wx}, @option{-fx} and @option{-mx} are |
Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are |
254 |
ignored. |
ignored. |
255 |
@c man end |
@c man end |
256 |
|
|
457 |
assembler) syntax. No intermediate files are generated. GCC 3.x named |
assembler) syntax. No intermediate files are generated. GCC 3.x named |
458 |
operands are supported. |
operands are supported. |
459 |
|
|
460 |
|
@item @code{__builtin_types_compatible_p()} and @code{__builtin_constant_p()} |
461 |
|
are supported. |
462 |
|
|
463 |
@end itemize |
@end itemize |
464 |
|
|
465 |
@section TinyCC extensions |
@section TinyCC extensions |
557 |
@cindex .short |
@cindex .short |
558 |
@cindex .int |
@cindex .int |
559 |
@cindex .long |
@cindex .long |
560 |
|
@cindex .string |
561 |
|
@cindex .globl |
562 |
|
@cindex .section |
563 |
|
@cindex .text |
564 |
|
@cindex .data |
565 |
|
@cindex .bss |
566 |
|
|
567 |
All directives are preceeded by a '.'. The following directives are |
All directives are preceeded by a '.'. The following directives are |
568 |
supported: |
supported: |
576 |
@item .short value1[,value2...] |
@item .short value1[,value2...] |
577 |
@item .int value1[,value2...] |
@item .int value1[,value2...] |
578 |
@item .long value1[,value2...] |
@item .long value1[,value2...] |
579 |
|
@item .string string |
580 |
|
@item .global symbol |
581 |
|
@item .section section |
582 |
|
@item .text |
583 |
|
@item .data |
584 |
|
@item .bss |
585 |
@end itemize |
@end itemize |
586 |
|
|
587 |
@section X86 Assembler |
@section X86 Assembler |
607 |
position independent code (PIC). It means that the dynamic librairy |
position independent code (PIC). It means that the dynamic librairy |
608 |
code generated by TCC cannot be factorized among processes yet. |
code generated by TCC cannot be factorized among processes yet. |
609 |
|
|
610 |
TCC linker cannot currently eliminate unused object code. But TCC |
TCC linker eliminates unreferenced object code in libraries. A single pass is |
611 |
will soon integrate a novel feature not found in GNU tools: unused code |
done on the object and library list, so the order in which object files and |
612 |
will be eliminated at the function or variable level, provided you only |
libraries are specified is important (same constraint as GNU ld). No grouping |
613 |
use TCC to compile your files. |
options (@option{--start-group} and @option{--end-group}) are supported. |
614 |
|
|
615 |
@section ELF file loader |
@section ELF file loader |
616 |
|
|
622 |
@cindex linker scripts |
@cindex linker scripts |
623 |
@cindex GROUP, linker command |
@cindex GROUP, linker command |
624 |
@cindex FILE, linker command |
@cindex FILE, linker command |
625 |
|
@cindex OUTPUT_FORMAT, linker command |
626 |
|
@cindex TARGET, linker command |
627 |
|
|
628 |
Because on many Linux systems some dynamic libraries (such as |
Because on many Linux systems some dynamic libraries (such as |
629 |
@file{/usr/lib/libc.so}) are in fact GNU ld link scripts (horrible!), |
@file{/usr/lib/libc.so}) are in fact GNU ld link scripts (horrible!), |
630 |
the TCC linker also supports a subset of GNU ld scripts. |
the TCC linker also supports a subset of GNU ld scripts. |
631 |
|
|
632 |
The @code{GROUP} and @code{FILE} commands are supported. |
The @code{GROUP} and @code{FILE} commands are supported. @code{OUTPUT_FORMAT} |
633 |
|
and @code{TARGET} are ignored. |
634 |
|
|
635 |
Example from @file{/usr/lib/libc.so}: |
Example from @file{/usr/lib/libc.so}: |
636 |
@example |
@example |