Hello,

Since
https://repo.or.cz/tinycc.git/commit/9f6b65230ac6b736698e740c4bc14c6c2f095f13
cross compiling doesn't work :

btc:~/vc/a/tinycc-035ae7d/a$ ../configure
--cross-prefix=arm-cortexa8-linux-gnueabihf- --cpu=armv7l

Binary directory    /usr/local/bin

TinyCC directory    /usr/local/lib/tcc

Library directory   /usr/local/lib

Include directory   /usr/local/include

Manual directory    /usr/local/share/man

Info directory      /usr/local/share/info

Doc directory       /usr/local/share/doc

Source path         ..

C compiler          arm-cortexa8-linux-gnueabihf-gcc (0.0)

Target OS           Linux

CPU                 arm

Creating config.mak and config.h

btc:~/vc/a/tinycc-035ae7d/a$ make

arm-cortexa8-linux-gnueabihf-gcc -o tcc.o -c ./../tcc.c
-DTCC_CPU_VERSION=7 -DTCC_TARGET_ARM        -DONE_SOURCE=0
-DTCC_GIT_HASH="\"modified 997fdc0\"" -Wall -O2
-Wdeclaration-after-statement -fno-strict-aliasing -Wno-pointer-sign
-Wno-sign-compare -Wno-unused-result -I.

arm-cortexa8-linux-gnueabihf-gcc -o libtcc.o -c ./../libtcc.c
-DTCC_CPU_VERSION=7 -DTCC_TARGET_ARM        -DONE_SOURCE=0
-Wall -O2 -Wdeclaration-after-statement -fno-strict-aliasing
-Wno-pointer-sign -Wno-sign-compare -Wno-unused-result -I.

arm-cortexa8-linux-gnueabihf-gcc -DC2STR ./../conftest.c -o c2str.exe
&& ./c2str.exe ./../include/tccdefs.h tccdefs_.h

/bin/sh: 1: ./c2str.exe: Exec format error

make: *** [Makefile:242: tccdefs_.h] Error 2

Because c2str is compiled with the target compiler and executed on the
host.

To fix this problem I propose the attached patch.

If it's ok for you, I can commit. Or what if you have another idea?

Thank you in advance for your return.

Thomas

Attachment: fixcross.patch
Description: Binary data

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to