[Top][All Lists]

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

Re: [Tinycc-devel] using tcc as a cross compiler for Windows

From: grischka
Subject: Re: [Tinycc-devel] using tcc as a cross compiler for Windows
Date: Tue, 16 Feb 2010 15:39:21 +0100
User-agent: Thunderbird (Windows/20090812)

Luigi Rizzo wrote:
not sure how useful this is but it seems relatively simple to
use tcc as a cross compiler for Windows, by doing (tried on FreeBSD):

That is because everything you need to compile windows programs is
contained in the tcc source.  It is less simple with the other targets
because they mostly rely on headers and libraries of the target system.

        gmake CONFIG_WIN32=1 _WIN32=1 tcc
        cp tcc tcc.exe
        gmake CONFIG_WIN32=1 _WIN32=1 libtcc1.a

_WIN32=1 has no effect, has it?

Building tiny_impdef is slightly harder but apparently the compiler
is happy enough with a copy of msvcrt.dll and kernel32.dll

windows system dlls are not necessary for compilation.

Putting tcc, libtcc1.a and the *dll in the same directory you can do

        ./tcc -I win32/include -L .  myprog.c

That should be
        ./tcc -B win32 myprog.c

and produce myprog.exe which runs fine under windows.

Perhaps we could add a Makefile target to build the cross compiler ?

Well, we have "./configure --enable-cross" which builds cross compilers
for all targets.  It doesn't currently build libtcc1.a though and also
does not allow to set CONFIG_TCCDIR (config.h) individually, so you still
need to use the -B switch.  Patches to our "mob" branch are welcome, as
always ;)

--- grischka

reply via email to

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