0

I tried to compile tcc for ARM using gcc 4.6.3 . but I got following error while compiling in both shared/static lib mod :

root@localhost:/p/tcc/tcc# make
gcc -o tcc tcc.o libtcc.so.1.0 -lm -ldl -Wall -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -D_FORTIFY_SOURCE=0  -Wl,-rpath,"/usr/local/lib" libtcc.so.1.0: undefined reference to `vrotb'
collect2: ld returned 1 exit status
make: *** [tcc] Error 1

I am using lastest branch from tcc github

alireza_fn
  • 884
  • 1
  • 8
  • 21
  • which repository? There are so many forks... Also, what is `uname -a`? – keltar Oct 11 '13 at 09:36
  • repo : https://github.com/TinyCC/TinyCC and uname -a : Linux localhost 3.0.89-K^Kernel_JB-4.1.2_OC_UV_370MB+ #2 PREEMPT Mon Aug 5 00:42:04 CEST 2013 armv7l armv7l armv7l GNU/Linux – alireza_fn Oct 11 '13 at 09:58
  • It seems ok. Could you run `make clean`, `./configure` then `make` and provide it's full output? – keltar Oct 11 '13 at 10:11
  • here you are : http://paste.lisp.org/+2ZJW – alireza_fn Oct 11 '13 at 10:38
  • It appears some change in this branch have broken compatibility with arm. In tccgen.c:945 remove 'static' qualifier, this should help you. Or try this repo https://github.com/LuaDist/tcc not sure which one is newer, but they surely different. – keltar Oct 11 '13 at 10:46
  • I could compile from LuaDist githuh sucessfully but the output tcc can not compile a helloworld program . also 'make test' fails – alireza_fn Oct 11 '13 at 11:34
  • Finally managed to test it in real environment, so added answer. – keltar Oct 11 '13 at 13:48

2 Answers2

2

Just checked it on raspberry pi (ARMv6 CPU). https://github.com/TinyCC/TinyCC repository, removed static qualifier from vrotb function in tccgen.c (line 945). It builds and passes 'hello world'.

Since that's obvious mistake likely to be introduced by some change that they forgot to adapt for ARM - i suggest performing further tests to ensure it works as intended. Bug report should be filed - probably on github.

keltar
  • 17,711
  • 2
  • 37
  • 42
0

I know it is little confusing, but your problem is that you are using wrong repository. Fabrice Bellard does not work any more on TinyCC (see http://bellard.org/tcc/). He keeps his repositories for personal/historical reasons. However all development has moved to http://repo.or.cz/w/tinycc.git. To confuse things even more the 0.9.26 release from Fabrice's web site is actually from the http://repo.or.cz/w/tinycc.git repository, and not Fabrice's own. But this is all just communication issue. In short you should use new repository. On the repository web site is a link to a mailing list where you should report any problems in case the new repo code does not compile.

mikijov
  • 1,552
  • 24
  • 37