From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 2A0F73858402 for ; Fri, 24 Sep 2021 10:23:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A0F73858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x430.google.com with SMTP id t7so25756385wrw.13 for ; Fri, 24 Sep 2021 03:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=z0A6ljHoqM75pEie6YR4n4J/59rIZvn9kviRBg3qiUc=; b=dmgBPwI/RiVzFZ3lKYWd7bLlwDUPwRv+kn/emQ0kYFCp6BRrdit+sxFKMGGLga5oGc 3Li/+qcowOlEHrZ4U0VuXzGi2cKd/SunkORVOsiQSD1xyOntHlL1++6ISfdqqXriN9kW JZLuc2ZjTix2VtcH93EIGbFCSAeVCN8f5DWq+sfYT/bPkBM4kOuXFHKxEzi4D2euyB4p SzJcWqpOHxCqqJbZDDd3Ld5ZbibSCS3A0X5IslByu5E3cSvirBh5ILiNkFAUDY/0vZJO ZxQFQMFmoCMgRj3cbRhJpVOKPpGvflrouMG92KW+11AdGMYK1PX9LgTFj42YrES5NpM2 /Eow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=z0A6ljHoqM75pEie6YR4n4J/59rIZvn9kviRBg3qiUc=; b=xYKhTplLPDszYs0n76rOJOt0Kii6fy9AWXOn1aUS1J+3ScRKIO05Jolj2lLeXKmdK3 SSyhLNQCqKQJYP0eTc4maidpbKixR5LeZ91KdlDPFR8iDjPp0glwy1OWslFDEAbkiebl zul1qliqS+4TJo8TxKrIs0PI9vYP+PNW41RU4Umgfa0rhvYYPOXCgWTGfsDtB2KmJE4G opGhKJZgD44mW7m/0RdIyW69QzkPU5w/aJ9HV/sU/TXpWSAoWitUH+OuJL81ygMESu6s 4B5ksRgDVL8eWO+5VC4VQmy7uTzn1WSh6T5kRvtS9gqtcrVzkE4xqxiuzwWOKbiTaaS4 lmIA== X-Gm-Message-State: AOAM531RbmAM+J584K789GCh8KX53pgIUUySOAxkMywPgnaTp0WrDEk7 lv35ILebzq34kdXEm08j5X+9hg== X-Google-Smtp-Source: ABdhPJyDMUM05jhZfvrfZiGE0ftuO80Y0PG7hwX6hcCddt1dP0waj55PZ2xIsVrLF4yUE05xqH7VQg== X-Received: by 2002:adf:d1b3:: with SMTP id w19mr10632770wrc.152.1632479006599; Fri, 24 Sep 2021 03:23:26 -0700 (PDT) Received: from localhost (host86-169-137-11.range86-169.btcentralplus.com. [86.169.137.11]) by smtp.gmail.com with ESMTPSA id f19sm7838376wmf.11.2021.09.24.03.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 03:23:26 -0700 (PDT) Date: Fri, 24 Sep 2021 11:23:25 +0100 From: Andrew Burgess To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH] top-level configure: setup target_configdirs based on repository Message-ID: <20210924102325.GA2435280@embecosm.com> References: <20210922153042.3491108-1-andrew.burgess@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 11:18:33 up 5 days, 1:27, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2021 10:23:32 -0000 * Richard Biener [2021-09-23 10:53:16 +0200]: > On Wed, Sep 22, 2021 at 5:47 PM Andrew Burgess > wrote: > > > > The top-level configure script is shared between the gcc repository > > and the binutils-gdb repository. > > > > The target_configdirs variable in the configure.ac script, defines > > sub-directories that contain components that should be built for the > > target using the target tools. > > > > Some components, e.g. zlib, are built as both host and target > > libraries. > > > > This causes problems for binutils-gdb. If we run 'make all' in the > > binutils-gdb repository we end up trying to build a target version of > > the zlib library, which requires the target compiler be available. > > Often the target compiler isn't immediately available, and so the > > build fails. > > > > The problem with zlib impacted a previous attempt to synchronise the > > top-level configure scripts from gcc to binutils-gdb, see this thread: > > > > https://sourceware.org/pipermail/binutils/2019-May/107094.html > > > > And I'm in the process of importing libbacktrace in to binutils-gdb, > > which is also a host and target library, and triggers the same issues. > > > > I believe that for binutils-gdb, at least at the moment, there are no > > target libraries that we need to build. > > > > My proposal then is to make the value of target_libraries change based > > on which repository we are building in. Specifically, if the source > > tree has a gcc/ directory then we should set the target_libraries > > variable, otherwise this variable is left entry. > > > > I think that if someone tries to create a single unified tree (gcc + > > binutils-gdb in a single source tree) and then build, this change will > > not have a negative impact, the tree still has gcc/ so we'd expect the > > target compiler to be built, which means building the target_libraries > > should work just fine. > > > > However, if the source tree lacks gcc/ then we assume the target > > compiler isn't built/available, and so target_libraries shouldn't be > > built. > > > > There is already precedent within configure.ac for check on the > > existence of gcc/ in the source tree, see the handling of > > -enable-werror around line 3658. > > > > I've tested a build of gcc on x86-64, and the same set of target > > libraries still seem to get built. On binutils-gdb this change > > resolves the issues with 'make all'. > > > > Any thoughts? > > Hmm, why not use make all-binutils instead? That absolutely would work, but sucks when I have to say 'make all-binutils all-gas all-ld all-gdb' when 'make all' used to work. > Otherwise this does > look like a reasonable thing to do. Thanks. I'm reworking things anyway based on Thomas's feedback. Andrew > > Richard. > > > ChangeLog: > > > > * configure: Regenerate. > > * configure.ac (target_configdirs): Only set this when building > > within the gcc repository. > > --- > > ChangeLog | 6 ++++++ > > configure | 12 ++++++++++-- > > configure.ac | 12 ++++++++++-- > > 3 files changed, 26 insertions(+), 4 deletions(-) > > > > diff --git a/configure b/configure > > index 85ab9915402..3ef5c2b553f 100755 > > --- a/configure > > +++ b/configure > > @@ -2849,9 +2849,17 @@ target_tools="target-rda" > > ## We assign ${configdirs} this way to remove all embedded newlines. This > > ## is important because configure will choke if they ever get through. > > ## ${configdirs} is directories we build using the host tools. > > -## ${target_configdirs} is directories we build using the target tools. > > +## > > +## ${target_configdirs} is directories we build using the target > > +## tools, these are only needed when working in the gcc tree. This > > +## file is also reused in the binutils-gdb tree, where building any > > +## target stuff doesn't make sense. > > configdirs=`echo ${host_libs} ${host_tools}` > > -target_configdirs=`echo ${target_libraries} ${target_tools}` > > +if test -d ${srcdir}/gcc; then > > + target_configdirs=`echo ${target_libraries} ${target_tools}` > > +else > > + target_configdirs="" > > +fi > > build_configdirs=`echo ${build_libs} ${build_tools}` > > > > > > diff --git a/configure.ac b/configure.ac > > index 1df038b04f3..d1217e3f886 100644 > > --- a/configure.ac > > +++ b/configure.ac > > @@ -180,9 +180,17 @@ target_tools="target-rda" > > ## We assign ${configdirs} this way to remove all embedded newlines. This > > ## is important because configure will choke if they ever get through. > > ## ${configdirs} is directories we build using the host tools. > > -## ${target_configdirs} is directories we build using the target tools. > > +## > > +## ${target_configdirs} is directories we build using the target > > +## tools, these are only needed when working in the gcc tree. This > > +## file is also reused in the binutils-gdb tree, where building any > > +## target stuff doesn't make sense. > > configdirs=`echo ${host_libs} ${host_tools}` > > -target_configdirs=`echo ${target_libraries} ${target_tools}` > > +if test -d ${srcdir}/gcc; then > > + target_configdirs=`echo ${target_libraries} ${target_tools}` > > +else > > + target_configdirs="" > > +fi > > build_configdirs=`echo ${build_libs} ${build_tools}` > > > > m4_divert_text([PARSE_ARGS], > > -- > > 2.25.4 > >