<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Re: [gambit-list] Using TCC</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Marc<BR>
<BR>
I brought down gambc-v4_6_6-devel<BR>
<BR>
./configure CC=tcc --enable-single-host<BR>
<BR>
I then did<BR>
<BR>
time make<BR>
<BR>
make[1]: Leaving directory<BR>
`/export/home/fred/Downloads/gambc-v4_6_6-devel/prebuilt'<BR>
<BR>
real 0m31.620s<BR>
user 0m28.775s<BR>
sys 0m2.241s<BR>
<BR>
(On my 1.66 GHz Atom, single core, with 1 GB RAM). Build seems<BR>
successful, running through testing. I did upgrade tcc to the git "mob"<BR>
head, because I found an issue with the older tcc (64 bit structure<BR>
copies were sometimes, um.., mis-sized, seems ok with the most recent<BR>
version).<BR>
<BR>
Fred Weigel<BR>
<BR>
On Tue, 2013-02-12 at 13:09 -0500, Marc Feeley wrote:<BR>
> Very cool!  I have been a fan of TCC for a long time and have been interested in combining TCC and Gambit to make a standalone distribution of Gambit.  I'm glad to see that TCC can compile Gambit generated code.  Could you try building Gambit using TCC?  I wonder how fast TCC generated code is.<BR>
><BR>
> Marc<BR>
><BR>
><BR>
> On 2013-02-08, at 3:50 PM, Fred Weigel <fred.weigel@zylog.ca> wrote:<BR>
><BR>
> > All:<BR>
> ><BR>
> > I generally hack on a netbook, which has a very slow hard drive (but is<BR>
> > 1.66 GHz, 1 GB memory). So, gsc using gcc is a bit slow sometimes. I<BR>
> > decided to try tcc (Gambit-C 4.6.6 - 64 bit - Fedora 17, tcc 0.9.25 -<BR>
> > built from current web distribution).<BR>
> ><BR>
> > <A HREF="http://bellard.org/tcc/">http://bellard.org/tcc/</A><BR>
> ><BR>
> > <A HREF="http://download.savannah.nongnu.org/releases/tinycc/tcc-0.9.25.tar.bz2">http://download.savannah.nongnu.org/releases/tinycc/tcc-0.9.25.tar.bz2</A><BR>
> ><BR>
> > 0.9.25 supports 64 bit x86 code.<BR>
> ><BR>
> ><BR>
> > I did not rebuild gsi or gsc with tcc, but simply incorporated tcc into<BR>
> > the gambc-cc script.<BR>
> ><BR>
> ><BR>
> > Results:<BR>
> ><BR>
> > With 13,156 lines of Scheme (my "standard library")<BR>
> ><BR>
> > Building with tcc:<BR>
> ><BR>
> > real 0m25.577s<BR>
> > user 0m18.633s<BR>
> > sys 0m3.290s<BR>
> ><BR>
> > 4,465,784 bytes of object code.<BR>
> ><BR>
> > Building with gcc (4.7.2):<BR>
> ><BR>
> > real 3m47.997s<BR>
> > user 3m8.047s<BR>
> > sys 0m11.283s<BR>
> ><BR>
> > With 4,004,348 bytes of object obtained.<BR>
> ><BR>
> > Now, I haven't tested the results extensively at all, but I am very<BR>
> > happy so far (no obvious problems).<BR>
> ><BR>
> > The change made to gambc-cc is an insertion at line 13 (just above<BR>
> > DEFS_OBJ=...). I added the following hack:<BR>
> ><BR>
> > ==> Cut <==<BR>
> > # If CC is tcc, use that instead. We use tcc 0.9.25<BR>
> > # Most of the options are meaningless with this compiler, but we grab<BR>
> > # the ones that do make sense. Gambit-C itself has not been built with<BR>
> > # tcc (I use the Fedora repo version of 4.6.6), but code that is<BR>
> > # generated by gsc is compiled with tcc. So far, no problems! (larger<BR>
> > # code size by up to 40% for "Hello world", but MUCH faster compilation<BR>
> > # of C files).<BR>
> > if [ "$CC" == "tcc" ]; then<BR>
> >  C_COMPILER="tcc"<BR>
> >  FLAGS_OBJ="-g -Wall"<BR>
> >  FLAGS_DYN="-g -Wall -rdynamic -shared"<BR>
> >  FLAGS_LIB="-g -Wall -rdynamic -shared"<BR>
> >  FLAGS_EXE="-g -Wall -rdynamic"<BR>
> > fi<BR>
> > ==> Cut <==<BR>
> ><BR>
> > To use, simply define CC=tcc in your enviroment (export CC=tcc), or put<BR>
> > a similar statement into the Makefile (presuming that is used).<BR>
> ><BR>
> > I have not measured execution speed of Scheme code at all, but a 6x<BR>
> > improvement in compilation speed is worth continuing along this path<BR>
> > (for me, anyway). Typically, object size increases by 10% (for my<BR>
> > standard library) to 40% (for a simple "hello world" example).<BR>
> ><BR>
> > I won't be able to expend cycles benchmarking code with tcc -- I am<BR>
> > more interested in any failure cases from this compiler. Maybe<BR>
> > someone can do a benchmark run?<BR>
> ><BR>
> > Fred Weigel<BR>
><BR>
> _______________________________________________<BR>
> Gambit-list mailing list<BR>
> Gambit-list@iro.umontreal.ca<BR>
> <A HREF="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</A><BR>
><BR>
</FONT>
</P>

</BODY>
</HTML>