diff options
author | Alastair McKinstry <alastair.mckinstry@sceal.ie> | 2018-02-13 07:59:10 +0000 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2018-02-13 09:59:10 +0200 |
commit | 7b47686da37d266cfcc5f45cd44222737c12390a (patch) | |
tree | bcf6f7e7477f2497387dc0933512323bd962de50 /gcc/fortran/module.c | |
parent | 8df1868d92b45fb257bd09bc8cd8af3baff0ae85 (diff) | |
download | gcc-7b47686da37d266cfcc5f45cd44222737c12390a.zip gcc-7b47686da37d266cfcc5f45cd44222737c12390a.tar.gz gcc-7b47686da37d266cfcc5f45cd44222737c12390a.tar.bz2 |
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, committed to trunk. Will shortly
backport to the 6 and 7 branches as well.
2018-02-13 Alastair McKinstry <alastair.mckinstry@sceal.ie>
Janne Blomqvist <jb@gcc.gnu.org>
* module.c (dump_module): Use lbasename to ensure that module
files are reproducible.
Co-Authored-By: Janne Blomqvist <jb@gcc.gnu.org>
From-SVN: r257613
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index b120501..c833e67 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -6148,8 +6148,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; |