public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [google] Omit date from Fortran .mod files for reproducible builds
@ 2011-01-27 14:41 Simon Baldwin
  2011-01-27 14:53 ` Diego Novillo
  2011-01-28 13:14 ` [Trunk/GCC 4.6] " Tobias Burnus
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Baldwin @ 2011-01-27 14:41 UTC (permalink / raw)
  To: gcc-patches

Omit date from Fortran .mod files for reproducible builds.

Strict build environments do binary comparisons of files across gcc builds.
Writing the current timestamp into a Fortran .mod file leads to false
positives from such environments.  Omitting the timestamp removes these
false positives.

Targeted for the google/integration branch.

gcc/fortran/ChangeLog.google:
2011-01-27  Simon Baldwin  <simonb@google.com>

	* module.c (gfc_dump_module): Omit timestamp from output.

Google ref: 39202, 25691, 13445, 13307


Index: gcc/fortran/module.c
===================================================================
--- gcc/fortran/module.c	(revision 169330)
+++ gcc/fortran/module.c	(working copy)
@@ -5116,8 +5116,7 @@ void
 gfc_dump_module (const char *name, int dump_flag)
 {
   int n;
-  char *filename, *filename_tmp, *p;
-  time_t now;
+  char *filename, *filename_tmp;
   fpos_t md5_pos;
   unsigned char md5_new[16], md5_old[16];
 
@@ -5159,13 +5158,8 @@ gfc_dump_module (const char *name, int d
 		     filename_tmp, xstrerror (errno));
 
   /* Write the header, including space reserved for the MD5 sum.  */
-  now = time (NULL);
-  p = ctime (&now);
-
-  *strchr (p, '\n') = '\0';
-
-  fprintf (module_fp, "GFORTRAN module version '%s' created from %s on %s\n"
-	   "MD5:", MOD_VERSION, gfc_source_file, p);
+  fprintf (module_fp, "GFORTRAN module version '%s' created from %s\n"
+	   "MD5:", MOD_VERSION, gfc_source_file);
   fgetpos (module_fp, &md5_pos);
   fputs ("00000000000000000000000000000000 -- "
 	"If you edit this, you'll get what you deserve.\n\n", module_fp);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [google] Omit date from Fortran .mod files for reproducible builds
  2011-01-27 14:41 [google] Omit date from Fortran .mod files for reproducible builds Simon Baldwin
@ 2011-01-27 14:53 ` Diego Novillo
  2011-01-28 13:14 ` [Trunk/GCC 4.6] " Tobias Burnus
  1 sibling, 0 replies; 6+ messages in thread
From: Diego Novillo @ 2011-01-27 14:53 UTC (permalink / raw)
  To: Simon Baldwin; +Cc: gcc-patches

On Thu, Jan 27, 2011 at 09:00, Simon Baldwin <simonb@google.com> wrote:

> 2011-01-27  Simon Baldwin  <simonb@google.com>
>
>        * module.c (gfc_dump_module): Omit timestamp from output.

OK.

Diego.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Trunk/GCC 4.6]  Re: [google] Omit date from Fortran .mod files for reproducible builds
  2011-01-27 14:41 [google] Omit date from Fortran .mod files for reproducible builds Simon Baldwin
  2011-01-27 14:53 ` Diego Novillo
@ 2011-01-28 13:14 ` Tobias Burnus
  2011-01-28 19:06   ` Diego Novillo
  1 sibling, 1 reply; 6+ messages in thread
From: Tobias Burnus @ 2011-01-28 13:14 UTC (permalink / raw)
  To: Simon Baldwin, Diego Novillo, gfortran; +Cc: gcc-patches

We (Janne and I) think this patch can also be applied to the GCC 4.6 
trunk; as the date is never read there is also no .mod ABI issue.

I assume that there are no copyright issues.

Cf. also short "discussion"
    at http://gcc.gnu.org/ml/fortran/2011-01/msg00270.html

Tobias

On 01/27/2011 03:00 PM, Simon Baldwin wrote:
> Omit date from Fortran .mod files for reproducible builds.
>
> Strict build environments do binary comparisons of files across gcc builds.
> Writing the current timestamp into a Fortran .mod file leads to false
> positives from such environments.  Omitting the timestamp removes these
> false positives.
>
> Targeted for the google/integration branch.
>
> gcc/fortran/ChangeLog.google:
> 2011-01-27  Simon Baldwin<simonb@google.com>
>
> 	* module.c (gfc_dump_module): Omit timestamp from output.
>
> Google ref: 39202, 25691, 13445, 13307
>
>
> Index: gcc/fortran/module.c
> ===================================================================
> --- gcc/fortran/module.c	(revision 169330)
> +++ gcc/fortran/module.c	(working copy)
> @@ -5116,8 +5116,7 @@ void
>   gfc_dump_module (const char *name, int dump_flag)
>   {
>     int n;
> -  char *filename, *filename_tmp, *p;
> -  time_t now;
> +  char *filename, *filename_tmp;
>     fpos_t md5_pos;
>     unsigned char md5_new[16], md5_old[16];
>
> @@ -5159,13 +5158,8 @@ gfc_dump_module (const char *name, int d
>   		     filename_tmp, xstrerror (errno));
>
>     /* Write the header, including space reserved for the MD5 sum.  */
> -  now = time (NULL);
> -  p = ctime (&now);
> -
> -  *strchr (p, '\n') = '\0';
> -
> -  fprintf (module_fp, "GFORTRAN module version '%s' created from %s on %s\n"
> -	   "MD5:", MOD_VERSION, gfc_source_file, p);
> +  fprintf (module_fp, "GFORTRAN module version '%s' created from %s\n"
> +	   "MD5:", MOD_VERSION, gfc_source_file);
>     fgetpos (module_fp,&md5_pos);
>     fputs ("00000000000000000000000000000000 -- "
>   	"If you edit this, you'll get what you deserve.\n\n", module_fp);
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Trunk/GCC 4.6] Re: [google] Omit date from Fortran .mod files for reproducible builds
  2011-01-28 13:14 ` [Trunk/GCC 4.6] " Tobias Burnus
