From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by sourceware.org (Postfix) with ESMTPS id 1F2C0386102B for ; Thu, 3 Sep 2020 13:37:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1F2C0386102B Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 083DYmBC159902 for ; Thu, 3 Sep 2020 13:37:48 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 337eymgq8n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 03 Sep 2020 13:37:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 083DZHoW025997 for ; Thu, 3 Sep 2020 13:37:48 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 3380krspsf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 03 Sep 2020 13:37:48 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 083Dblj7002095 for ; Thu, 3 Sep 2020 13:37:47 GMT Received: from termi.localdomain (/10.175.30.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 03 Sep 2020 06:37:47 -0700 From: "Jose E. Marchesi" To: gdb-patches@sourceware.org Subject: [PATCH] sim: better handle builds of primary targets lacking sims Date: Thu, 3 Sep 2020 15:37:43 +0200 Message-Id: <20200903133743.3323-1-jose.marchesi@oracle.com> X-Mailer: git-send-email 2.25.0.2.g232378479e MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9732 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=1 malwarescore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009030126 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9732 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 adultscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 bulkscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009030126 X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY 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 13:37:50 -0000 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. --- 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