TCC: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
No edit summary
m (Categorized.)
Line 28: Line 28:


* [http://tinycc.org Tiny C Compiler project page]
* [http://tinycc.org Tiny C Compiler project page]

[[Category:Compilers]]

Revision as of 06:19, 13 December 2011

TCC (Tiny C Compiler) is a small and fast C compiler, which produces x86, x86_64 or ARM code, and generates PE or ELF executables. TCC is heading toward full ISOC99 compliance, and can compile itself.

Version 0.9.25 (released May 2009) added support for x86_64. Work is being done towards a 0.9.26 release, but progress is comparatively slow. However, TinyCC has a couple of advantages:

  • TCC compiles C code about 9 times faster than GCC.
  • Under Linux, TCC can be used as a C interpreter (just add '#!/usr/local/bin/tcc -run' at the first line of your C source, and execute it directly from the command line). (This currently works only for 32bit.)
  • TCC has few dependencies. Only libc is required for its compilation.
  • TCC includes a linker and an assembler (for x86 only).

Disadvantages are:

  • only averagely optimized x86 code.
  • ISO C99 support is not complete.

The Windows version of TCC doesn't produces ELF executables. If you want those, you have to recompile TCC as a cross-compiler.

TCC takes similar options as GCC:

tcc -c kernel.c
tcc -nostdlib -Wl,-Ttext,0x100000 loader.o kernel.o -o kernel.bin

See Also