gfortran generates .mod and .smod files that can capture the build path. A patch for gfortran : https://bugs.debian.org/889133 Also, a small workaround script to fix mod files is here: https://sources.debian.org/src/eccodes/latest/debian/sanitize-mod/
Our notes about issues affecting packages are stored in notes.git and are targeted at packages in Debian in 'unstable/amd64' (unless they say otherwise).