This commit is contained in:
bellard
2003-05-24 16:12:58 +00:00
parent 98713a6be3
commit 4e6edcdcdd
3 changed files with 61 additions and 18 deletions

View File

@ -67,9 +67,7 @@ generation (@pxref{Libtcc}).
@example
@c man begin SYNOPSIS
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}]
[@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{}]
usage: tcc [options] [@var{infile1} @var{infile2}@dots{}] [@option{-run} @var{infile} @var{args}@dots{}]
@c man end
@end example
@ -181,6 +179,27 @@ also be defined: @option{-DF(a)=a+1}
Undefine preprocessor symbol @samp{sym}.
@end table
Warning options:
Note: each warning option has a negative form beginning with @option{-Wno-}.
@table @option
@item -Wunsupported
Warn about unsupported GCC features that are ignored by TCC.
@item -Wwrite-strings
Make string constants being of type @code{const char *} intead of @code{char
*}.
@item -Werror
Abort compilation if warnings are issued.
@item -Wall
Activate all warnings, except @option{-Werror}, @option{-Wunusupported} and
@option{-Wwrite-strings} (currently not useful).
@end table
Linker options:
@table @option
@ -201,6 +220,10 @@ must also be given).
Generate a statically linked executable (default is a shared linked
executable) (@option{-o} option must also be given).
@item -rdynamic
Export global symbols to the dynamic linker. It is useful when a library
opened with @code{dlopen()} needs to access executable symbols.
@item -r
Generate an object file combining all input files (@option{-o} option must
also be given).
@ -227,7 +250,7 @@ Display N callers in stack traces. This is useful with @option{-g} or
@end table
Note: GCC options @option{-Ox}, @option{-Wx}, @option{-fx} and @option{-mx} are
Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are
ignored.
@c man end
@ -434,6 +457,9 @@ TCC includes its own x86 inline assembler with a @code{gas}-like (GNU
assembler) syntax. No intermediate files are generated. GCC 3.x named
operands are supported.
@item @code{__builtin_types_compatible_p()} and @code{__builtin_constant_p()}
are supported.
@end itemize
@section TinyCC extensions
@ -531,6 +557,12 @@ They can be defined several times in the same source. Use 'b'
@cindex .short
@cindex .int
@cindex .long
@cindex .string
@cindex .globl
@cindex .section
@cindex .text
@cindex .data
@cindex .bss
All directives are preceeded by a '.'. The following directives are
supported:
@ -544,6 +576,12 @@ supported:
@item .short value1[,value2...]
@item .int value1[,value2...]
@item .long value1[,value2...]
@item .string string
@item .global symbol
@item .section section
@item .text
@item .data
@item .bss
@end itemize
@section X86 Assembler
@ -569,10 +607,10 @@ Dynamic ELF libraries can be output but the C compiler does not generate
position independent code (PIC). It means that the dynamic librairy
code generated by TCC cannot be factorized among processes yet.
TCC linker cannot currently eliminate unused object code. But TCC
will soon integrate a novel feature not found in GNU tools: unused code
will be eliminated at the function or variable level, provided you only
use TCC to compile your files.
TCC linker eliminates unreferenced object code in libraries. A single pass is
done on the object and library list, so the order in which object files and
libraries are specified is important (same constraint as GNU ld). No grouping
options (@option{--start-group} and @option{--end-group}) are supported.
@section ELF file loader
@ -584,12 +622,15 @@ libraries (.so).
@cindex linker scripts
@cindex GROUP, linker command
@cindex FILE, linker command
@cindex OUTPUT_FORMAT, linker command
@cindex TARGET, linker command
Because on many Linux systems some dynamic libraries (such as
@file{/usr/lib/libc.so}) are in fact GNU ld link scripts (horrible!),
the TCC linker also supports a subset of GNU ld scripts.
The @code{GROUP} and @code{FILE} commands are supported.
The @code{GROUP} and @code{FILE} commands are supported. @code{OUTPUT_FORMAT}
and @code{TARGET} are ignored.
Example from @file{/usr/lib/libc.so}:
@example