From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by sourceware.org (Postfix) with ESMTPS id 04C90398601A for ; Thu, 3 Sep 2020 15:48:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04C90398601A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x442.google.com with SMTP id c18so3746081wrm.9 for ; Thu, 03 Sep 2020 08:48:46 -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=FiOqSDr9aNXgl3tp5iFM6BFauA8Wy1CTfYc6Q8uihWk=; b=Pj4xJAvGGC+JAHGP9m4MUT9gsHXPPrA0pTtYyRVp3tjKRrG2oTeHrY0n7Phb8z7v6Z lpL26BkgghPU4SXggB2w23HfENdxasRk4FftZ6QaDszWYfTxUjCQ8wB/cKeGVfEDe675 m4oSd23MIz8soykOiiqzHRj8TA1kwqVcgf0M7QJUdJFymrYaouavhm84qb5THa89Qby8 A+/lXzegBrvOzcxBFHoQe8hShTfjBqc0wL0yjIXYl/bwWlxbR1a6aPN6xmncNsA6x2zr nlNDJJZhVt7B3Zl8sswCoT+ZW3wEOb5Q9pskdZpRIT9GqBDfDcpzhgmyzPO25dtvq+tE 8k3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FiOqSDr9aNXgl3tp5iFM6BFauA8Wy1CTfYc6Q8uihWk=; b=gKNEH5w2RKKZf1DXbwMDFCXM8t2ziELSq/cRCC3HZv+h2MQ0Vk4s00zGFMOcaQsTin 3iSGRTGfNCq0upsYmzinLRGdzlKR9nYGQKNU1sIDqJC3QjQ4NB8gyyswapHP8SXkXsA6 OUzEnHQCzHbJ+ypX9d1JgTsDxTVZTzmyUm92+kldkZAYbOouMjbnmDk6LkGXWwpVhapu zHSOw+P/aCO12F+q75Sgt284TzsUUIylZj1aIl7UUPwJB+rfXvwx/55JBUdoi3ohnTQ2 aB0GIxUtsfKpDnrUU14GSEC+Y3tVcumrGd0aB7/glopRShKBzr2FEgF4A2m0OnTUHsh5 AO9w== X-Gm-Message-State: AOAM531aw2kCjcvKEcfB+CGgdMJDYzgGv3FduE1KoKV/14ODNTfGiRIg +C/LrlO+ZpytBiZsAdsJq/VsJw== X-Google-Smtp-Source: ABdhPJxpZ2vDKvxdHZrbaB2crVDy7jXrNFshSq+SQVp8NJeo1xaFK/pLBTscnhjHfk5aFN1DTxaGGQ== X-Received: by 2002:adf:f245:: with SMTP id b5mr3290999wrp.288.1599148126036; Thu, 03 Sep 2020 08:48:46 -0700 (PDT) Received: from localhost (host81-151-181-130.range81-151.btcentralplus.com. [81.151.181.130]) by smtp.gmail.com with ESMTPSA id n17sm1960195wrw.0.2020.09.03.08.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 08:48:44 -0700 (PDT) Date: Thu, 3 Sep 2020 16:48:44 +0100 From: Andrew Burgess To: "Jose E. Marchesi" Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] sim: better handle builds of primary targets lacking sims Message-ID: <20200903154844.GB853475@embecosm.com> References: <20200903133743.3323-1-jose.marchesi@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200903133743.3323-1-jose.marchesi@oracle.com> X-Operating-System: Linux/5.6.15-200.fc31.x86_64 (x86_64) X-Uptime: 16:48:06 up 47 days, 1:02, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-8.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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2020 15:48:51 -0000 * Jose E. Marchesi via Gdb-patches [2020-09-03 15:37:43 +0200]: > When building with a primary target that doesn't feature a simulator, > one would expect for nothing to be done in sim/. However, a > $(top_builddir)/sim/testsuite directory is created, with a Makefile > containing a rule like: > > check-DEJAGNU: site.exp > echo "Dejagnu-checking in `pwd` directory ..." > rootme=`pwd`; export rootme; echo rootme = $$rootme; \ > srcdir=`cd ${srcdir}; pwd`; export srcdir ; echo srcdir = $$srcdir; \ > EXPECT=${EXPECT} ; export EXPECT ; echo EXPECT = $$EXPECT; \ > if [ -f $$rootme/../../expect/expect ]; then \ > TCL_LIBRARY=`cd $$srcdir/../../tcl/library && pwd`; \ > export TCL_LIBRARY; \ > fi; \ > echo TCL_LIBRARY = $$TCL_LIBRARY; \ > runtest=$(RUNTEST); echo runtest = $$runtest; \ > if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ > $$runtest $(RUNTESTFLAGS); \ > else echo "WARNING: could not find \`runtest'" 1>&2; :;\ > fi > > Consequently, when `make check' recurses into sim/testsuite, the above > rule is executed. Until now, the desired effect (of doing nothing) > was achieved because `runtest --version' fails due to a malformed > site.exp being generated in objdir: it is malformed because the > primary target doesn't configure a $sim_arch. i.e. this was doing the > right thing just by chance. > > However, the git version of dejagnu seems to have changed in a way > runtest doesn't try to load site.exp when it gets --version. The net > effect is that the rule above tries to actually run the tests, failing > miserably. > > This little patch makes sim/configure to not recurse into > sim/testsuite if the primary target didn't configure a simulator. > > Tested with: > - A simulator target (bpf-unkonwn-none). > - A simulator-less target (x86_64-linux-gnu). > - A simulator-less target and --build-targets=all. > > sim/ChangeLog: > > 2020-09-03 Jose E. Marchesi > > * configure.ac: Do not configure sim/testsuite nor sim/igen if the > primary target doesn't have a simulator. > * configure: Regenerate. I make no claim at being a configure expect, but this looks reasonable to me, so I think go ahead and apply. Thanks, Andrew > --- > sim/ChangeLog | 6 ++++++ > sim/configure | 8 +++++--- > sim/configure.ac | 8 +++++--- > 3 files changed, 16 insertions(+), 6 deletions(-) > > diff --git a/sim/ChangeLog b/sim/ChangeLog > index 5316e24826..5f5f5b8c75 100644 > --- a/sim/ChangeLog > +++ b/sim/ChangeLog > @@ -1,3 +1,9 @@ > +2020-09-03 Jose E. Marchesi > + > + * configure.ac: Do not configure sim/testsuite nor sim/igen if the > + primary target doesn't have a simulator. > + * configure: Regenerate. > + > 2020-08-04 Jose E. Marchesi > David Faust > > diff --git a/sim/configure b/sim/configure > index 37a86f435c..34f1a15a4c 100755 > --- a/sim/configure > +++ b/sim/configure > @@ -3914,11 +3914,13 @@ subdirs="$subdirs aarch64" > esac > > > - subdirs="$subdirs testsuite" > + if test x"${sim_arch}" != x; then > + subdirs="$subdirs testsuite" > > - if test "$sim_igen" = yes; then > - subdirs="$subdirs igen" > + if test "$sim_igen" = yes; then > + subdirs="$subdirs igen" > > + fi > fi > fi > > diff --git a/sim/configure.ac b/sim/configure.ac > index 896791e97e..d92ca25d39 100644 > --- a/sim/configure.ac > +++ b/sim/configure.ac > @@ -43,9 +43,11 @@ m4_define([SIM_ARCH], [ > ]) > if test "${enable_sim}" != no; then > sinclude(configure.tgt) > - AC_CONFIG_SUBDIRS(testsuite) > - if test "$sim_igen" = yes; then > - AC_CONFIG_SUBDIRS(igen) > + if test x"${sim_arch}" != x; then > + AC_CONFIG_SUBDIRS(testsuite) > + if test "$sim_igen" = yes; then > + AC_CONFIG_SUBDIRS(igen) > + fi > fi > fi > > -- > 2.25.0.2.g232378479e >