Version 13 of tcc4tcl

Updated 2019-03-11 20:25:59 by AMG

tcc4tcl (Tiny C Compiler for Tcl) is a Tcl extension that provides an interface to TCC.

It is a fork of tcltcc by Mark Janssen.

It is licensed under the terms of the LGPL v2.1 (or later).

Homepage: http://chiselapp.com/user/rkeene/repository/tcc4tcl/index


AMG: The current version of tcc4tcl (0.30) directly includes a patched copy of tcc 0.9.26 from early 2013. The latest version of tcc is 0.9.27 from late 2017. I would very much like to upgrade to 0.9.27 because of the many improvements, but doing so breaks virtually all the tcc patches found in [L1 ].


AMG: With tcc4tcl 0.30 (tcc 0.9.26) compiled with 32-bit MXE GCC 5.4.0, I get the following error:

% tcc4tcl::cproc test {Tcl_WideInt a int b} Tcl_WideInt {return a << b;}
tcc: error: undefined symbol '__ashldi3'
relocating failed

This is only a problem in Windows, not Linux.

It looks like the more general problem is for Windows, none of the code from libtcc1.a is being linked in. This includes things as simple as casting from a float or double to an int.

% tcc4tcl::cproc test {float x} int {return x;}
tcc: error: undefined symbol '__tcc_int_fpu_control'
tcc: error: undefined symbol '__tcc_fpu_control'
relocating failed

I tried again using [L2 ] and [L3 ] so that none of the code is compiled by me, but I get the same failure. The problem is with tcc4tcl rather than the way I'm using it, and it should be easy for others to reproduce. However, this makes me curious why no one has noticed this problem before. Is tcc4tcl not being widely used on 32-bit Windows?


dbohdan 2015-03-16: As of version 0.23 you can compile tcc4tcl on Linux thus:

#!/bin/sh
set -e
version=0.23
release="tcc4tcl-$version"
url="http://rkeene.org/devel/tcc4tcl/${release}.tar.gz"
curl "$url" -o "${release}.tar.gz" # -O may not be unavailable.
tar zxvf "$release.tar.gz"
cd $release
./configure
make

dbohdan: Updated the script once more to hammer Roy Keene's server less.