tcc-doc.texi: also
Unified · Split
| @@ -157,47 +157,38 @@ General Options: · 156 unmodified lines | ||
| 157 | 157 | |
| 158 | 158 | @c man begin OPTIONS |
| 159 | 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 | 160 | @item -c |
| 168 | 161 | Generate an object file. |
| 169 | 162 | |
| 170 | 163 | @item -o outfile |
| 171 | 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 | 166 | @item -run source [args...] |
| 181 | 167 | Compile file @var{source} and run it with the command line arguments |
| 182 | 168 | @var{args}. In order to be able to give more than one argument to a |
| 183 | 169 | script, several TCC options can be given @emph{after} the |
| 184 | −@option{-run} option, separated by spaces. Example: | |
| 185 | − | |
| 170 | +@option{-run} option, separated by spaces: | |
| 186 | 171 | @example |
| 187 | 172 | tcc "-run -L/usr/X11R6/lib -lX11" ex4.c |
| 188 | 173 | @end example |
| 189 | − | |
| 190 | 174 | In a script, it gives the following header: |
| 191 | − | |
| 192 | 175 | @example |
| 193 | 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 | 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 | 192 | @end table |
| 202 | 193 | |
| 203 | 194 | Preprocessor options: |
| @@ -284,6 +275,10 @@ Link your program with dynamic library libxxx.so or static library · 80 unmodified lines | ||
| 284 | 275 | libxxx.a. The library is searched in the paths specified by the |
| 285 | 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 | 282 | @item -shared |
| 288 | 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 | 296 | @item -r |
| 302 | 297 | Generate an object file combining all input files. |
| 303 | 298 | |
| 304 | −@item -Wl,-Ttext,address | |
| 305 | −Set the start of the .text section to @var{address}. | |
| 299 | +@item -Wl,-rpath=path | |
| 300 | +Put custom seatch path for dynamic libraries into executable. | |
| 306 | 301 | |
| 307 | −@item -Wl,--oformat,fmt | |
| 302 | +@item -Wl,--oformat=fmt | |
| 308 | 303 | Use @var{fmt} as output format. The supported output formats are: |
| 309 | 304 | @table @code |
| 310 | 305 | @item elf32-i386 |
| @@ -315,8 +310,14 @@ Binary image (only for executable output) · 4 unmodified lines | ||
| 315 | 310 | COFF output format (only for executable output for TMS320C67xx target) |
| 316 | 311 | @end table |
| 317 | 312 | |
| 318 | −@item -Wl,-rpath=path | |
| 319 | −Set custom library search path | |
| 313 | +@item -Wl,-subsystem=console/gui/wince/... | |
| 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 | 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 | 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 | 357 | Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are |
| 346 | 358 | ignored. |
| 347 | 359 | @c man end |
| @@ -46,29 +46,33 @@ static void help(void) · 45 unmodified lines | ||
| 46 | 46 | "Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n" |
| 47 | 47 | " tcc [options...] -run infile [arguments...]\n" |
| 48 | 48 | "General options:\n" |
| 49 | − " -v display current version, increase verbosity\n" | |
| 50 | 49 | " -c compile only - generate an object file\n" |
| 51 | 50 | " -o outfile set output filename\n" |
| 52 | − " -Bdir set tcc internal library and include path\n" | |
| 53 | − " -bench output compilation statistics\n" | |
| 54 | 51 | " -run run compiled source\n" |
| 55 | 52 | " -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n" |
| 56 | 53 | " -Wwarning set or reset (with 'no-' prefix) 'warning' (see man page)\n" |
| 57 | 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 | 58 | "Preprocessor options:\n" |
| 59 | 59 | " -E preprocess only\n" |
| 60 | 60 | " -Idir add include path 'dir'\n" |
| 61 | 61 | " -Dsym[=val] define 'sym' with value 'val'\n" |
| 62 | 62 | " -Usym undefine 'sym'\n" |
| 63 | + " -nostdinc do not use standard system include paths\n" | |
| 63 | 64 | "Linker options:\n" |
| 64 | 65 | " -Ldir add library path 'dir'\n" |
| 65 | 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 | 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 | 72 | " -shared generate a shared library\n" |
| 68 | 73 | " -soname set name for shared library to be used at runtime\n" |
| 69 | 74 | " -static static linking\n" |
| 70 | − " -rdynamic export all global symbols to dynamic linker\n" | |
| 71 | − " -r generate (relocatable) object file\n" | |
| 75 | + " -Wl,opt[=val] set linker option 'opt' (see manual)\n" | |
| 72 | 76 | "Debugger options:\n" |
| 73 | 77 | " -g generate runtime debug info\n" |
| 74 | 78 | #ifdef CONFIG_TCC_BCHECK |
| @@ -175,7 +179,7 @@ static const TCCOption tcc_options[] = { · 100 unmodified lines | ||
| 175 | 179 | { "MD", TCC_OPTION_MD, 0}, |
| 176 | 180 | { "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG }, |
| 177 | 181 | { "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG }, |
| 178 | − { NULL }, | |
| 182 | + { NULL, 0, 0 }, | |
| 179 | 183 | }; |
| 180 | 184 | |
| 181 | 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 | 462 | case TCC_OPTION_MF: |
| 459 | 463 | deps_outfile = optarg; |
| 460 | 464 | break; |
| 465 | + case TCC_OPTION_O: | |
| 466 | + case TCC_OPTION_pedantic: | |
| 467 | + case TCC_OPTION_pipe: | |
| 468 | + case TCC_OPTION_s: | |
| 461 | 469 | case TCC_OPTION_x: |
| 470 | + /* ignored */ | |
| 462 | 471 | break; |
| 463 | 472 | default: |
| 464 | 473 | if (s->warn_unsupported) { |