[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Building a single cross-compiler: please test new con
From: |
Michael Matz |
Subject: |
Re: [Tinycc-devel] Building a single cross-compiler: please test new configure |
Date: |
Sat, 12 Apr 2014 10:39:07 +0200 (CEST) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
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).
address@hidden ~ $ cat foo.c
#include <stdio.h>
int main(void)
{
return 0;
}
address@hidden ~ $ 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.
address@hidden ~ $ ~/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.