@ 2011-01-28 19:06   ` Diego Novillo
  2011-09-16 19:07     ` Diego Novillo
  0 siblings, 1 reply; 6+ messages in thread
From: Diego Novillo @ 2011-01-28 19:06 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Simon Baldwin, gfortran, gcc-patches

On Fri, Jan 28, 2011 at 06:19, Tobias Burnus <burnus@net-b.de> wrote:
> We (Janne and I) think this patch can also be applied to the GCC 4.6 trunk;
> as the date is never read there is also no .mod ABI issue.
>
> I assume that there are no copyright issues.

There aren't.  Google has signed a blanket copyright assignment with
the FSF.  Any patch coming from a google.com address is covered.

I'll mark this patch for trunk.  Thanks.


Diego.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Trunk/GCC 4.6] Re: [google] Omit date from Fortran .mod files for reproducible builds
  2011-01-28 19:06   ` Diego Novillo
@ 2011-09-16 19:07     ` Diego Novillo
  2011-09-20 11:12       ` Janne Blomqvist
  0 siblings, 1 reply; 6+ messages in thread
From: Diego Novillo @ 2011-09-16 19:07 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Simon Baldwin, gfortran, gcc-patches

On Fri, Jan 28, 2011 at 13:00, Diego Novillo <dnovillo@google.com> wrote:
> On Fri, Jan 28, 2011 at 06:19, Tobias Burnus <burnus@net-b.de> wrote:
>> We (Janne and I) think this patch can also be applied to the GCC 4.6 trunk;
>> as the date is never read there is also no .mod ABI issue.
>>
>> I assume that there are no copyright issues.
>
> There aren't.  Google has signed a blanket copyright assignment with
> the FSF.  Any patch coming from a google.com address is covered.
>
> I'll mark this patch for trunk.  Thanks.

Tobias, I'm planning to apply this (old) patch to trunk.  Still OK?

I've re-bootstrapped on x86_64.  No new failures.


Thanks.  Diego.

2011-09-16  Simon Baldwin  <simonb@google.com>

       * module.c (gfc_dump_module): Omit timestamp from output.

diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 4250a17..b29ba4b 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -5178,8 +5178,7 @@ void
 gfc_dump_module (const char *name, int dump_flag)
 {
   int n;
-  char *filename, *filename_tmp, *p;
-  time_t now;
+  char *filename, *filename_tmp;
   fpos_t md5_pos;
   unsigned char md5_new[16], md5_old[16];

@@ -5221,13 +5220,8 @@ gfc_dump_module (const char *name, int dump_flag)
                     filename_tmp, xstrerror (errno));

   /* Write the header, including space reserved for the MD5 sum.  */
-  now = time (NULL);
-  p = ctime (&now);
-
-  *strchr (p, '\n') = '\0';
-
-  fprintf (module_fp, "GFORTRAN module version '%s' created from %s on %s\n"
-          "MD5:", MOD_VERSION, gfc_source_file, p);
+  fprintf (module_fp, "GFORTRAN module version '%s' created from %s\n"
+          "MD5:", MOD_VERSION, gfc_source_file);
   fgetpos (module_fp, &md5_pos);
   fputs ("00000000000000000000000000000000 -- "
        "If you edit this, you'll get what you deserve.\n\n", module_fp);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Trunk/GCC 4.6] Re: [google] Omit date from Fortran .mod files for reproducible builds
  2011-09-16 19:07     ` Diego Novillo
