[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Re: Only load libtcc1 if available

From: Henry Kroll III
Subject: [Tinycc-devel] Re: Only load libtcc1 if available
Date: Mon, 03 May 2010 13:41:35 -0700

"Thomas Preud'homme" <address@hidden> wrote

> libtcc1.a isn't built on arm architecture but tcc_add_runtime add
> unconditionally. I used a macro to not load libtcc1.a on arm but a
> of tcc_add_file by something like :

libtcc1.a wasn't being built on Linux either, so my mob branch patches
started building it as
tcc1.def (It's really libtcc1.a renamed to tcc1.def). This is working
well for me building
windows executables because i386-win32-tcc looks for tcc1.def first, as
proven by

$ i386-win32-tcc fib.c -vvv
(shows that i386-win32-tcc is looking for tcc1.def.
If it does not find tcc1.def it looks for libtcc1.a)

It should work on ARM as well, but I don't have ARM to test with.

If it is building tcc1.def for you then you can use that I think.

Cross-compiling 32 bit windows programs (on Linux):

The problem with libtcc1.a (tcc1.def) is it is difficult to build
without windows because it contains ELF objects and so it is built with
32 bit version of i386-win32-tcc (renamed to tcc.exe on Linux). I tried
building it with 64 bit version of i386-win32-tcc but the resulting
libtcc1.a did not work. It's a big hack, building libtcc1.a, so I put it
last in the Makefile and made it recursive. That way if it doesn't
build, it won't matter too much.

Cross-compiling 64 bit windows programs (on Linux):

Now, apparently, a 64 bit version of libtcc1.a (tcc1.def) needs to be
built if x86_64-win32-tcc is to be used to build 64 bit windows files on
Linux. I get "tcc1.def: error: invalid object file" when I try to use my
32 bit tcc1.def with the 64 bit x86_64-win32-tcc. Luckily 32 bit windows
programs work just fine on 64 bit windows, so nobody is really asking
for 64 bit cross-compiler yet. And I'm going fishing for the Summer, so
I probably won't get around to it for a while. :)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]