Obfuscated Tiny C Compiler

Software Screenshot:
Obfuscated Tiny C Compiler
Software Details:
Version: 1.0
Upload Date: 3 Jun 15
Developer: Fabrice Bellard
Distribution Type: Freeware
Downloads: 33

Rating: 3.5/5 (Total Votes: 2)

Obfuscated Tiny C Compiler (OTCC) is a very small C compiler I wrote in order to win the International Obfuscated C Code Contest (IOCCC) in 2002.

My goal was to write the smallest C compiler which is able to compile itself. I choose a subset of C which was general enough to write a small C compiler. Then I extended the C subset until I reached the maximum size authorized by the contest: 2048 bytes of C source excluding the ';', '{', '}' and space characters.

I choose to generate i386 code. The original OTCC code could only run on i386 Linux because it relied on endianness and unaligned access. It generated the program in memory and launched it directly. External symbols were resolved with dlsym().

In order to have a portable version of OTCC, I made a variant called OTCCELF. It is only a little larger than OTCC, but it generates directly a dynamically linked i386 ELF executable from a C source without relying on any binutils tools! OTCCELF was tested succesfully on i386 Linux and on Sparc Solaris.

NOTE: My other project TinyCC which is a fully featured ISOC99 C compiler was written by starting from the source code of OTCC !

Compilation:

gcc -O2 otcc.c -o otcc -ldl
gcc -O2 otccelf.c -o otccelf

Self-compilation:

./otccelf otccelf.c otccelf1

Similar Software

Scheme2Js
Scheme2Js

11 May 15

R
R

17 Feb 15

tkscript
tkscript

3 Jun 15

Gauche
Gauche

14 Apr 15

Other Software of Developer Fabrice Bellard

FFmpeg
FFmpeg

17 Aug 18

TCCBOOT
TCCBOOT

3 Jun 15

QEMU
QEMU

22 Jun 18

Comments to Obfuscated Tiny C Compiler

Comments not found
Add Comment
Turn on images!