I think there are two main built targets on windows (ignoring 32/64), and three target audience.
1. Fully native stand alone windows tcc compiler.
This can be done with a mingw dev env (with msys2 or even msys1), or build-tcc.bat and some compiler present (I'm assuming it also supports cl). I'm not too familiar with the latter, and also not with win32/Makefile so I don't know if that's what it does - I don't have cygwin env. My reproducible build script is also in this category.
2. Build a "posix"-ish tcc, such as native cygwin or msys2.
I don't know if tcc actually supports this kind of build on windows, and personally I'm not interested in it, but theoretically it should be possible. This will probably create a different binary (where _WIN32 is not defined when building or running tcc) and possibly needs different include files (no mingw, global cygwin/msys2 includes, etc).
Does tcc actually support this kind of build?
As for the target audience, I think these are the main ones:
1. Users of mainly microsoft dev tools.
2. Users with a mingw env and (posix) shell tools (these days probably msys2/mingw mode, maybe cygwin too).
3. Users without any dev tools which want to experiment with a small compiler.
In general, I think the main and official build setup for windows should be posix-y shell and mingw env. It provides the most control over the build properties, the tcc build setup is maintained together with the rest of the targets, and the mingw dev env is maintained independently and hopefully well.
However, as we saw recently, some issues can depend on the compiler version. E.g. currently some tests fail when building tcc with mingw gcc 64 7.2.0 .
Which is where my reproducible build could come into play, as It provides an independent and reproducible starting point which can be generated anywhere (besides other values of a reproducible build). It can be used on its own or be a bootstrap compiler for running ./configure && make .
I would not like to enforce it (using the reproducible tcc as input for configure && make), but It could for instance be used to build the official windows tcc binaries. I did not test whether such procedure is reproducible in itself - it might be, but it's hard to test and guarantee.
As for making the instructions simple, IMHO we should publish instructions for users with only microsoft tools, and for users with mingw shell dev env.
On Tuesday, September 26, 2017 6:45 PM, Christian Jullien <address@hidden> wrote:
It's difficult to give advice. It entirely depends on the C toolchain you
already have on your machine (or you're ready to install).
My **personal** choice is of course Cygwin/Makefile because I have Cygwin
installed with gcc for Cygwin and this Makefile, thanks to bash, lets me run
tests for x86 and x64 with one command.
Someone accustomed to Windows will prefer VC++.
I admit a "How to build" guide would be welcome because it's probably hard
for a noob to bootstrap a working tcc on Windows.
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden]
On Behalf Of grischka
Sent: mardi 26 septembre 2017 17:26
To: avih; address@hidden
Subject: Re: [Tinycc-devel] Push reproducible builds script? (for windows)
> I'd like to push my reproducible build script to mob, are there
Not in principle.
Except I'd appreciate some concept to advise users which method to build tcc
on or for windows to use best in what situation.
We do support:
* msys with the normal ./configure && make && make install
* also cygwin with ./configure --cross-prefix=mingw32- && make && make
* also cygwin with Jullien's Makefile from win32
* just mingw's gcc or msvc's cl with build-tcc.bat from win32, including
option to install, no sh-shell required.
* maybe your reproducible build script, with again its own advantages as
well as drawbacks.
What is your recommendation? And how (if any) can we make sure that it will
> In a nutshell, it's a shell script which builds windows tcc
> distribution (4 of them actually: 32, 64, cross 32->64 and 64->32)
> with reproducible output regardless of the host or initial CC (in
> fact, it just doesn't care at all what the host is or which CC is used),
and then prints a checksum of the output.
> Tested with several versions of gcc, clang, tcc, cl (msvc compiler),
> on different systems (linux 32/64, msys2/mingw, osx, freebsd, busybox
> on windows, and others), and it always produces identical output for any
> I've been using this script for my tcc builds, and had no issues with
> it. The resulting tcc binaries can be used as CC for the normal
> configure && make && make test procedure and the result passes all tests.
> It's similar to win32/build-tcc.bat and win32/Makefile but I think it
> has few advantages over them:
> - Works on any OS and with any compiler
> - Deterministic/identical output regardless of the host/compiler.
> - Simple posix shell script which doesn't require dev tools (other than
> a compiler binary), such that it can even run in busybox on windows
> any further tools (and use a tcc or cl compiler).
> This is pretty much the same as I posted about a year ago:
> With the following minimal differences:
> - Try to find a compiler automatically (gcc/cc/tcc/cl) if CC is not set.
> - Use the new "tcc -ar" instead of tinylibmaker .
> - Now also works on freebsd (following commit abd1532 from yesterday).
> E.g. for the current mob ( 8deb05c ) the reproducible build signature is:
> Find the recent version attached (to test: place it at the win32 dir and
> Any objections that I push it to mob?
> - avih
> Tinycc-devel mailing list