From patchwork Tue May 28 07:28:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 246717 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 3FA662C00AA for ; Tue, 28 May 2013 17:29:03 +1000 (EST) 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; q=dns; s=default; b=xwRs/g5H+C8lIkNm 7Xcpq6vvUKGRcunnxKgBvGuHSCFHN8XJX9v0S4OBvuj1ZhdLuxIRcieJkeVHdRMq 04DNzFCDjXRs2FfHQ9njcAczroMIk6prD99Uf2OjhuOzezov27UouE7U1Dgof+lg Ak0QU9Uywa+Xv37hk8zuSO3XlJ4= 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; s=default; bh=GZtweuFWfSOs4nM1o29vLO C9jTQ=; b=ebmh7IWI1VvOXdAAyRVFywj7GPTgX/x/ZXf22ozc/XG+PUqX8sRoRi 8WkWrhyeUacwdU8Si3HP5CiubaBNaRfAbfUYm0h5Jxca+mGgtTxGMboD7vN9FC28 cAV26sMUTiN1UcPqhjLTZNg0aw6+7zmwzbGsE1hVKaE+t8hfHacRg= Received: (qmail 5923 invoked by alias); 28 May 2013 07:28:55 -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 5911 invoked by uid 89); 28 May 2013 07:28:55 -0000 X-Spam-SWARE-Status: No, score=-6.3 required=5.0 tests=AWL, BAYES_50, KHOP_PGP_SIGNED, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, TW_BJ, WEIRD_QUOTING autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 28 May 2013 07:28:50 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UhEKs-0002nC-R4 from Thomas_Schwinge@mentor.com ; Tue, 28 May 2013 00:28:46 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 28 May 2013 00:28:46 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Tue, 28 May 2013 08:28:41 +0100 From: Thomas Schwinge To: CC: Arnaud Charlet , Rainer Orth , , Subject: [ada, build] host/target configuration (was: Restore Solaris/amd64 Ada bootstrap (PR ada/57188)) In-Reply-To: References: User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Tue, 28 May 2013 09:28:28 +0200 Message-ID: <87txlnlg0z.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 X-Virus-Found: No Hi! On Wed, 08 May 2013 11:27:09 +0200, Rainer Orth wrote: > As described in the PR, amd64-pc-solaris2.1[01] Ada bootstrap was failing > for some time. It has turned out that this patch is the culprit: > > 2013-04-23 Eric Botcazou > Pascal Obry > > * gcc-interface/Makefile.in (targ): Fix target name check. > > diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in > --- a/gcc/ada/gcc-interface/Makefile.in > +++ b/gcc/ada/gcc-interface/Makefile.in > @@ -259,7 +259,7 @@ TOOLS_LIBS = targext.o link.o ../../ggc- > # manufacturer, and operating system and assign each of those to its own > # variable. > host:=$(subst -, ,$(host_canonical)) > -targ:=$(subst -, ,$(target)) > +targ:=$(subst -, ,$(subst -gnu, ,$(target_alias))) > arch:=$(word 1,$(targ)) > ifeq ($(words $(targ)),2) > manu:= | osys:=$(word 2,$(targ)) | else | manu:=$(word 2,$(targ)) | osys:=$(word 3,$(targ)) | endif > I couldn't find the gcc-patches posting for this patch, thus I'm missing > the rationale for it. It seems rather counterintuitive and fragile to > me, replacing the canonical $target by the far more varied $target_alias. I concur, and this has now caused confusion for the (pending upstream re-submission) x86 GNU/Hurd port, too, for which, upon removing -gnu from the target of i686-pc-gnu0.3, now a mere 0.3 remains for osys... > If there's really a good reason to keep that patch nonetheless, [...] How about we use something like the following (untested) patch? In essence, replace the manual parsing in gcc/ada/gcc-interface/Makefile.in by using the values the configure script already computed for us. This is largely straightforward (I would hope); please especially review the more involved cases such as the one where I'm now using linux%eabi -- for example, does that do the right thing or interfere with the Android configurations? The target_cpu_canonical substitution has been added in commit 369e542b3ad1c0acfa9bfaeb72b338d8db5ba2ef (2009-02-27, r144463, schwab) but unused ever since, thus removed. I'll now be testing for x86 GNU/Linux and GNU/Hurd; further testing appreciated. Other than rebuilding from scratch, how do I rebuild only the affected Ada/GNAT bits after regenerating gcc/ada/gcc-interface/Makefile? It doesn't just work, and »make clean-target-libada clean-gnattools« doesn't help either? Grüße, Thomas diff --git gcc/ada/gcc-interface/Makefile.in gcc/ada/gcc-interface/Makefile.in index eeb8c7f..c07722b 100644 --- gcc/ada/gcc-interface/Makefile.in +++ gcc/ada/gcc-interface/Makefile.in @@ -151,12 +151,15 @@ GCC_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS) program_transform_name = objdir = . -target_alias=@target_alias@ target=@target@ +target_cpu=@target_cpu@ +target_vendor=@target_vendor@ +target_os=@target_os@ +host_cpu=@host_cpu@ +host_vendor=@host_vendor@ +host_os=@host_os@ xmake_file = @xmake_file@ tmake_file = @tmake_file@ -host_canonical=@host@ -target_cpu_default=@target_cpu_default@ #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c` #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c` @@ -255,20 +258,6 @@ TOOLS_LIBS = targext.o link.o ../../ggc-none.o ../../libcommon-target.a \ ../../../libbacktrace/.libs/libbacktrace.a ../../../libiberty/libiberty.a \ $(SYSLIBS) $(TGT_LIB) -# Convert the target variable into a space separated list of architecture, -# manufacturer, and operating system and assign each of those to its own -# variable. -host:=$(subst -, ,$(host_canonical)) -targ:=$(subst -, ,$(subst -gnu, ,$(target_alias))) -arch:=$(word 1,$(targ)) -ifeq ($(words $(targ)),2) - manu:= - osys:=$(word 2,$(targ)) -else - manu:=$(word 2,$(targ)) - osys:=$(word 3,$(targ)) -endif - # Specify the directories to be searched for header files. # Both . and srcdir are used, in that order, # so that tm.h and config.h will be found in the compilation @@ -280,7 +269,7 @@ ADA_INCLUDES = -I- -I. -I$(srcdir)/ada # Likewise, but valid for subdirectories of the current dir. # FIXME: for VxWorks, we cannot add $(fsrcdir) because the regs.h file in # that directory conflicts with a system header file. -ifneq ($(findstring vxworks,$(osys)),) +ifneq ($(findstring vxworks,$(target_os)),) INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \ -iquote $(fsrcdir)/ada \ -I$(fsrcdir)/../include $(GMPINC) @@ -348,16 +337,16 @@ GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \ uname.o urealp.o usage.o widechar.o \ $(EXTRA_GNATMAKE_OBJS) -# Make arch match the current multilib so that the RTS selection code +# Make target_cpu match the current multilib so that the RTS selection code # picks up the right files. For a given target this must be coherent # with MULTILIB_DIRNAMES defined in gcc/config/target/t-*. -ifeq ($(strip $(filter-out %x86_64, $(arch))),) +ifeq ($(strip $(filter-out %x86_64, $(target_cpu))),) ifeq ($(strip $(MULTISUBDIR)),/32) - arch:=i686 + target_cpu := i686 else ifeq ($(strip $(MULTISUBDIR)),/x32) - arch:=x32 + target_cpu := x32 endif endif endif @@ -460,7 +449,7 @@ EXTRA_LIBGNAT_SRCS= # If what's left is null then it's a match. # m68k VxWorks -ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),) +ifeq ($(strip $(filter-out m68k% wrs vx%,$(target_cpu) $(target_vendor) $(target_os))),) LIBGNAT_TARGET_PAIRS = \ a-intnam.ads