diff --git a/Changelog b/Changelog index 7a0e496..2f8b750 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ version 0.9.19: - fixed macro argument substitution - fixed zero argument macro parsing - changed license to LGPL +- added -rdynamic option support version 0.9.18: diff --git a/TODO b/TODO index 37fd5af..2b289b9 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,13 @@ TODO list: +- long long constant evaluation +- configure --cc=tcc (still one bug in libtcc1.c) +- disable-asm and disable-bcheck options +- test binutils/gcc compile +- add alloca(), __builtin_expect() +- gcc '-E' option. +- optimize VT_LOCAL + const +- tci patch + argument. - '-b' bug. - atexit (Nigel Horne) - see -lxxx bug (Michael Charity). @@ -8,31 +16,24 @@ TODO list: - precise behaviour of typeof with arrays ? (__put_user macro) - #include_next support for /usr/include/limits ? but should suffice for most cases) -- handle '? x, y : z' in reversed function arguments or unsized - variable initialization (',' is considered incorrectly as separator - in preparser) : change func argument code generator ? +- handle '? x, y : z' in unsized variable initialization (',' is + considered incorrectly as separator in preparser) - function pointers/lvalues in ? : (linux kernel net/core/dev.c) - transform functions to function pointers in function parameters (net/ipv4/ip_output.c) - fix function pointer type display - fix bound exit on RedHat 7.3 -- fix static link on RedHat 7.3 - check lcc test suite -> fix bitfield binary operations - check section alignment in C - fix invalid cast in comparison 'if (v == (int8_t)v)' - packed attribute -- look at patches from Scott Lafferty -- look at bugs from Jason Petrasko. - support link once trick (gcc 3.2 / glibc compilation issue) - finish varargs.h support (gcc 3.2 testsuite issue) -- add alloca() - fix static functions declared inside block - C99: add variable size arrays (gcc 3.2 testsuite issue) - C99: add complex types (gcc 3.2 testsuite issue) - postfix compound literals (see 20010124-1.c) - fix multiple unions init -- test includes in libtcc_test. - look at GCC 3.2 compatibility problems. -- add option for auto run - setjmp is not supported properly in bound checking. - better local variables handling (needed for other targets) - fix bound check code with '&' on local variables (currently done diff --git a/tcc-doc.texi b/tcc-doc.texi index 830f40b..df36984 100644 --- a/tcc-doc.texi +++ b/tcc-doc.texi @@ -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