Hi all, The GCC self-test added in r237144 breaks the native Windows x86 builds (e.g. mingw-w64). This fixes (PR78196) by explicitly adding /dev/null as the output file to the GCC self test.
The test essentially does `-xc -S -c /dev/null -fself-test` `/dev/null` is then converted into the Windows null device `nul` by the MSYS shell, which is correct. But then the driver adds a filename to the name, trying to write the output to `nul.s`. `nul` is a reserved filename on Windows. As such it's invalid to create this file and the call always fails using CreateFile. Checked with x86_64-w64-mingw32 and build gets passed self tests but dies at unrelated libstdc++ and libvtv errors. Ok for trunk? Thanks, Tamar gcc/ 2016-11-03 Tamar Christina <tamar.christ...@arm.com> PR driver/78196 * Makefile.in (SELFTEST_FLAGS): Added -o /dev/null.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 622d038f6fb50c35ff48bc84a69967071aa17e90..7ecd1e4e726e4cb31b1c9fe22dcb777e71468fb2 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1879,7 +1879,10 @@ rest.cross: specs # Specify a dummy input file to placate the driver. # Specify -nostdinc to work around missing WIND_BASE environment variable # required for *-wrs-vxworks-* targets. -SELFTEST_FLAGS = -nostdinc -x c /dev/null -S -fself-test +# Specify -o /dev/null so the output of -S is discarded. More importantly +# It does not try to create a file with the name "null.s" on POSIX and +# "nul.s" on Windows. Because on Windows "nul" is a reserved file name. +SELFTEST_FLAGS = -nostdinc -x c /dev/null -S -fself-test -o /dev/null # Run the selftests during the build once we have a driver and a cc1, # so that self-test failures are caught as early as possible.