tcc --help: update option summary

tcc-doc.texi: also
This commit is contained in:
grischka 2013-02-10 20:39:05 +01:00
parent 8042121d74
commit 829655949b
2 changed files with 55 additions and 34 deletions

View file

@ -157,47 +157,38 @@ General Options:
@c man begin OPTIONS @c man begin OPTIONS
@table @option @table @option
@item -v
Display current TCC version, increase verbosity.
@item -print-search-dirs
Print the name of the configured installation directory and a list
of program and library directories tcc will search.
@item -c @item -c
Generate an object file. Generate an object file.
@item -o outfile @item -o outfile
Put object file, executable, or dll into output file @file{outfile}. Put object file, executable, or dll into output file @file{outfile}.
@item -Bdir
Set the path where the tcc internal libraries can be found (default is
@file{PREFIX/lib/tcc}).
@item -bench
Output compilation statistics.
@item -run source [args...] @item -run source [args...]
Compile file @var{source} and run it with the command line arguments Compile file @var{source} and run it with the command line arguments
@var{args}. In order to be able to give more than one argument to a @var{args}. In order to be able to give more than one argument to a
script, several TCC options can be given @emph{after} the script, several TCC options can be given @emph{after} the
@option{-run} option, separated by spaces. Example: @option{-run} option, separated by spaces:
@example @example
tcc "-run -L/usr/X11R6/lib -lX11" ex4.c tcc "-run -L/usr/X11R6/lib -lX11" ex4.c
@end example @end example
In a script, it gives the following header: In a script, it gives the following header:
@example @example
#!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11 #!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11
#include <stdlib.h>
int main(int argc, char **argv)
@{
...
@}
@end example @end example
@item -v
Display TCC version.
@item -vv
Show included files. As sole argument, print search dirs (as below).
@item -bench
Display compilation statistics.
@item -print-search-dirs
Print the configured installation directory and a list of library
and include directories tcc will search.
@end table @end table
Preprocessor options: Preprocessor options:
@ -284,6 +275,10 @@ Link your program with dynamic library libxxx.so or static library
libxxx.a. The library is searched in the paths specified by the libxxx.a. The library is searched in the paths specified by the
@option{-L} option. @option{-L} option.
@item -Bdir
Set the path where the tcc internal libraries (and include files) can be
found (default is @file{PREFIX/lib/tcc}).
@item -shared @item -shared
Generate a shared library instead of an executable. Generate a shared library instead of an executable.
@ -301,10 +296,10 @@ opened with @code{dlopen()} needs to access executable symbols.
@item -r @item -r
Generate an object file combining all input files. Generate an object file combining all input files.
@item -Wl,-Ttext,address @item -Wl,-rpath=path
Set the start of the .text section to @var{address}. Put custom seatch path for dynamic libraries into executable.
@item -Wl,--oformat,fmt @item -Wl,--oformat=fmt
Use @var{fmt} as output format. The supported output formats are: Use @var{fmt} as output format. The supported output formats are:
@table @code @table @code
@item elf32-i386 @item elf32-i386
@ -315,8 +310,14 @@ Binary image (only for executable output)
COFF output format (only for executable output for TMS320C67xx target) COFF output format (only for executable output for TMS320C67xx target)
@end table @end table
@item -Wl,-rpath=path @item -Wl,-subsystem=console/gui/wince/...
Set custom library search path Set type for PE (Windows) executables.
@item -Wl,-[Ttext=# | section-alignment=# | file-alignment=# | image-base=# | stack=#]
Modify executable layout.
@item -Wl,-Bsymbolic
Set DT_SYMBOLIC tag.
@end table @end table
@ -342,6 +343,17 @@ Display N callers in stack traces. This is useful with @option{-g} or
@end table @end table
Misc options:
@table @option
@item -MD
Generate makefile fragment with dependencies.
@item -MF depfile
Use @file{depfile} as output for -MD.
@end table
Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are
ignored. ignored.
@c man end @c man end

21
tcc.c
View file

@ -46,29 +46,33 @@ static void help(void)
"Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n" "Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n"
" tcc [options...] -run infile [arguments...]\n" " tcc [options...] -run infile [arguments...]\n"
"General options:\n" "General options:\n"
" -v display current version, increase verbosity\n"
" -c compile only - generate an object file\n" " -c compile only - generate an object file\n"
" -o outfile set output filename\n" " -o outfile set output filename\n"
" -Bdir set tcc internal library and include path\n"
" -bench output compilation statistics\n"
" -run run compiled source\n" " -run run compiled source\n"
" -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n" " -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n"
" -Wwarning set or reset (with 'no-' prefix) 'warning' (see man page)\n" " -Wwarning set or reset (with 'no-' prefix) 'warning' (see man page)\n"
" -w disable all warnings\n" " -w disable all warnings\n"
" -v show version\n"
" -vv show included files (as sole argument: show search paths)\n"
" -bench show compilation statistics\n"
"Preprocessor options:\n" "Preprocessor options:\n"
" -E preprocess only\n" " -E preprocess only\n"
" -Idir add include path 'dir'\n" " -Idir add include path 'dir'\n"
" -Dsym[=val] define 'sym' with value 'val'\n" " -Dsym[=val] define 'sym' with value 'val'\n"
" -Usym undefine 'sym'\n" " -Usym undefine 'sym'\n"
" -nostdinc do not use standard system include paths\n"
"Linker options:\n" "Linker options:\n"
" -Ldir add library path 'dir'\n" " -Ldir add library path 'dir'\n"
" -llib link with dynamic or static library 'lib'\n" " -llib link with dynamic or static library 'lib'\n"
" -Bdir use 'dir' as tcc internal library and include path\n"
" -nostdlib do not link with standard crt and libraries\n"
" -pthread link with -lpthread and -D_REENTRANT (POSIX Linux)\n" " -pthread link with -lpthread and -D_REENTRANT (POSIX Linux)\n"
" -r generate (relocatable) object file\n"
" -rdynamic export all global symbols to dynamic linker\n"
" -shared generate a shared library\n" " -shared generate a shared library\n"
" -soname set name for shared library to be used at runtime\n" " -soname set name for shared library to be used at runtime\n"
" -static static linking\n" " -static static linking\n"
" -rdynamic export all global symbols to dynamic linker\n" " -Wl,opt[=val] set linker option 'opt' (see manual)\n"
" -r generate (relocatable) object file\n"
"Debugger options:\n" "Debugger options:\n"
" -g generate runtime debug info\n" " -g generate runtime debug info\n"
#ifdef CONFIG_TCC_BCHECK #ifdef CONFIG_TCC_BCHECK
@ -175,7 +179,7 @@ static const TCCOption tcc_options[] = {
{ "MD", TCC_OPTION_MD, 0}, { "MD", TCC_OPTION_MD, 0},
{ "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG }, { "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG },
{ "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG }, { "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG },
{ NULL }, { NULL, 0, 0 },
}; };
static int64_t getclock_us(void) static int64_t getclock_us(void)
@ -458,7 +462,12 @@ static int parse_args(TCCState *s, int argc, char **argv)
case TCC_OPTION_MF: case TCC_OPTION_MF:
deps_outfile = optarg; deps_outfile = optarg;
break; break;
case TCC_OPTION_O:
case TCC_OPTION_pedantic:
case TCC_OPTION_pipe:
case TCC_OPTION_s:
case TCC_OPTION_x: case TCC_OPTION_x:
/* ignored */
break; break;
default: default:
if (s->warn_unsupported) { if (s->warn_unsupported) {