[gambit-list] Using the tcc compiler

Christian Jaeger christian at pflanze.mine.nu
Fri Jul 27 17:28:09 EDT 2007


Hello

I've just discovered that tcc¹ is able to compile the C code generated
by Gambit. In simple cases the compiled object files work just
flawlessly (albeit ~3 times slower than when compiled with gcc in a
fixnum-loop microbenchmark, but that's ok). When I compile one of my
bigger modules (which takes 3 seconds for compilation from Scheme to C
and 17 seconds to compile from C to binary with gcc 4.1.2, and only 1
second to compile from C to binary with tcc 0.9.23), it's doing wrong
calculations (I'm doing signal processing, with tcc it just outputs
zeroes all the time).

The way I've used tcc in the above tests was by just linking tcc into
the PATH as gcc (mkdir ~/bin; ln -s /usr/bin/tcc ~/bin/gcc;
PATH="~/bin:$PATH"; start gsc interactively and use compile-file
(through chjmodule) as usual). Should I take a different approach? Or
should I start debugging problems / send bug reports with code when
compiled with tcc?

Having 5 times faster compile times would help development in those
cases where using the interpreter isn't possible (because it is too slow
or because the modules are including FFI code), albeit it's not a high
priority. (Alternatively I might possibly speed up gcc by not using
single-host and no -O flag. How can I achieve those settings from inside
gsc (when using |compile-file|), btw?)

Christian.

¹http://fabrice.bellard.free.fr/tcc/



More information about the Gambit-list mailing list