tcc-doc.texi: also
Unified · Split
| @@ -157,47 +157,38 @@ General Options: · 156 unmodified lines | |||
| 157 | 157 | ||
| 158 | @c man begin OPTIONS | 158 | @c man begin OPTIONS |
| 159 | @table @option | 159 | @table @option |
| 160 | @item -v | ||
| 161 | Display current TCC version, increase verbosity. | ||
| 162 | |||
| 163 | @item -print-search-dirs | ||
| 164 | Print the name of the configured installation directory and a list | ||
| 165 | of program and library directories tcc will search. | ||
| 166 | |||
| 167 | @item -c | 160 | @item -c |
| 168 | Generate an object file. | 161 | Generate an object file. |
| 169 | 162 | ||
| 170 | @item -o outfile | 163 | @item -o outfile |
| 171 | Put object file, executable, or dll into output file @file{outfile}. | 164 | Put object file, executable, or dll into output file @file{outfile}. |
| 172 | 165 | ||
| 173 | @item -Bdir | ||
| 174 | Set the path where the tcc internal libraries can be found (default is | ||
| 175 | @file{PREFIX/lib/tcc}). | ||
| 176 | |||
| 177 | @item -bench | ||
| 178 | Output compilation statistics. | ||
| 179 | |||
| 180 | @item -run source [args...] | 166 | @item -run source [args...] |
| 181 | Compile file @var{source} and run it with the command line arguments | 167 | Compile 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 a | 168 | @var{args}. In order to be able to give more than one argument to a |
| 183 | script, several TCC options can be given @emph{after} the | 169 | script, 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 | @example | 171 | @example |
| 187 | tcc "-run -L/usr/X11R6/lib -lX11" ex4.c | 172 | tcc "-run -L/usr/X11R6/lib -lX11" ex4.c |
| 188 | @end example | 173 | @end example |
| 189 | |||
| 190 | In a script, it gives the following header: | 174 | In a script, it gives the following header: |
| 191 | |||
| 192 | @example | 175 | @example |
| 193 | #!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11 | 176 | #!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11 |
| 194 | #include <stdlib.h> | ||
| 195 | int main(int argc, char **argv) | ||
| 196 | @{ | ||
| 197 | ... | ||
| 198 | @} | ||
| 199 | @end example | 177 | @end example |
| 200 | 178 | ||
| 179 | @item -v | ||
| 180 | Display TCC version. | ||
| 181 | |||
| 182 | @item -vv | ||
| 183 | Show included files. As sole argument, print search dirs (as below). | ||
| 184 | |||
| 185 | @item -bench | ||
| 186 | Display compilation statistics. | ||
| 187 | |||
| 188 | @item -print-search-dirs | ||
| 189 | Print the configured installation directory and a list of library | ||
| 190 | and include directories tcc will search. | ||
| 191 | |||
| 201 | @end table | 192 | @end table |
| 202 | 193 | ||
| 203 | Preprocessor options: | 194 | Preprocessor options: |
| @@ -284,6 +275,10 @@ Link your program with dynamic library libxxx.so or static library · 80 unmodified lines | |||
| 284 | libxxx.a. The library is searched in the paths specified by the | 275 | libxxx.a. The library is searched in the paths specified by the |
| 285 | @option{-L} option. | 276 | @option{-L} option. |
| 286 | 277 | ||
| 278 | @item -Bdir | ||
| 279 | Set the path where the tcc internal libraries (and include files) can be | ||
| 280 | found (default is @file{PREFIX/lib/tcc}). | ||
| 281 | |||
| 287 | @item -shared | 282 | @item -shared |
| 288 | Generate a shared library instead of an executable. | 283 | Generate 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 -r | 296 | @item -r |
| 302 | Generate an object file combining all input files. | 297 | Generate an object file combining all input files. |
| 303 | 298 | ||
| 304 | @item -Wl,-Ttext,address | 299 | @item -Wl,-rpath=path |
| 305 | Set the start of the .text section to @var{address}. | 300 | Put custom seatch path for dynamic libraries into executable. |
| 306 | 301 | ||
| 307 | @item -Wl,--oformat,fmt | 302 | @item -Wl,--oformat=fmt |
| 308 | Use @var{fmt} as output format. The supported output formats are: | 303 | Use @var{fmt} as output format. The supported output formats are: |
| 309 | @table @code | 304 | @table @code |
| 310 | @item elf32-i386 | 305 | @item elf32-i386 |
| @@ -315,8 +310,14 @@ Binary image (only for executable output) · 4 unmodified lines | |||
| 315 | COFF output format (only for executable output for TMS320C67xx target) | 310 | COFF output format (only for executable output for TMS320C67xx target) |
| 316 | @end table | 311 | @end table |
| 317 | 312 | ||
| 318 | @item -Wl,-rpath=path | 313 | @item -Wl,-subsystem=console/gui/wince/... |
| 319 | Set custom library search path | 314 | Set type for PE (Windows) executables. |
| 315 | |||
| 316 | @item -Wl,-[Ttext=# | section-alignment=# | file-alignment=# | image-base=# | stack=#] | ||
| 317 | Modify executable layout. | ||
| 318 | |||
| 319 | @item -Wl,-Bsymbolic | ||
| 320 | Set DT_SYMBOLIC tag. | ||
| 320 | 321 | ||
| 321 | @end table | 322 | @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 table | 344 | @end table |
| 344 | 345 | ||
| 346 | Misc options: | ||
| 347 | |||
| 348 | @table @option | ||
| 349 | @item -MD | ||
| 350 | Generate makefile fragment with dependencies. | ||
| 351 | |||
| 352 | @item -MF depfile | ||
| 353 | Use @file{depfile} as output for -MD. | ||
| 354 | |||
| 355 | @end table | ||
| 356 | |||
| 345 | Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are | 357 | Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are |
| 346 | ignored. | 358 | ignored. |
| 347 | @c man end | 359 | @c man end |
| @@ -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_BCHECK | 78 | #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 | ||
| 181 | static int64_t getclock_us(void) | 185 | static 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) { |