History

tcc --help: update option summary

tcc-doc.texi: also

grischka committed 13 years ago

Commit 82965591 parent 80421212 files · +55 −34Browse files

Unified · Split

2 files
  1. tcc-doc.texi +40 −28
  2. tcc.c +15 −6
tcc-doc.texi+40−28
@@ -157,47 +157,38 @@ General Options: · 156 unmodified lines
157 157
158@c man begin OPTIONS158@c man begin OPTIONS
159@table @option159@table @option
160@item -v
161Display current TCC version, increase verbosity.
162
163@item -print-search-dirs
164Print the name of the configured installation directory and a list
165of program and library directories tcc will search.
166
167@item -c160@item -c
168Generate an object file.161Generate an object file.
169 162
170@item -o outfile163@item -o outfile
171Put object file, executable, or dll into output file @file{outfile}.164Put object file, executable, or dll into output file @file{outfile}.
172 165
173@item -Bdir
174Set the path where the tcc internal libraries can be found (default is
175@file{PREFIX/lib/tcc}).
176
177@item -bench
178Output compilation statistics.
179
180@item -run source [args...]166@item -run source [args...]
181Compile file @var{source} and run it with the command line arguments167Compile file @var{source} and run it with the command line arguments
182@var{args}. In order to be able to give more than one argument to a168@var{args}. In order to be able to give more than one argument to a
183script, several TCC options can be given @emph{after} the169script, several TCC options can be given @emph{after} the
184@option{-run} option, separated by spaces. Example:170@option{-run} option, separated by spaces:
185
186@example171@example
187tcc "-run -L/usr/X11R6/lib -lX11" ex4.c172tcc "-run -L/usr/X11R6/lib -lX11" ex4.c
188@end example173@end example
189
190In a script, it gives the following header:174In a script, it gives the following header:
191
192@example175@example
193#!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11176#!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11
194#include <stdlib.h>
195int main(int argc, char **argv)
196@{
197 ...
198@}
199@end example177@end example
200 178
179@item -v
180Display TCC version.
181
182@item -vv
183Show included files. As sole argument, print search dirs (as below).
184
185@item -bench
186Display compilation statistics.
187
188@item -print-search-dirs
189Print the configured installation directory and a list of library
190and include directories tcc will search.
191
201@end table192@end table
202 193
203Preprocessor options:194Preprocessor options:
@@ -284,6 +275,10 @@ Link your program with dynamic library libxxx.so or static library · 80 unmodified lines
284libxxx.a. The library is searched in the paths specified by the275libxxx.a. The library is searched in the paths specified by the
285@option{-L} option.276@option{-L} option.
286 277
278@item -Bdir
279Set the path where the tcc internal libraries (and include files) can be
280found (default is @file{PREFIX/lib/tcc}).
281
287@item -shared282@item -shared
288Generate a shared library instead of an executable.283Generate a shared library instead of an executable.
289 284
@@ -301,10 +296,10 @@ opened with @code{dlopen()} needs to access executable symbols. · 11 unmodified lines
301@item -r296@item -r
302Generate an object file combining all input files.297Generate an object file combining all input files.
303 298
304@item -Wl,-Ttext,address299@item -Wl,-rpath=path
305Set the start of the .text section to @var{address}.300Put custom seatch path for dynamic libraries into executable.
306 301
307@item -Wl,--oformat,fmt302@item -Wl,--oformat=fmt
308Use @var{fmt} as output format. The supported output formats are:303Use @var{fmt} as output format. The supported output formats are:
309@table @code304@table @code
310@item elf32-i386305@item elf32-i386
@@ -315,8 +310,14 @@ Binary image (only for executable output) · 4 unmodified lines
315COFF output format (only for executable output for TMS320C67xx target)310COFF output format (only for executable output for TMS320C67xx target)
316@end table311@end table
317 312
318@item -Wl,-rpath=path313@item -Wl,-subsystem=console/gui/wince/...
319Set custom library search path314Set type for PE (Windows) executables.
315
316@item -Wl,-[Ttext=# | section-alignment=# | file-alignment=# | image-base=# | stack=#]
317Modify executable layout.
318
319@item -Wl,-Bsymbolic
320Set DT_SYMBOLIC tag.
320 321
321@end table322@end table
322 323
@@ -342,6 +343,17 @@ Display N callers in stack traces. This is useful with @option{-g} or · 19 unmodified lines
342 343
343@end table344@end table
344 345
346Misc options:
347
348@table @option
349@item -MD
350Generate makefile fragment with dependencies.
351
352@item -MF depfile
353Use @file{depfile} as output for -MD.
354
355@end table
356
345Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are357Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are
346ignored.358ignored.
347@c man end359@c man end
tcc.c+15−6
@@ -46,29 +46,33 @@ static void help(void) · 45 unmodified lines
46 "Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n"46 "Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n"
47 " tcc [options...] -run infile [arguments...]\n"47 " tcc [options...] -run infile [arguments...]\n"
48 "General options:\n"48 "General options:\n"
49 " -v display current version, increase verbosity\n"
50 " -c compile only - generate an object file\n"49 " -c compile only - generate an object file\n"
51 " -o outfile set output filename\n"50 " -o outfile set output filename\n"
52 " -Bdir set tcc internal library and include path\n"
53 " -bench output compilation statistics\n"
54 " -run run compiled source\n"51 " -run run compiled source\n"
55 " -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n"52 " -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n"
56 " -Wwarning set or reset (with 'no-' prefix) 'warning' (see man page)\n"53 " -Wwarning set or reset (with 'no-' prefix) 'warning' (see man page)\n"
57 " -w disable all warnings\n"54 " -w disable all warnings\n"
55 " -v show version\n"
56 " -vv show included files (as sole argument: show search paths)\n"
57 " -bench show compilation statistics\n"
58 "Preprocessor options:\n"58 "Preprocessor options:\n"
59 " -E preprocess only\n"59 " -E preprocess only\n"
60 " -Idir add include path 'dir'\n"60 " -Idir add include path 'dir'\n"
61 " -Dsym[=val] define 'sym' with value 'val'\n"61 " -Dsym[=val] define 'sym' with value 'val'\n"
62 " -Usym undefine 'sym'\n"62 " -Usym undefine 'sym'\n"
63 " -nostdinc do not use standard system include paths\n"
63 "Linker options:\n"64 "Linker options:\n"
64 " -Ldir add library path 'dir'\n"65 " -Ldir add library path 'dir'\n"
65 " -llib link with dynamic or static library 'lib'\n"66 " -llib link with dynamic or static library 'lib'\n"
67 " -Bdir use 'dir' as tcc internal library and include path\n"
68 " -nostdlib do not link with standard crt and libraries\n"
66 " -pthread link with -lpthread and -D_REENTRANT (POSIX Linux)\n"69 " -pthread link with -lpthread and -D_REENTRANT (POSIX Linux)\n"
70 " -r generate (relocatable) object file\n"
71 " -rdynamic export all global symbols to dynamic linker\n"
67 " -shared generate a shared library\n"72 " -shared generate a shared library\n"
68 " -soname set name for shared library to be used at runtime\n"73 " -soname set name for shared library to be used at runtime\n"
69 " -static static linking\n"74 " -static static linking\n"
70 " -rdynamic export all global symbols to dynamic linker\n"75 " -Wl,opt[=val] set linker option 'opt' (see manual)\n"
71 " -r generate (relocatable) object file\n"
72 "Debugger options:\n"76 "Debugger options:\n"
73 " -g generate runtime debug info\n"77 " -g generate runtime debug info\n"
74#ifdef CONFIG_TCC_BCHECK78#ifdef CONFIG_TCC_BCHECK
@@ -175,7 +179,7 @@ static const TCCOption tcc_options[] = { · 100 unmodified lines
175 { "MD", TCC_OPTION_MD, 0},179 { "MD", TCC_OPTION_MD, 0},
176 { "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG },180 { "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG },
177 { "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG },181 { "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG },
178 { NULL },182 { NULL, 0, 0 },
179};183};
180 184
181static int64_t getclock_us(void)185static int64_t getclock_us(void)
@@ -458,7 +462,12 @@ static int parse_args(TCCState *s, int argc, char **argv) · 276 unmodified lines
458 case TCC_OPTION_MF:462 case TCC_OPTION_MF:
459 deps_outfile = optarg;463 deps_outfile = optarg;
460 break;464 break;
465 case TCC_OPTION_O:
466 case TCC_OPTION_pedantic:
467 case TCC_OPTION_pipe:
468 case TCC_OPTION_s:
461 case TCC_OPTION_x:469 case TCC_OPTION_x:
470 /* ignored */
462 break;471 break;
463 default:472 default:
464 if (s->warn_unsupported) {473 if (s->warn_unsupported) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t