Hi,
On Fri, 11 Apr 2014, Austin English wrote:
it builds fine, but make test fails:
Yep, make test with (only) cross compilers doesn't work (in a way that
makes sense because for a real cross compiler you wouldn't be able to run
the generated code natively anyway, so only compilation tests could be
done, the x86-64/i386 pair is special as that's merely biarch).
austin@aw25 ~ $ cat foo.c
#include <stdio.h>
int main(void)
{
return 0;
}
austin@aw25 ~ $ gcc -o a foo.c ; ./a ; echo $?
0
To do a check that's semi equivalent to using the cross i386-tcc you'd
have to add -m32 here.
austin@aw25 ~ $ ~/src/tinycc/i386-tcc -o a foo.c ; ./a ; echo $?
/usr/lib/crt1.o: error: invalid object file
tcc: error: file 'crt1.o' not found
/usr/lib/crti.o: error: invalid object file
tcc: error: file 'crti.o' not found
In file included from foo.c:1:
/usr/include/stdio.h:33: error: include file 'stddef.h' not found
0
The missing include is because you haven't installed tcc, so you need to
explicitely tell it where to search for its own include files
(-I ~/src/tinycc/include). And as you also have that:
32-bit libs are in /lib32 /usr/lib32
... which isn't natively supported by TCCs configure, you have to
explicitely change config.mak (the 'NATIVE_DEFINES+=-DCONFIG_LDDIR='
line). Afterwards (and if you've installed the 32bit development glibc)
you should be able to generate 32bit executables. As long as you don't
install TCC you might also need '-B ~/src/tinycc/lib/i386' in addition to
the above -I directive, to make tcc find the correct libtcc1.a.
Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel