From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id D64B63858405 for ; Mon, 27 Sep 2021 07:51:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D64B63858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: Ckc1HGx+90/uWi+b7RCNFfeWvlBJHAs2DNeLdS20i/ALrJQvBTsWB9CbtDjG1yEa4MdRyZ7yB1 lE/6+FBSE3yIvtwp1k6TAvlfkKRmCvTeAQ3wA2i/816vIn+h6G0UpNhgOwr0xEs+7sdypiMsXt tTwdLrckhyxnxQzik2ZcRJtEWBrCeP9X4W6G98sjU9gRf2PuO/F81qXRZTtCecbLulLyOVQKSe iWhZlz1olll8xbgtr/3lsnyg4L5PQJkWT42YH5pquWesGbjEjlpg01gUZ7Ou5B3eumynQfMtpg ZehPG3J1nc/mlZ743QOjXOF2 X-IronPort-AV: E=Sophos;i="5.85,325,1624348800"; d="scan'208";a="68866040" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 26 Sep 2021 23:51:05 -0800 IronPort-SDR: DFy6Vgz/QI/vfnIgHYdRuzn9VPItSj4asysrV7uez8xKFCNybQxIsJPAb0EjW0U0xGj/X8SnpD TzH4gVFNPocGvQoKrtedAe/hnlLA4nsd3bI7+LK6nDjAu5u4RD61oBF5tM8vpftQyqVAqCeVvr 85yChcaRLqPRR/Qt/M5hOgm+MwBzBgb/2YYDVpV/XgtZ89k/dyXuXYqNWHnuaoi8zANtu57Fjp eIZ7vyzpbcByJJfLHNt6ela98BejaqhbykRjLlIveTvgX3zKMJl3ARBpwbeDZZ8OB897bPVsVC Szo= From: Thomas Schwinge To: Andrew Burgess , Subject: Re: [PATCHv2] top-level configure: setup target_configdirs based on repository In-Reply-To: <20210924103434.GB2435280@embecosm.com> References: <20210922153042.3491108-1-andrew.burgess@embecosm.com> <87tuibskri.fsf@euler.schwinge.homeip.net> <20210924103434.GB2435280@embecosm.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Mon, 27 Sep 2021 09:50:57 +0200 Message-ID: <87ee9asbha.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: Mon, 27 Sep 2021 07:51:10 -0000 Hi! On 2021-09-24T11:34:34+0100, Andrew Burgess w= rote: > The V2 patch below: > > - Moves the check for gcc/ to much later in the configure script, > after we've finished building target_configdirs, > > - Makes use of skipdirs to avoid building anything from > target_configdirs if we're not also building gcc. Thanks, that looks better in line with how that script generally appears to work (... per my not-in-depth understanding). (But I can't formally approve.) Reviewed-by: Thomas Schwinge Gr=C3=BC=C3=9Fe Thomas > commit 84c8b7f1605c8f2840d3c857a4d86abc7dde0668 > Author: Andrew Burgess > Date: Wed Sep 22 15:15:41 2021 +0100 > > top-level configure: setup target_configdirs based on repository > > 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. > > In the configure script we build three lists of things we want to > build, $configdirs, $build_configdirs, and $target_configdirs, we als= o > build two lists of things we don't want to build, $skipdirs and > $noconfigdirs. We then remove anything that is in the lists of thing= s > not to build, from the list of things that should be built. > > My proposal is to add everything in target_configdirs into skipdirs, > if the source tree doesn't contain a gcc/ sub-directory. The result > is that for binutils-gdb no target tools or libraries will be built, > while for the gcc repository, nothing should change. > > If a user builds a unified source tree, then the target tools and > libraries should still be built as the gcc/ directory will be present= . > > 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'. > > ChangeLog: > > * configure: Regenerate. > * configure.ac (skipdirs): Add the contents of target_configd= irs if > we are not building gcc. > > diff --git a/configure b/configure > index 85ab9915402..785498efff5 100755 > --- a/configure > +++ b/configure > @@ -8874,6 +8874,16 @@ case ,${enable_languages}, in > ;; > esac > > +# If gcc/ is not in the source tree then we'll not be building a > +# target compiler, assume in that case we don't want to build any > +# target libraries or tools. > +# > +# This was added primarily for the benefit for binutils-gdb who reuse > +# this configure script, but don't always have target tools available. > +if test ! -d ${srcdir}/gcc; then > + skipdirs=3D"${skipdirs} ${target_configdirs}" > +fi > + > # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, > # $build_configdirs and $target_configdirs. > # If we have the source for $noconfigdirs entries, add them to $notsupp. > diff --git a/configure.ac b/configure.ac > index 1df038b04f3..c523083c346 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -2272,6 +2272,16 @@ case ,${enable_languages}, in > ;; > esac > > +# If gcc/ is not in the source tree then we'll not be building a > +# target compiler, assume in that case we don't want to build any > +# target libraries or tools. > +# > +# This was added primarily for the benefit for binutils-gdb who reuse > +# this configure script, but don't always have target tools available. > +if test ! -d ${srcdir}/gcc; then > + skipdirs=3D"${skipdirs} ${target_configdirs}" > +fi > + > # Remove the entries in $skipdirs and $noconfigdirs from $configdirs, > # $build_configdirs and $target_configdirs. > # If we have the source for $noconfigdirs entries, add them to $notsupp. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955