[Patch] gfortran: Fix in-build-tree testing [PR101305, PR101660]

Tobias Burnus tobias@codesourcery.com
Tue Aug 10 14:45:33 GMT 2021


This is a follow up to https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576970.html
/https://gcc.gnu.org/r12-2808-g527a1cf32c27a3fbeaf6be7596241570d864cc4c  <https://gcc.gnu.org/r12-2808-g527a1cf32c27a3fbeaf6be7596241570d864cc4c>

It turned out that -I $specpath/libgfortran caused gfortran to regard the IEEE_*.mod
files in that directory as non-intrinsic user modules – which prevented all the special
handling for the IEEE intrinsic module.

As discussed with Jakub on IRC, the simplest/best solution is to copy the
ISO_Fortran_binding.h file from the libgfortran build directory into a
separate 'include' subdirectory and use that one instead.

Additionally, I removed the -I flag as already the (pre-)existing
-B$specpath/libgfortran/ (with tailing '/'!) causes GCC to search
in <path>include for include files.

Tested on x86-64 by doing in-build-tree testing by running "make check-fortran";
plus by checking one ISO*.f90 testcase with --target_board=unix\{,-m32\} and then
copying the command line and running it with 'strace -f', ensuring that the correct
ISO_Fortran_binding.h is read for both '' (= -m64) and '-m32'.

I think the patch is obvious – especially as it matches what was discussed in IRC,
but I will wait until later today until I commit it to permit for pre-commit comments.

Thanks,

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfort-test.diff
Type: text/x-patch
Size: 5146 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210810/9c87a096/attachment.bin>


More information about the Gcc-patches mailing list