Skip to content

Commit dd9a9c7

Browse files
committed
Merge branch 'mob'
2 parents 30a3873 + f8bd136 commit dd9a9c7

File tree

2 files changed

+62
-8
lines changed

2 files changed

+62
-8
lines changed

tcc-doc.texi

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ usage: tcc [options] [@var{infile1} @var{infile2}@dots{}] [@option{-run} @var{in
8383

8484
@noindent
8585
@c man begin DESCRIPTION
86-
TCC options are a very much like gcc options. The main difference is that TCC
86+
TCC options are very much like gcc options. The main difference is that TCC
8787
can also execute directly the resulting program and give it runtime
8888
arguments.
8989

@@ -185,6 +185,16 @@ Show included files. As sole argument, print search dirs. -vvv shows tries too
185185
@item -bench
186186
Display compilation statistics.
187187

188+
@item -pthread
189+
Preprocess with @option{-D_REENTRANT}, link with @option{-lpthread}.
190+
191+
@item -On
192+
Pretend to optimise: set @option{-D__OPTIMIZE__} to the numeric value of n.
193+
Note that TCC performs no additional optimisation.
194+
195+
@item -dt
196+
With @option{-run}/@option{-E}: auto-define 'test_...' macros
197+
188198
@end table
189199

190200
Preprocessor options:
@@ -199,6 +209,16 @@ include paths are: @file{/usr/local/include}, @file{/usr/include}
199209
and @file{PREFIX/lib/tcc/include}. (@file{PREFIX} is usually
200210
@file{/usr} or @file{/usr/local}).
201211

212+
@item -isystem dir
213+
Specify a system include path to be added to the defaults.
214+
215+
@item -nostdinc
216+
Do not search the default system include paths; only search include paths
217+
provided on the command line.
218+
219+
@item -include file
220+
Include @option{file} above each input file.
221+
202222
@item -Dsym[=val]
203223
Define preprocessor symbol @samp{sym} to
204224
val. If val is not present, its value is @samp{1}. Function-like macros can
@@ -210,6 +230,18 @@ Undefine preprocessor symbol @samp{sym}.
210230
@item -E
211231
Preprocess only, to stdout or file (with -o).
212232

233+
@item -P
234+
Do not output @code{#line} directives.
235+
236+
@item -P1
237+
Output alternative @code{#line} directives.
238+
239+
@item -dD, -dM
240+
Output @code{#define} directives.
241+
242+
@item -Wp,-opt
243+
Same as @option{-opt}.
244+
213245
@end table
214246

215247
Compilation flags:
@@ -238,6 +270,15 @@ behaves like an unnamed one.
238270
@item -fdollars-in-identifiers
239271
Allow dollar signs in identifiers
240272

273+
@item -freverse-funcargs
274+
Evaluate function arguments right to left.
275+
276+
@item -fgnu89-inline
277+
@code{extern inline} is like @code{static inline}.
278+
279+
@item -fasynchronous-unwind-tables
280+
Create eh_frame section [on]
281+
241282
@item -ftest-coverage
242283
Create code coverage code. After running the resulting code an executable.tcov
243284
or sofile.tcov file is generated with code coverage.
@@ -257,7 +298,10 @@ Note: each of the following warning options has a negative form beginning with
257298

258299
@table @option
259300
@item -Wimplicit-function-declaration
260-
Warn about implicit function declaration.
301+
Warn about implicit function declaration (missing prototype).
302+
303+
@item -Wdiscarded-qualifiers
304+
Warn when const is dropped.
261305

262306
@item -Wunsupported
263307
Warn about unsupported GCC features that are ignored by TCC.
@@ -272,7 +316,8 @@ the specified warning and turn it into an error, for example
272316
@option{-Werror=unsupported}.
273317

274318
@item -Wall
275-
Activate some useful warnings.
319+
Activate some useful warnings (@option{-Wimplicit-function-declaration},
320+
@option{-Wdiscard-qualifiers}).
276321

277322
@end table
278323

@@ -288,6 +333,9 @@ Link your program with dynamic library libxxx.so or static library
288333
libxxx.a. The library is searched in the paths specified by the
289334
@option{-L} option and @env{LIBRARY_PATH} variable.
290335

336+
@item -nostdlib
337+
Don't implicitly link with libc, the C runtime files, and libtcc1.
338+
291339
@item -Bdir
292340
Set the path where the tcc internal libraries (and include files) can be
293341
found (default is @file{PREFIX/lib/tcc}).
@@ -376,6 +424,13 @@ Misc options:
376424

377425
@table @option
378426

427+
@item -std=version
428+
Define @code{__STDC_VERSION__}: @code{201112} if @option{version} is c11 or
429+
gnu11; @code{199901} otherwise.
430+
431+
@item -x[c|a|b|n]
432+
Specify content of next input file: respectively C, assembly, binary, or none.
433+
379434
@item -M
380435
Just output makefile fragment with dependencies
381436

@@ -418,8 +473,7 @@ Pass command line to the i386/x86_64 cross compiler.
418473

419474
@end table
420475

421-
Note: GCC options @option{-Ox}, @option{-fx} and @option{-mx} are
422-
ignored.
476+
Note: GCC options @option{-fx} and @option{-mx} are ignored.
423477
@c man end
424478

425479
@c man begin ENVIRONMENT

tcc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ static const char help[] =
5050
" -Dsym[=val] define 'sym' with value 'val'\n"
5151
" -Usym undefine 'sym'\n"
5252
" -E preprocess only\n"
53+
" -nostdinc do not use standard system include paths\n"
5354
"Linker options:\n"
5455
" -Ldir add library path 'dir'\n"
5556
" -llib link with dynamic or static library 'lib'\n"
57+
" -nostdlib do not link with standard crt and libraries\n"
5658
" -r generate (relocatable) object file\n"
57-
" -shared generate a shared library/dll\n"
5859
" -rdynamic export all global symbols to dynamic linker\n"
60+
" -shared generate a shared library/dll\n"
5961
" -soname set name for shared library to be used at runtime\n"
6062
" -Wl,-opt[=val] set linker option (see tcc -hh)\n"
6163
"Debugger options:\n"
@@ -73,8 +75,6 @@ static const char help[] =
7375
"Misc. options:\n"
7476
" -std=version define __STDC_VERSION__ according to version (c11/gnu11)\n"
7577
" -x[c|a|b|n] specify type of the next infile (C,ASM,BIN,NONE)\n"
76-
" -nostdinc do not use standard system include paths\n"
77-
" -nostdlib do not link with standard crt and libraries\n"
7878
" -Bdir set tcc's private include/library dir\n"
7979
" -M[M]D generate make dependency file [ignore system files]\n"
8080
" -M[M] as above but no other output\n"

0 commit comments

Comments
 (0)