|From:||Michael B. Smith|
|Subject:||Re: [Tinycc-devel] Push reproducible builds script? (for windows)|
|Date:||Tue, 26 Sep 2017 18:38:41 +0000|
Can 0.9.26 build mob?
On Windows, you need a working C compiler to bootstrap tcc which ranges from 100MB to 10GB in size. For most casual C developers, installing Cygwin/mingw or Visual C to build tcc is overkill, especially because they will get a C compiler and they will no more need tcc after that.
Why not to consider to add in repository (in win32/bin for example) a stable native tcc.exe and a bootstrap.bat that is able to recompile at any time a native tcc.exe from mod. Most programming languages bootstrap themselves from a previous version.
With this solution, tcc git repository will have all the material to bootstrap itself on Windows. If you like, win32/bin/tcc.exe could be named xtcc.exe as gcc does when it bootstraps. xtcc.exe can be very stable an requires an update only when it is no more able to boostrap mob (because for example mod sources code adds C11 features that xtcc.exe does not support).
Ok, I know it is not a good practice to add binaries in source code repository.
FYI win32/Makefile uses Cygwin/gcc to build tcc that in turn builds native tcc x86 and x64 which require no other libs or tools to run.
You end with a set of files you can copy on any Windows machines to make C dev (only a “make” program is missing).
I think there are two main built targets on windows (ignoring 32/64), and three target audience.
Build targets are:
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:
|[Prev in Thread]||Current Thread||[Next in Thread]|