tcc-0.9.24: Tiny C compiler

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

tcc-0.9.24: Tiny C compiler

#1 Post by muggins »

http://bellard.org/tcc/

This is the brilliant tiny c compiler. I've compiled it using p2.16, but have also tested it on p3 & p4.

Code: Select all

#include <stdio.h>

int main() 
{
    printf("Hello World\n");
    return 0;
}
Copy the above & save as hello.c

Then if you enter:

Code: Select all

tcc -run hello.c
tcc will run the code without compiling it. To compile, enter:

Code: Select all

tcc hello.c -o hello
Then enter:

Code: Select all

./hello

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

compiling

#2 Post by raffy »

Am sure you missed posting the compiled file because you're recompiling it using itself. :D

Exciting stuff, really. Thanks, Muggins.
Puppy user since Oct 2004. Want FreeOffice? [url=http://puppylinux.info/topic/freeoffice-2012-sfs]Get the sfs (English only)[/url].

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#3 Post by amigo »

The tccboot project is even more novel -it uses a grub-like bootloader with the tcc compiler integrated. When you boot the system it compiles its' own kernel from source(instead of loading a pre-compiled kernel). The kernel sources have extensive changes -I think it's a 2.4.26 or something that I got working.

Unfortunately my tcc-related stuff is not uploaded to my site at the moment or I'd point you to them.

On a practical level, tcc won't compile most of what you might like, unless you write or modify sources especially for the purpose. But it's very interesting anyway.

Post Reply