From patchwork Wed Oct 5 12:34:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 678422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3spwGG11XXz9ryk for ; Wed, 5 Oct 2016 23:34:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ZABBR1fu; dkim-atps=neutral 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:in-reply-to:references:date:message-id :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=DW9oCWNYxmUKC/uIM4euCDKNHxP5BNETi30D2CXKadPgSONFoAV1a Uh+MFUuh8k7z6gcOOkS6+G/gNdA0fDgQi/beaeoB1ogrPlGE3s9TykGrlFghKrxp upf83tsybZ2wyFA3++tjwAmomBTmwRMzn3P2/7GBOup3E2Cl3aJYiA= 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:in-reply-to:references:date:message-id :mime-version:content-type:content-transfer-encoding; s=default; bh=ZwWOPYdahH0OgoKBrsqlzIoq/ws=; b=ZABBR1fuJ/rQQJqIryde2ZQ2qNS0 vfKpCaFtzFDS8hjxM+WQiMD0S78rg93v9m+ACN1stjiORC0ord80hm+zSWeWtJ2K ry/mHM0k3cWThmkZ3pEBIq95rMS17VjXNCs5Gc3YlNdWCow49GAT8X2yRLNlGhFk XXiDMGTDJGIhf1U= Received: (qmail 18757 invoked by alias); 5 Oct 2016 12:34:36 -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 18739 invoked by uid 89); 5 Oct 2016 12:34:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=self-test, H*F:U*thomas, U*dmalcolm, sk:dmalcol X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Oct 2016 12:34:25 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1brlOv-00079L-T2 from Thomas_Schwinge@mentor.com ; Wed, 05 Oct 2016 05:34:21 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.224.2; Wed, 5 Oct 2016 05:34:21 -0700 Received: by tftp-cs (Postfix, from userid 49978) id 01C5BC2319; Wed, 5 Oct 2016 05:34:20 -0700 (PDT) From: Thomas Schwinge To: David Malcolm CC: , Nathan Sidwell , Jan-Benedict Glaw Subject: Re: [BUILDROBOT] Selftest failed for i686-wrs-vxworks In-Reply-To: <1467317363.18068.49.camel@redhat.com> References: <20160630113937.GT4454@lug-owl.de> <1467317363.18068.49.camel@redhat.com> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i686-pc-linux-gnu) Date: Wed, 5 Oct 2016 14:34:15 +0200 Message-ID: <87vax73rg8.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! I've now also run into this issue, during contrib/config-list.mk testing; log/arm-wrs-vxworks-make.out, log/i686-wrs-vxworks-make.out, log/i686-wrs-vxworksae-make.out, log/mips-wrs-vxworks-make.out, log/powerpc-wrs-vxworks-make.out, log/powerpc-wrs-vxworksae-make.out, log/powerpc-wrs-vxworksmils-make.out, log/sh-wrs-vxworks-make.out, log/sparc-wrs-vxworks-make.out: [...]/build-multi/arm-wrs-vxworks/./gcc/xgcc -B[...]/build-multi/arm-wrs-vxworks/./gcc/ -xc -S -c /dev/null -fself-test xgcc: fatal error: environment variable 'WIND_BASE' not defined compilation terminated. make[2]: *** [s-selftest] Error 1 [...] make[1]: *** [all-gcc] Error 2 On Thu, 30 Jun 2016 16:09:23 -0400, David Malcolm wrote: > On Thu, 2016-06-30 at 08:38 -0400, Nathan Sidwell wrote: > > [...] WIND_BASE is expected to point at a vxworks install [...] > [...] > > Hence it appears that passing "-nostdinc" as a param will avoid the > error: [...] > > Presumably if you're explicitly building for vxworks you have a vxworks > install, so there is a meaningful value to set WIND_BASE to, whereas if > you don't have a vxworks install (and are merely building everything as > a smoketest), you presumably only want to build the "gcc" subdir, since > AFAIK you can't run then driver. > > So there are at least 2 ways of fixing this: > > (a) add "-nostdinc" when running the selftests i.e. to the invocations > of GCC_FOR_TARGET in the "s-selftest" and "selftest-gdb" clauses of > gcc/Makefile.in. > I've verified that this fixes the issue for --target=i686-wrs-vxworks. OK to apply the following two patches? First, a little bit of refactoring: commit 0b124fda378c9dc726bd709f805dd52a7dc7c78a Author: Thomas Schwinge Date: Wed Oct 5 08:06:00 2016 +0200 In gcc/Makefile.in, factor out SELFTEST_FLAGS gcc/ * Makefile.in (SELFTEST_FLAGS): New variable. (s-selftest, selftest-gdb, selftest-valgrind): Use it. --- gcc/Makefile.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) Grüße Thomas diff --git gcc/Makefile.in gcc/Makefile.in index 15c48bc..08b96a6 100644 --- gcc/Makefile.in +++ gcc/Makefile.in @@ -1876,6 +1876,10 @@ endif # This does the things that can't be done on the host machine. rest.cross: specs +# GCC's selftests. +# Specify a dummy input file to placate the driver. +SELFTEST_FLAGS = -x c /dev/null -S -fself-test + # 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. # Use "s-selftest" to ensure that we only run the selftests if the @@ -1883,18 +1887,19 @@ rest.cross: specs .PHONY: selftest selftest: s-selftest s-selftest: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs - $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test + $(GCC_FOR_TARGET) $(SELFTEST_FLAGS) $(STAMP) $@ # Convenience method for running selftests under gdb: .PHONY: selftest-gdb selftest-gdb: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs - $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test -wrapper gdb,--args + $(GCC_FOR_TARGET) $(SELFTEST_FLAGS) \ + -wrapper gdb,--args # Convenience method for running selftests under valgrind: .PHONY: selftest-valgrind selftest-valgrind: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs - $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test \ + $(GCC_FOR_TARGET) $(SELFTEST_FLAGS) \ -wrapper valgrind,--leak-check=full # Recompile all the language-independent object files. ..., and then the real change: commit 8ab49582c42809b385eb957c20b84d21a90e041a Author: Thomas Schwinge Date: Wed Oct 5 08:08:37 2016 +0200 Make GCC selftests work for *-wrs-vxworks-* targets gcc/ Makefile.in (SELFTEST_FLAGS): Add -nostdinc. --- gcc/Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git gcc/Makefile.in gcc/Makefile.in index 08b96a6..23623ac 100644 --- gcc/Makefile.in +++ gcc/Makefile.in @@ -1878,7 +1878,9 @@ rest.cross: specs # GCC's selftests. # Specify a dummy input file to placate the driver. -SELFTEST_FLAGS = -x c /dev/null -S -fself-test +# 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 # 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.