make -C lib native
make[1]: Entering directory '/home/me/tcc-2015-04-28/lib'
mkdir -p arm
../tcc -B.. -c libtcc1.c -o arm/libtcc1.o -I.. -fPIC -DTCC_TARGET_ARM
../tcc: 1: ../tcc: Syntax error: word unexpected (expecting ")")
(I spare you tons of lines ; I'm integrating tcc as an openwrt package as I
don't want to build my own toolchain).
Now, the error is perfectly logical, as tcc is:
$ file tcc
tcc: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked,
interpreter /lib/ld-musl-arm.so.1, not stripped
it's not going to run.
I'm more or less stick here: either I create cross-compilers and the library is built using the cross compilers (but that don't help much, as the cross-compiler will not run on my target host) or I build a cross-compiled native tcc but then I cannot compile the library.
Unfortunately, I cannot build tcc for arm and rebuild it (with its native library) on the target host.
So, question: what would be a good way to remove that deadly lock ?
A) when cross-compiling, build the corresponding cross-compiler to build the library? That ould require to either have more configure switch or to detect the target arch from the cross-prefix (this is not always possible).
B) use the cross-compiler to built the target library? it should not be difficult but I'm not sure that a good thing.
C) something I haven't said yet?
Best regards,
-- Emmanuel Deloget