After unzipping tcc-0.9.26
, I edit configure to point at emcc
instead of gcc
and at emar
instead of ar
. Next, I uncomment the include of ucontext
in tcc.h
since it seems to be needed only for tccrun
. Now I disable all the builtins (sub_ddmmss and so on) in lib/libtcc1.c
, but I get an error because Emscripten tries to compile an assembly source file (an implementation of alloca), and I don't know how to get around that.
Asked
Active
Viewed 504 times
3

Thomas Dickey
- 51,086
- 7
- 70
- 105

Janus Troelsen
- 20,267
- 14
- 135
- 196
1 Answers
2
The functions implemented in assembly are much more fundamental, and are required by tcc. They are not optional in the sense you can remove them with a define or a comment. You can of course modify tcc itself not to use them, but you will have to provide your implementation of the functions you removed. So the only way to compile tcc with a non gcc/clang compiler is to significantly modify it or reimplement assembly functions.

mikijov
- 1,552
- 24
- 37
-
Hmmm. I can't even get [CC500](http://homepage.ntlworld.com/edmund.grimley-evans/cc500/) or Bellard's otcc to work in Emscripten. I guess the best option would be to use jslinux/jsmodem and just pull out the binary after running tcc in the emulator. – Janus Troelsen May 07 '13 at 13:05