This is the mail archive of the mailing list for the GCC 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]

Re: [gfortran,patch] Don't rewrite module files when they haven't changed

Now with the patch. Sorry all, and thanks Janis.

Attachment: md5.diff
Description: Binary data

:ADDPATCH fortran:

[Janis: this patch contains a testsuite new procedure to scan modules, for which I need your approval. See the last paragraph of the mail.]

Building large Fortran codebases efficiently requires dependency tracking. When using gfortran, this is currently hampered by the fact that, given a file code.f90 that contains a module use_me, when code.f90 is recompiled after having changed, the module file use_me.mod is overwritten on the disk, even if its content hasn't changed.

This patch solves this by adding, on the second line of module files, a MD5 sum of the contents of the module file itself (except the first two lines). Furthermore, when a module is created, it's written to disk in a use_me.mod0 file, which is then only renamed into use_me.mod if it is different from the old one (as determined by reading the old MD5 sum and comparing). Thus, we don't update module files that haven't changed.

The patch comes with a testcase, and a new dejagnu procedure, scan- module, to scan module files. Janis, I need your approval for that one, and will welcome comments!

This was regtested on x86_64-linux, and I will test on i386-pc- mingw32 before committing. OK for mainline?


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