[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.

From: Domingo Alvarez Duarte
Subject: Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.
Date: Sun, 30 Mar 2014 10:35:09 +0100

For the people that checked out my repository at https://github.com/mingodad/tinycc.git I'll try explain what my "virtual io" is for.

I've tried on the past achieve something like etcl did, I mean a self contained interpreter with the ability to mix c code.

I've tried to use libtcc but it depends on auxiliary files been installed on a specific folder and nee be distributed along side the interpreter/embedded application.

Then I started this "virtual io" and with a bin2c program that allow incorporate the auxiliary files directly inside the library/interpreter.

To test the idea and achieve a self contained tcc that doesn't depend on auxiliary files installed elsewhere I've created a small script that does that "mk-it" on my distribution, to achieve a small self contained tcc it's best to edit config.mak and change "CFLAGS=-Os" and run "./mk-it" the result tcc is self contained and can be used from anywhere without any auxiliary files/folder.

Cheers !

On Sat, Mar 29, 2014 at 7:13 PM, grischka <address@hidden> wrote:
Domingo Alvarez Duarte wrote:
Hello all !

I finished phase1 of code refactoring of tinycc to remove global variables, not all global variables are removed yet but most of then are, with that it can cross compile all platforms on my linux X86_64 and till only on real test was done on linux.

Here you can find the repository to test yourselves https://github.com/mingodad/tinycc any comment/suggestion/patch are welcome.

For the lazy typers and in order not to go to far past 80 cpl
I'd suggest 's1' instead of 'tcc_state' all over the place.

Not sure whether vtop (and all that) needs to become tccgen_vtop

Section stuff (text_section etc.) would more logically belong
to tccelf rather than tccgen.  (I once wanted to move those,
and add some interfaces such as elf_new()/elf_delete(), but ...)

C99 declarations past statement or declaration of size_t in
user code hurts other compilers.

Your 'virtual io' should maybe go in a 'contrib' directory, and
have some readme explanation. (otherwise it is useless for
other people).  Though, struct fd is NOT nice.  There are
probably much less intrusive ways, say with 3 simple #defines
on top and instead slightly more intelligent custom functions
that supports int fd's).

If any possible avoid mixing the refactoring with other fixes
or improvements, whatever those are.

Btw. did you use some special tools (and if yes, which) or
just find&replace?

--- grischka

Thanks for your time, attention and great work !

Tinycc-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]