Version 12 of tcc4tcl

Updated 2019-03-11 19:46:34 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

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.