From patchwork Fri Nov 4 13:22:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 80861 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1149926qge; Fri, 4 Nov 2016 06:22:52 -0700 (PDT) X-Received: by 10.99.66.130 with SMTP id p124mr22213313pga.30.1478265772502; Fri, 04 Nov 2016 06:22:52 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id cr5si13761240pad.48.2016.11.04.06.22.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 06:22:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-440439-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-440439-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-440439-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; q=dns; s=default; b=c+muuwlY2utSo+RaO+ZMlo8TOYwRQuNNaKisFcVVTQM9L3xcNw XKl2IgvXXgPCMK3iGB77UdLl43Us8GCwnZtcw5ojrFBxEPbniJK7MyulOfZtmWXD TdOZ8r5Z9+SOetC3zs9FZGhk9KwypH/7NdEgkNGnn4KYAw8f4Q8EZeVfA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; s= default; bh=sfZdBOjkGowic3aABykYdCWkNLE=; b=suKKpIFUh/pFgwv/qdtI xavbzHaXY8m0m0PZSfJxowb62NnPjQqftc1xNUEGEZO/SV2KN6+9gppc2dMgOENz QXnl028uZy/7FPAX0EFxynNCZxqJiC5KvBQfUMIdLt+ctNMbPffSBL0ZmYRX1cy1 u6kHPzkYIv6W0JSae5f5SEQ= Received: (qmail 49424 invoked by alias); 4 Nov 2016 13:22:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 49400 invoked by uid 89); 4 Nov 2016 13:22:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Christina, Hx-languages-length:1795, HX-MS-Has-Attach:yes, HX-HELO:sk:EUR01-H X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-he1eur01on0063.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.63) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Nov 2016 13:22:28 +0000 Received: from VI1PR0801MB2031.eurprd08.prod.outlook.com (10.173.74.140) by VI1PR0801MB2032.eurprd08.prod.outlook.com (10.173.74.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Fri, 4 Nov 2016 13:22:24 +0000 Received: from VI1PR0801MB2031.eurprd08.prod.outlook.com ([10.173.74.140]) by VI1PR0801MB2031.eurprd08.prod.outlook.com ([10.173.74.140]) with mapi id 15.01.0707.006; Fri, 4 Nov 2016 13:22:24 +0000 From: Tamar Christina To: GCC Patches , "10walls@gmail.com" <10walls@gmail.com>, "dmalcolm@redhat.com" CC: nd Subject: [PATCH][GCC] Fix native Windows x86 bootstrap failure with self test Date: Fri, 4 Nov 2016 13:22:24 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar.Christina@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-office365-filtering-correlation-id: cfbb8024-8a8e-4083-e006-08d404b59dd4 x-microsoft-exchange-diagnostics: 1; VI1PR0801MB2032; 7:jo0EmVXPZkXXKAxW94lURFP8I+8eTq7mk8Ut19iwu7z7ovVcM0edphfeK/jBRj0q09hft2nKSv02uBRD38wainpUzzIebyhubpjpw1o3lJZFvAJ+q0A3qC8BMM+ms5wDybwTefG6/GLe7Kg8K5L47HGcZ0h8OhxcHc433lb+XB6x5qKwiMrqgEdg6qC866NfXXY4AnhAX9gvMYXXgPKxTQLysRGKR/AxfhkpVE6WkF5ZeLdFjTYhwKg29/YazH1pKxaAhFWg11UR7xtzWC3twSYRVP0qdORaoRM/2xTGZ67GF57Qgjg1YlbbUM8wAN84wle5QU53wTZdzBBrS7K4cwf/v1EBlpZm3yn8N4QUbE4= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2032; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415321)(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:VI1PR0801MB2032; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB2032; x-forefront-prvs: 01165471DB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(199003)(189002)(377424004)(53754006)(105586002)(106116001)(66066001)(5002640100001)(33656002)(7696004)(10400500002)(229853001)(19580405001)(19580395003)(2906002)(101416001)(9686002)(54356999)(11100500001)(50986999)(106356001)(99936001)(76576001)(2900100001)(77096005)(87936001)(122556002)(4326007)(189998001)(2501003)(5660300001)(586003)(3660700001)(97736004)(74316002)(81166006)(2201001)(3846002)(7736002)(68736007)(7846002)(305945005)(8936002)(86362001)(81156014)(3280700002)(92566002)(8676002)(102836003)(6116002)(5001770100001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0801MB2032; H:VI1PR0801MB2031.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2016 13:22:24.7876 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2032 X-IsSubscribed: yes 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 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.