This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[google] Omit date from Fortran .mod files for reproducible builds
- From: simonb at google dot com (Simon Baldwin)
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Jan 2011 15:00:00 +0100 (CET)
- Subject: [google] Omit date from Fortran .mod files for reproducible builds
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);