2

I am trying to cross compiling homas Preud'homme's version of TinyCC by using following command

./configure --cc=arm-none-linux-gnueabi-gcc --prefix=/home/shushant/tinycc/tc

and it shows following error message after running make install

make: Circular Makefile <- Makefile dependency dropped.
make -C lib native
make[1]: Entering directory `/home/shushant/tinycc/lib' arm-none-linux-gnueabi-gcc -c alloca86_64.S -o x86_64/alloca86_64.o -I..  -Wall -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -DTCC_TARGET_X86_64
alloca86_64.S: Assembler messages:
alloca86_64.S:7: Error: expression too complex -- `pop %rdx'
alloca86_64.S:11: Error: ARM register expected -- `mov %rdi,%rax'
alloca86_64.S:13: Error: ARM register expected -- `add $15,%rax'
alloca86_64.S:14: Error: ARM register expected -- `and $-16,%rax'
alloca86_64.S:15: Error: bad instruction `jz p3'
alloca86_64.S:28: Error: ARM register expected -- `sub %rax,%rsp'
alloca86_64.S:29: Error: ARM register expected -- `mov %rsp,%rax'
alloca86_64.S:35: Error: expression too complex -- `push %rdx'
alloca86_64.S:36: Error: bad instruction `ret'
alloca86_64.S:40: Error: junk at end of line, first unrecognized character is `,'
make[1]: *** [x86_64/alloca86_64.o] Error 1
make[1]: Leaving directory `/home/shushant/tinycc/lib'
make: *** [libtcc1.a] Error 2

some how binaries is successfully generated but in wrong directory (at the root of /home/shushant/tinycc) instead of /home/shushant/tinycc/tc and when I am trying to run on android emulator its showfile not found of course generated binaries is not supported by device. How can I fix it?

3

The error message shows that you want to compile code for your platform (x86/64) with the ARM compiler which does not work. The configure script has not guessed the correct target ("TCC_TARGET_X86_64" instead of the ARM target).

Probably, you need the --cpu=armv7a (or what you exactly have) option and/or the --cross-prefix=arm-none-linux-gnueabi- option. Before, run make clean.

  • thanks, jofel but now i am getting cat: /VERSION: No such file or directory make: *** No rule to make target /Makefile, needed by Makefile. Stop. – Shushant Nov 19 '13 at 10:03
  • The configure script seems to be broken a bit. I need to use armv4l otherwise I get a "Unsupported CPU warning". Additionally, I need to set TCC_ARM_VERSION in config.h manually (e.g. #define TCC_ARM_VERSION 4) – jofel Nov 19 '13 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.