From patchwork Mon Jul 3 14:23:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 783507 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 3x1TsH4Bj3z9s5L for ; Tue, 4 Jul 2017 00:24:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="M4OpEQLg"; 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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=WPchUVRxaT4HC5NXP ap+oqa6oBWEFMSBQ4xjZx5E5Z8cN/19kcra5bUGLlxU9r6JbjuuMfgSI6Kw8fIEK NuB/PhicuznHDWau09EreiQ5x2I1N20igxn/6lUKXa9CnqoY6QYrJ1S+ZAxvjeZN iVH72eU2aJPWePBYOclufoNPwY= 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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=TNH5p/ZJzPMoMOxQ5I1UiX7 k17U=; b=M4OpEQLg1jmTwXfU8rqzbvxaVdRVHfdQ5dOCwCejQdRatkPhFH2Fnre pp3lTUfsnwW+bAhFzx7JfldJWCI73Q1pqlAhvUPbJNj+J18zNt3L9lPsZaAgOvGi WNSGs7YuVLcbGLiSQ9Kq+7CErbNgZM2A3Ldu8u//qhFk7f7OYtGI= Received: (qmail 62585 invoked by alias); 3 Jul 2017 14:23:51 -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 62576 invoked by uid 89); 3 Jul 2017 14:23:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=fes, sadly, fragments, severely X-HELO: mail-yw0-f182.google.com Received: from mail-yw0-f182.google.com (HELO mail-yw0-f182.google.com) (209.85.161.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Jul 2017 14:23:40 +0000 Received: by mail-yw0-f182.google.com with SMTP id a12so23550163ywh.3 for ; Mon, 03 Jul 2017 07:23:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=SpiPe4QCHxou0FqXS1memOzveWIoXvLxrbVwsQhACxk=; b=OpUxtSfvbCLO0Rat+8R3Iafhj7npBZDB6iIrvNmFo5A4wmrrAKbCeuj0dnqwz+5N+x MqNckWhCBmnMooC8U0OXYfLoBkUv0nVT0XWgWySFUyzuST7ynfg7FND0qfB68tQ1JUsa AVBlJlfayBgT6DUfzFpVuizb+h5L703D/DzO57RYwPIsnmxKjqguE46ImsFla4VkeAUN g1+uDUqzWpm6hWqTDRCYUBHMBXafVY0YLGD3Sm9NWEW2Vn6dfeZd3sh+8BN3eZUuke3X XBs/dyM3kArw4ed7WtmYMIBaqAwrdoQnCJCym8RquHoHoyr519Yvg6n4HPA38oLYwjwr PdEA== X-Gm-Message-State: AKS2vOx6mT7G6yfyGfKUut3xLLmAP000J2anHtyuvnyc3ztJRMe/8bJe iWxxK/zd0ooS/P0K X-Received: by 10.129.138.135 with SMTP id a129mr26905373ywg.234.1499091818349; Mon, 03 Jul 2017 07:23:38 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::3:658d]) by smtp.googlemail.com with ESMTPSA id u204sm6667312ywa.76.2017.07.03.07.23.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 07:23:37 -0700 (PDT) Subject: Re: [C++ PATCH] conversion operator names To: Andreas Schwab Cc: GCC Patches References: <87a84nj0nu.fsf@linux-m68k.org> From: Nathan Sidwell Message-ID: <2a400188-733b-86b9-9c18-c694010b8074@acm.org> Date: Mon, 3 Jul 2017 10:23:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <87a84nj0nu.fsf@linux-m68k.org> On 07/01/2017 05:40 PM, Andreas Schwab wrote: > On Jun 30 2017, Nathan Sidwell wrote: > >> * config-lang.in (gtfiles): Add cp/lex.c. > That breaks obj-c++. sorry about that. Turns out I was only building objc not objc++, so I didn't notice that. While objcp's config-lang.in claimed the first part of its gtfiles initializer was the same as cp's version, it had severely bitrotted, even before my sorting patch to the latter, and was therefore only working by accident already. Yet again, specifying the same thing in two different places leads to breakage. Let's not do that. This patch changes objcp's config-lang.in to source cp's variant and extract the gtfiles list therefrom. The fly in that ointment was that we source the lang frags from the toplevel build and the gcc dir, so srcdir is not consistent. This patch makes it so by setting srcdir to the gcc dir when we include the lang frags from the toplevel. And the fly in that ointment is that while the following works in bash: srcdir=${srcdir}/gcc . $frag to just override srcdir during the sourcing of frag, in sh it changes the current shell's value too. A little bit of explicit saving and restoring is needed. I committed the attached as sufficiently obvious. (and fixed my boot procedure to include objc++) nathan 2017-07-03 Nathan Sidwell * configure.ac: Set srcdir when sourcing config-lang.in fragments. * configure: Rebuilt. * config-lang.in: Source cp/config-lang.in, sort objc++ gtfiles list. Index: configure =================================================================== --- configure (revision 249835) +++ configure (working copy) @@ -6166,7 +6166,12 @@ if test -d ${srcdir}/gcc; then language= lang_requires= lang_requires_boot_languages= - . ${lang_frag} + # set srcdir during sourcing lang_frag to the gcc dir. + # Sadly overriding srcdir on the . line doesn't work in plain sh as it + # polutes this shell + saved_srcdir=${srcdir} + srcdir=${srcdir}/gcc . ${lang_frag} + srcdir=${saved_srcdir} for other in ${lang_requires} ${lang_requires_boot_languages}; do case ,${enable_languages}, in *,$other,*) ;; @@ -6241,7 +6246,10 @@ if test -d ${srcdir}/gcc; then subdir_requires= boot_language=no build_by_default=yes - . ${lang_frag} + # set srcdir during sourcing. See above about save & restore + saved_srcdir=${srcdir} + srcdir=${srcdir}/gcc . ${lang_frag} + srcdir=${saved_srcdir} if test x${language} = x; then echo "${lang_frag} doesn't set \$language." 1>&2 exit 1 Index: configure.ac =================================================================== --- configure.ac (revision 249835) +++ configure.ac (working copy) @@ -1839,7 +1839,12 @@ if test -d ${srcdir}/gcc; then language= lang_requires= lang_requires_boot_languages= - . ${lang_frag} + # set srcdir during sourcing lang_frag to the gcc dir. + # Sadly overriding srcdir on the . line doesn't work in plain sh as it + # polutes this shell + saved_srcdir=${srcdir} + srcdir=${srcdir}/gcc . ${lang_frag} + srcdir=${saved_srcdir} for other in ${lang_requires} ${lang_requires_boot_languages}; do case ,${enable_languages}, in *,$other,*) ;; @@ -1914,7 +1919,10 @@ if test -d ${srcdir}/gcc; then subdir_requires= boot_language=no build_by_default=yes - . ${lang_frag} + # set srcdir during sourcing. See above about save & restore + saved_srcdir=${srcdir} + srcdir=${srcdir}/gcc . ${lang_frag} + srcdir=${saved_srcdir} if test x${language} = x; then echo "${lang_frag} doesn't set \$language." 1>&2 exit 1 Index: gcc/objcp/config-lang.in =================================================================== --- gcc/objcp/config-lang.in (revision 249835) +++ gcc/objcp/config-lang.in (working copy) @@ -43,8 +43,20 @@ subdir_requires="objc cp" # avoid having the GC stuff from that header being added to gtype-cp.h # or gtype-objc.h. -# This list is separated in two parts: the first one is identical to -# the C++ one, the second one contains our ObjC++ additions. -gtfiles="\$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.h \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-objcp-common.c \$(srcdir)/cp/except.c \$(srcdir)/cp/vtable-class-hierarchy.c \$(srcdir)/cp/constexpr.c \$(srcdir)/cp/cp-gimplify.c \ -\$(srcdir)/objc/objc-map.h \$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/c-family/c-cppbuiltin.c" +# Get the C++ FE's gtfiles list. Do this in a subshell, so we can +# extract exactly the gtfiles var, but munge cp-lang.c into objcp-lang.c. +gtfiles="$(. $srcdir/cp/config-lang.in ; \ + echo $gtfiles | sed 's+/cp/cp-lang.c +/objcp/objcp-lang.c +')" + +# Now add our special bits to it. Please keep this list sorted. +gtfiles="$gtfiles \ +\$(srcdir)/objc/objc-act.h \ +\$(srcdir)/objc/objc-map.h \ +\$(srcdir)/c-family/c-cppbuiltin.c \ +\$(srcdir)/objc/objc-act.c \ +\$(srcdir)/objc/objc-gnu-runtime-abi-01.c \ +\$(srcdir)/objc/objc-next-runtime-abi-01.c \ +\$(srcdir)/objc/objc-next-runtime-abi-02.c \ +\$(srcdir)/objc/objc-runtime-shared-support.c \ +"