This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Deterministic builds
- From: Ismail Donmez <ismail at i10z dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 4 May 2016 20:21:00 +0300
- Subject: Re: Deterministic builds
- Authentication-results: sourceware.org; auth=none
- References: <ff5f5b20-33e2-ef2d-012a-a9e02903ba21 at cornell dot edu>
Hi,
On Wed, May 4, 2016 at 4:38 PM, Ken Brown <kbrown@cornell.edu> wrote:
> Is it possible to build an executable on Cygwin so that subsequent builds
> (with no change in source) produce identical results? Currently, the
> timestamp embedded in executables prevents this. (I don't know if that's
> the only obstacle.)
>
> For example:
>
> $ cat hello.c
> #include <stdio.h>
> int
> main ()
> {
> printf("Hello, world!\n");
> return 0;
> }
>
> $ gcc hello.c -o hello1
>
> $ gcc hello.c -o hello2
>
> $ objdump -p hello1.exe | grep Time/Date
> Time/Date Wed May 4 09:20:24 2016
>
> $ objdump -p hello2.exe | grep Time/Date
> Time/Date Wed May 4 09:20:29 2016
You can easily disable this feature:
latte ~ > gcc -Wl,--no-insert-timestamp hello.c
latte ~ > objdump -p a.exe | grep Time/Date
Time/Date Thu Jan 1 03:31:53 1970
latte ~ > gcc -Wl,--no-insert-timestamp hello.c
latte ~ > objdump -p a.exe | grep Time/Date
Time/Date Thu Jan 1 03:31:53 1970
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple