From: Alastair McKinstry Date: Tue, 13 Feb 2018 08:06:02 +0000 (+0000) Subject: Make module files reproducible X-Git-Tag: releases/gcc-6.5.0~527 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e232404879a50974beeb2182780a81156cc753b;p=thirdparty%2Fgcc.git Make module files reproducible Using lbasename ensures that the build path does not end up in the module file. Regtested on x86_64-pc-linux-gnu. Backport from trunk. 2018-02-13 Alastair McKinstry Janne Blomqvist * module.c (dump_module): Use lbasename to ensure that module files are reproducible. Co-Authored-By: Janne Blomqvist From-SVN: r257615 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 486b7d41394d..49930c72b032 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-02-13 Alastair McKinstry + Janne Blomqvist + + * module.c (dump_module): Use lbasename to ensure that module + files are reproducible. + 2018-02-12 Thomas Koenig PR fortran/68560 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 29bcaf37bf9a..a77337be668f 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -6080,8 +6080,10 @@ dump_module (const char *name, int dump_flag) gfc_fatal_error ("Can't open module file %qs for writing at %C: %s", filename_tmp, xstrerror (errno)); + /* Use lbasename to ensure module files are reproducible regardless + of the build path (see the reproducible builds project). */ gzprintf (module_fp, "GFORTRAN module version '%s' created from %s\n", - MOD_VERSION, gfc_source_file); + MOD_VERSION, lbasename (gfc_source_file)); /* Write the module itself. */ iomode = IO_OUTPUT;