tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Makefile added to build native tcc on Windows


From: avih
Subject: Re: [Tinycc-devel] Makefile added to build native tcc on Windows
Date: Sun, 12 Feb 2017 18:01:30 +0000 (UTC)

I took a similar approach of two stages build to generate native windows tcc compilers (32, 64, and two cross 32->64 and 64->32), except that my script doesn't require a makefile - it's a shell script, and can run on any OS and use any compiler, yet produces reproducible (bit-identical) native windows tcc which are ready to be used.

The only exception I'm aware of so far is that it can't use tcc 0.9.26 as the external compiler since it can't compile 0.9.27 (but 0.9.27 works fine as input to that script), and that on freeBSD and probably other BSDs there's a hardcoded #ifdef which prevents correct header generation for windows.

This version of tcc is good enough if one doesn't need libtcc, and it can then be used as a compiler while running the "normal" configure and make build script. This step (configure && make) does require to be executed on windows though since the normal makefile uses some of the the resulting binaries to create others on windows.

If, when using configure && make, one also passes --extra-cflags="-Wall -O2" (which means it won't use -g), then the resulting binaries are also reproducible, and so, starting with any system and any compiler, one could end up with bit identical official build of tcc regardless of the initial OS/compiler.

I'm attaching my latest version of this script, which is functionally identical to the one I posted on Oct-20 ("Reproducible builds" ), except that this one takes the version number from the file VERSION.

To use it: place it at the win32 dir of the source dir, cd to that dir, and then, e.g.: CC=gcc ./build-tcc-reproducible.sh - which will create a dir "reprobuild" at the same dir with 4 stand alone native windows compilers.

I think we should use this, or something along those lines, to create the official windows tcc 0.9.27 distribution which anyone could reproduce to get identical binaries, despite using an initial compiler of their choice.


On Sunday, February 12, 2017 5:34 PM, Christian Jullien <address@hidden> wrote:


Hi Grischka,

Among others:
- it uses gcc which must be installed somehow and available from Windows
PATH. Mine is gcc from Cygwin.
- tcc is buit from gcc while my version is two steps: first build tcc with
gcc then boostrap tcc with tcc. The result is a pure Windows application
that requires no runtime.
- I get defs.h:212: error: include file 'stdio.h' not found and other
undefined includes probably because it is still a Cygwin program
- I have the impression that we need two different tiny_libmaker 32/64 which
my build support.
- I build tcc-0.9.27-x86_64-win32.tar.gz than anyone can use.




-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden]
On Behalf Of grischka
Sent: dimanche 12 février 2017 14:56
To: address@hidden
Subject: Re: [Tinycc-devel] Makefile added to build native tcc on Windows

Christian Jullien wrote:
> It looks many of you have troubles to build tcc 32/64 on Windows.
>
> There is a .bat that mostly does the job but not totally.

Hi Christian,

Hm, "mostly but not totally"?  I can't help but I actually wonder what that
could mean. ;)

--- grischka

> Hope it helps
>
>


_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel



_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Attachment: build-tcc-reproducible.sh
Description: Binary data


reply via email to

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