From patchwork Wed Jul 14 20:27:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 58928 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]) by ozlabs.org (Postfix) with SMTP id CEA1F1007D1 for ; Thu, 15 Jul 2010 06:27:30 +1000 (EST) Received: (qmail 6953 invoked by alias); 14 Jul 2010 20:27:27 -0000 Received: (qmail 6944 invoked by uid 22791); 14 Jul 2010 20:27:25 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, TW_CX X-Spam-Check-By: sourceware.org Received: from c60.cesmail.net (HELO c60.cesmail.net) (216.154.195.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Jul 2010 20:27:20 +0000 Received: from unknown (HELO epsilon2) ([192.168.1.60]) by c60.cesmail.net with ESMTP; 14 Jul 2010 16:27:07 -0400 Received: from 89.243.45.62 ([89.243.45.62]) by webmail.spamcop.net (Horde MIME library) with HTTP; Wed, 14 Jul 2010 16:27:07 -0400 Message-ID: <20100714162707.gz4dld54qowgos88-nzlynne@webmail.spamcop.net> Date: Wed, 14 Jul 2010 16:27:07 -0400 From: Joern Rennecke To: gcc-patches@gcc.gnu.org, Rainer Orth Cc: Jack Howarth Subject: RFA: PR42843: Fix selection of compiler for native bootstrap. (Was: Re: [PATCH] Fix PR42843 to use built compilers) References: <20100711044416.GA15826@bromo.med.uc.edu> <20100711084605.4g9vdj8ikg0sw48o-nzlynne@webmail.spamcop.net> In-Reply-To: MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) 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 Quoting Rainer Orth : > Joern Rennecke writes: > >> Quoting Jack Howarth : >> >>> The previous fix for PR testsuite/42843 (r160461) incorrectly >>> set PLUGINCC and PLUGINCFLAGS to the values for the host >>> compiler rather than the built compiler. >> >> Actually, it's the build compiler vs. built (target) compiler. >> And using the build compiler is right in the non-bootstrap case. >> Even in the boostrap case, it only makes a difference if there >> is an incompatibly between the build compiler and the stage2/ >> stage3 AKA target compiler. > > ... which is likely to be the case. The problem is biggest if you > bootstrap with some vendor compiler, but I've also observed the problem > when bootstrapping on Solaris 8 and 9 with GCC 4.4: while 4.5 and > mainline provide their own , GCC 4.4 does not and the host OS > lacks it, so all plugin tests fail. Even if you add > -I$(objdir)/gcc/include to fetch the mainline-provided file, this > doesn't work because it references macros like __INT_LEAST8_TYPE__ that > aren't defined by pre-4.5 GCCs. One could instead use the stage1 > headers where configure was run with the build compiler, but that breaks > down with make bootstrap-lean. > > Your change for PR testsuite/42843 introduced a regression from 4.5. Indeed. The previous code used @CC@, which is directly substituted by autoconf, whereas my patch used $(COMPILER), which is based on $(CC) and $(CXX), which, albeit set to @CC@ / @CXX@ in the Makefile, are overridden by the toplevel make. The attached patch restores the status quo ante of PLUGINCC / PLUGINCFLAGS settings when not using --enable-build-with-cxx, while using @CXX@ / @CXXFLAGS@ when --enable-build-with-cxx is in use. Bootstrapped & regession tested with and without --enable-build-with-cxx in revision 162120 on i5585-pc-linux-gnu. The results with and without this patch are identical on my system, except that I can observe in the generated site.exp that the previous stage gcc is used instead of the system gcc / g++; in comment #18 on PR42843, Jack Howarth confirmed that this patch fixes the compiler selection issue that he sees on his system. What this patch does not address is the failure of several tests to include "diagnostic.h", which should probably done in a separate patch. 2010-07-14 Joern Rennecke PR testsuite/42843 * Makefile.in (PLUGINCC): Define in terms of @CC@ / @CXX@ * Makefile.in (PLUGINCFLAGS): Define in terms of @CFLAGS@ / @CXXFLAGS@ Index: gcc/Makefile.in =================================================================== --- gcc/Makefile.in (revision 162120) +++ gcc/Makefile.in (working copy) @@ -330,11 +330,14 @@ enable_lto = @enable_lto@ LTO_BINARY_READER = @LTO_BINARY_READER@ LTO_USE_LIBELF = @LTO_USE_LIBELF@ -# Compiler needed for plugin support -PLUGINCC = $(COMPILER) - -# Flags needed for plugin support -PLUGINCFLAGS = $(COMPILER_FLAGS) +# Compiler and flags needed for plugin support +ifneq ($(ENABLE_BUILD_WITH_CXX),yes) +PLUGINCC = @CC@ +PLUGINCFLAGS = @CFLAGS@ +else +PLUGINCC = @CXX@ +PLUGINCFLAGS = @CXXFLAGS@ +endif # Libs and linker options needed for plugin support PLUGINLIBS = @pluginlibs@