public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, Makefile.in] refine selftest recipes to restore mingw bootstrap
@ 2017-11-24 21:35 Olivier Hainque
  2017-11-27  8:21 ` Jeff Law
  0 siblings, 1 reply; 11+ messages in thread
From: Olivier Hainque @ 2017-11-24 21:35 UTC (permalink / raw)
  To: GCC Patches; +Cc: Olivier Hainque

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

Hello,

Bootstrap for mingw target configurations is failing today, with complaints
about an inexistant /dev/null.

The failing commands are issued by the selftest recipes in gcc/Makefile, using:

    SELFTEST_FLAGS = -nostdinc /dev/null -S -o /dev/null \
            -fself-test=$(srcdir)/testsuite/selftests

The attached patch is a proposal to fix this by resorting to "nul" instead of
"/dev/null" when the build machine name indicates a mingw setup.

It fixes the gcc-7 bootstrap in our Windows setup (i686-pc-mingw32), and passes
bootstrap and regression tests on x86_64-linux.

OK to commit ?

Thanks much in advance,

With Kind Regards,

Olivier

2017-11-24  Olivier Hainque  <hainque@adacore.com>

	* Makefile.in (SELFTEST_FLAGS): Use nul instead of /dev/null
	on mingw build hosts.


[-- Attachment #2: dev_null.diff --]
[-- Type: application/octet-stream, Size: 886 bytes --]

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 5db7855..9b7ca1b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1907,9 +1907,12 @@ rest.cross: specs
 # 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.
+# Beware that /dev/null is not available for mingw tools, so directly use
+# "nul" instead of "/dev/null" if we're building on a mingw machine.
 # Specify the path to gcc/testsuite/selftests within the srcdir
 # as an argument to -fself-test.
-SELFTEST_FLAGS = -nostdinc /dev/null -S -o /dev/null \
+DEVNULL=$(if $(findstring mingw,$(build)),nul,/dev/null)
+SELFTEST_FLAGS = -nostdinc $(DEVNULL) -S -o $(DEVNULL) \
 	-fself-test=$(srcdir)/testsuite/selftests
 
 C_SELFTEST_FLAGS = -xc $(SELFTEST_FLAGS)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-11-28 11:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24 21:35 [PATCH, Makefile.in] refine selftest recipes to restore mingw bootstrap Olivier Hainque
2017-11-27  8:21 ` Jeff Law
2017-11-27  8:49   ` Olivier Hainque
2017-11-27  9:23   ` Olivier Hainque
2017-11-27 22:34     ` David Malcolm
2017-11-28  7:05       ` Jeff Law
2017-11-28  8:53         ` Olivier Hainque
     [not found]       ` <HE1PR08MB0507A7C1FF45082506A7BC08FF3A0@HE1PR08MB0507.eurprd08.prod.outlook.com>
2017-11-28 10:11         ` Tamar Christina
2017-11-28 11:22           ` Olivier Hainque
2017-11-28 11:34             ` Tamar Christina
2017-11-28 12:24               ` Olivier Hainque

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).