FortranCInterface: Fix compatibility with GCC gfortran 12 LTO
Since version 12.0 the GCC Fortran compiler has implemented "WG5/N1942", which causes, if link-time opmization is enabled, obfuscation of hard-coded string values in the compiler objects and its resulting ELF-binaries.
This causes the CMake-internal detection of the mangling scheme for the naming of subroutines to fail. Thus we must ensure to have any link-time optimization features to be disabled on the executable file we perform the detection on.
Fixes: #23123 (closed)
Signed-off-by: Björn Esser besser82@fedoraproject.org
Backport: release
Topic-rename: FortranCInterface-gcc-12-lto
Edited by Brad King