mingw-runtime has a system header called <io.h> (low-level UNIXish I/O routines). This conflicts with libgfortran/io/io.h when "io.h" is included, causing bootstrap to fail when libgfortran is built.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01609.html>
Oops, that was definitely the wrong URL. The right URL for the patch is: <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02853.html>.
Forgot that last message. The original patch URL was correct. Error between keyboard and chair.
16991 is for libgfortran build problems in general.
In addition to the patch in comment #1, this patch is also needed to fix this bug: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg02416.html>.
Still waiting for patch in comment #1 to be approved.
Paul, can you look again at the patch here: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01609.html Is it OK for mainline?
Fixed.