This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Trunk/GCC 4.6] Re: [google] Omit date from Fortran .mod files for reproducible builds


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);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]