[Top][All Lists]

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

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

From: grischka
Subject: Re: [Tinycc-devel] Re: Only load libtcc1 if available
Date: Mon, 03 May 2010 23:48:40 +0200
User-agent: Thunderbird (Windows/20090812)

Henry Kroll III wrote:
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.

I think if we want to support cross compilers more seriously then
we probably need to figure out some directory scheme where the
cross-headers and cross-libraries reside, plus a method to configure
the cross-tcc compilers individually to use alternative include/library
search paths.

We could even avoid any hard-coded strings in the tcc executable and
instead make it load some such as tcc-<arch>.cfg with the search
paths as well as the arch-specific preprocessor defines in it.  At least
this would be convenient for experiments.

In any case the win32/64 cross-compilers are probably the most easiest
to setup because everything needed is included with the source code and
it is already tuned to use a directory structure as it exists under win32.

But the win32 version of libtcc1.a should simply be win32/lib/libtcc1.a
and not some tcc1.def hack.

As to ARM, I think Daniel has or had a pre-built libtcc1.a for ARM
on his web-site (url can be found somewhere in this mail archive, IIRC).

--- grischka

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]