@ 2011-09-20 11:12       ` Janne Blomqvist
  0 siblings, 0 replies; 6+ messages in thread
From: Janne Blomqvist @ 2011-09-20 11:12 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Tobias Burnus, Simon Baldwin, gfortran, gcc-patches

On Fri, Sep 16, 2011 at 21:06, Diego Novillo <dnovillo@google.com> wrote:
> On Fri, Jan 28, 2011 at 13:00, Diego Novillo <dnovillo@google.com> wrote:
>> On Fri, Jan 28, 2011 at 06:19, Tobias Burnus <burnus@net-b.de> wrote:
>>> We (Janne and I) think this patch can also be applied to the GCC 4.6 trunk;
>>> as the date is never read there is also no .mod ABI issue.
>>>
>>> I assume that there are no copyright issues.
>>
>> There aren't.  Google has signed a blanket copyright assignment with
>> the FSF.  Any patch coming from a google.com address is covered.
>>
>> I'll mark this patch for trunk.  Thanks.
>
> Tobias, I'm planning to apply this (old) patch to trunk.  Still OK?

Yes, ok.

>
> I've re-bootstrapped on x86_64.  No new failures.
>
>
> Thanks.  Diego.
>
> 2011-09-16  Simon Baldwin  <simonb@google.com>
>
>       * module.c (gfc_dump_module): Omit timestamp from output.
>
> diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
> index 4250a17..b29ba4b 100644
> --- a/gcc/fortran/module.c
> +++ b/gcc/fortran/module.c
> @@ -5178,8 +5178,7 @@ void
>  gfc_dump_module (const char *name, int dump_flag)
>  {
>   int n;
> -  char *filename, *filename_tmp, *p;
> -  time_t now;
> +  char *filename, *filename_tmp;
>   fpos_t md5_pos;
>   unsigned char md5_new[16], md5_old[16];
>
> @@ -5221,13 +5220,8 @@ gfc_dump_module (const char *name, int dump_flag)
>                     filename_tmp, xstrerror (errno));
>
>   /* Write the header, including space reserved for the MD5 sum.  */
> -  now = time (NULL);
> -  p = ctime (&now);
> -
> -  *strchr (p, '\n') = '\0';
> -
> -  fprintf (module_fp, "GFORTRAN module version '%s' created from %s on %s\n"
> -          "MD5:", MOD_VERSION, gfc_source_file, p);
> +  fprintf (module_fp, "GFORTRAN module version '%s' created from %s\n"
> +          "MD5:", MOD_VERSION, gfc_source_file);
>   fgetpos (module_fp, &md5_pos);
>   fputs ("00000000000000000000000000000000 -- "
>        "If you edit this, you'll get what you deserve.\n\n", module_fp);
>



-- 
Janne Blomqvist

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-20 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 14:41 [google] Omit date from Fortran .mod files for reproducible builds Simon Baldwin
2011-01-27 14:53 ` Diego Novillo
2011-01-28 13:14 ` [Trunk/GCC 4.6] " Tobias Burnus
2011-01-28 19:06   ` Diego Novillo
2011-09-16 19:07     ` Diego Novillo
2011-09-20 11:12       ` Janne Blomqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).