mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-27 06:10:06 +08:00
tcc --help: update option summary
tcc-doc.texi: also
This commit is contained in:
parent
8042121d74
commit
829655949b
68
tcc-doc.texi
68
tcc-doc.texi
@ -157,47 +157,38 @@ General Options:
|
||||
|
||||
@c man begin OPTIONS
|
||||
@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
|
||||
Generate an object file.
|
||||
|
||||
@item -o 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...]
|
||||
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
|
||||
script, several TCC options can be given @emph{after} the
|
||||
@option{-run} option, separated by spaces. Example:
|
||||
|
||||
@option{-run} option, separated by spaces:
|
||||
@example
|
||||
tcc "-run -L/usr/X11R6/lib -lX11" ex4.c
|
||||
@end example
|
||||
|
||||
In a script, it gives the following header:
|
||||
|
||||
@example
|
||||
#!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11
|
||||
#include <stdlib.h>
|
||||
int main(int argc, char **argv)
|
||||
@{
|
||||
...
|
||||
@}
|
||||
@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
|
||||
|
||||
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
|
||||
@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
|
||||
Generate a shared library instead of an executable.
|
||||
|
||||
@ -301,10 +296,10 @@ opened with @code{dlopen()} needs to access executable symbols.
|
||||
@item -r
|
||||
Generate an object file combining all input files.
|
||||
|
||||
@item -Wl,-Ttext,address
|
||||
Set the start of the .text section to @var{address}.
|
||||
@item -Wl,-rpath=path
|
||||
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:
|
||||
@table @code
|
||||
@item elf32-i386
|
||||
@ -315,8 +310,14 @@ Binary image (only for executable output)
|
||||
COFF output format (only for executable output for TMS320C67xx target)
|
||||
@end table
|
||||
|
||||
@item -Wl,-rpath=path
|
||||
Set custom library search path
|
||||
@item -Wl,-subsystem=console/gui/wince/...
|
||||
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
|
||||
|
||||
@ -342,6 +343,17 @@ Display N callers in stack traces. This is useful with @option{-g} or
|
||||
|
||||
@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
|
||||
ignored.
|
||||
@c man end
|
||||
|
21
tcc.c
21
tcc.c
@ -46,29 +46,33 @@ static void help(void)
|
||||
"Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n"
|
||||
" tcc [options...] -run infile [arguments...]\n"
|
||||
"General options:\n"
|
||||
" -v display current version, increase verbosity\n"
|
||||
" -c compile only - generate an object file\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"
|
||||
" -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n"
|
||||
" -Wwarning set or reset (with 'no-' prefix) 'warning' (see man page)\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"
|
||||
" -E preprocess only\n"
|
||||
" -Idir add include path 'dir'\n"
|
||||
" -Dsym[=val] define 'sym' with value 'val'\n"
|
||||
" -Usym undefine 'sym'\n"
|
||||
" -nostdinc do not use standard system include paths\n"
|
||||
"Linker options:\n"
|
||||
" -Ldir add library path 'dir'\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"
|
||||
" -r generate (relocatable) object file\n"
|
||||
" -rdynamic export all global symbols to dynamic linker\n"
|
||||
" -shared generate a shared library\n"
|
||||
" -soname set name for shared library to be used at runtime\n"
|
||||
" -static static linking\n"
|
||||
" -rdynamic export all global symbols to dynamic linker\n"
|
||||
" -r generate (relocatable) object file\n"
|
||||
" -Wl,opt[=val] set linker option 'opt' (see manual)\n"
|
||||
"Debugger options:\n"
|
||||
" -g generate runtime debug info\n"
|
||||
#ifdef CONFIG_TCC_BCHECK
|
||||
@ -175,7 +179,7 @@ static const TCCOption tcc_options[] = {
|
||||
{ "MD", TCC_OPTION_MD, 0},
|
||||
{ "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG },
|
||||
{ "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG },
|
||||
{ NULL },
|
||||
{ NULL, 0, 0 },
|
||||
};
|
||||
|
||||
static int64_t getclock_us(void)
|
||||
@ -458,7 +462,12 @@ static int parse_args(TCCState *s, int argc, char **argv)
|
||||
case TCC_OPTION_MF:
|
||||
deps_outfile = optarg;
|
||||
break;
|
||||
case TCC_OPTION_O:
|
||||
case TCC_OPTION_pedantic:
|
||||
case TCC_OPTION_pipe:
|
||||
case TCC_OPTION_s:
|
||||
case TCC_OPTION_x:
|
||||
/* ignored */
|
||||
break;
|
||||
default:
|
||||
if (s->warn_unsupported) {
|
||||
|
Loading…
Reference in New Issue
Block a user