From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id 3CD263858C83 for ; Tue, 15 Feb 2022 17:43:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3CD263858C83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TebE8M44NgHxcN7KMpMySkioYvrW6cN8vkKoh/+mVtc=; b=efP9YpOaf+kjeUOcypNB4dlrec 4F+tZfsYWagU9/kU7UXaCw1/PvRf03SQi3ACnaEB8q8xHkFYatKWiC8t3qHCCD+AJB4tSU80tS4Ie 01IXhdKo2jFzP9A4O9pFc57ScYn9JfRp8H2eSscSnls8Q4I98i1uB8AwXp6iOmIkOXaAOeRnSi8mJ RKZ4RrpD24/KtsGRVtcgXOA6y+8a0QMB4aGYxCqIIg9+Ho5L4U7NVCBJcWaqZny4hs+ypCrajt/OY 8RPAKhwExxCzpAYjSwxf/GGlhMcyyG0daRyD9PJOlnfDBII5TgP16jhN6x64lmiFbhUUJpejC6Mzl sCiSeBfA==; Received: from [95.87.234.74] (port=50516 helo=localhost) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nK1r9-0009dE-PO; Tue, 15 Feb 2022 19:43:18 +0200 Date: Tue, 15 Feb 2022 19:43:15 +0200 From: Dimitar Dimitrov To: Hans-Peter Nilsson Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 04/12] sim/testsuite/cris/c: Use -sim3 but only for newlib targets Message-ID: References: <20220214230255.DC76120439@pchp3.se.axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220214230255.DC76120439@pchp3.se.axis.com> X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK 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: 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: Tue, 15 Feb 2022 17:43:23 -0000 On Tue, Feb 15, 2022 at 12:02:55AM +0100, Hans-Peter Nilsson via Gdb-patches wrote: > Commit a39487c6685f "sim: cris: use -sim with C tests for cris-elf > targets" caused " -sim" to be appended to CFLAGS_FOR_TARGET for > cris*-*-elf, where testing had until then relied on > "RUNTESTFLAGS=--target_board=cris-sim" being passed when running "make > check-sim", adding the right options. While "-sim" happens to work, > the baseboard-file cris-sim.exp uses "-sim3" so for consistency use > that instead. > > Then commit b42f20d2ac72 "sim: testsuite: drop most specific istarget > checks" caused " -sim" to be appended for *all* targets, which just > doesn't work. For example, for crisv32-linux-gnu, that's not a > recognized option and will cause a dejagnu error and further testing > in c.exp will be aborted. > > While cris-sim.exp appends "-static" for *-linux-gnu, further changes > in the test-suite have caused "linux"-specific tests to break, so that > part will be tended to separately. > > But, save and restore CFLAGS_FOR_TARGET around the modification and > use where needed, to not have the CRIS-specific modification affect a > continuing test-run (possibly for other targets). > > sim/testsuite/cris: > * c/c.exp (CFLAGS_FOR_TARGET): Replace appended option " -sim" > with " -sim3", but do it conditionally for newlib targets. Save > and restore CFLAGS_FOR_TARGET in saved_CFLAGS_FOR_TARGET such > that it doesn't affect the value of CFLAGS_FOR_TARGET outside > c.exp. > --- > sim/testsuite/cris/c/c.exp | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/sim/testsuite/cris/c/c.exp b/sim/testsuite/cris/c/c.exp > index 5711fd2f0bcd..3e186e072d8e 100644 > --- a/sim/testsuite/cris/c/c.exp > +++ b/sim/testsuite/cris/c/c.exp > @@ -17,6 +17,9 @@ > > sim_init > > +global global_cc_works > +global global_cc_os Hi, FYI, this change introduces an error for "make check-sim" when configured for pru-elf target. Error is gone if I revert this commit only. Note that I don't have cross-CC in my PATH, which judging from sim_init_toolchain function in sim-defs.exp is supported. ERROR: ------------------------------------------- ERROR: in testcase /home/dinux/projects/pru/testbot-workspace/binutils/sim/testsuite/./cris/c/c.exp ERROR: can't read "global_cc_os": no such variable ERROR: tcl error code TCL LOOKUP VARNAME global_cc_os ERROR: tcl error info: can't read "global_cc_os": no such variable while executing "if { $global_cc_os == "newlib" } { append CFLAGS_FOR_TARGET " -sim3" }" (file "/home/dinux/projects/pru/testbot-workspace/binutils/sim/testsuite/./cris/c/c.exp" line 35) Regards, Dimitar > + > set CFLAGS_FOR_TARGET "-O2" > if [istarget cris-*-*] { > set mach "crisv10" > @@ -24,13 +27,16 @@ if [istarget cris-*-*] { > set mach "crisv32" > } > > -if [istarget *] { > - append CFLAGS_FOR_TARGET " -sim" > +# Make sure we're using the right runtime for simulator runs. If the > +# cris-sim dejagnu baseboard is used, -sim3 will be duplicated, but > +# that's ok. For e.g. cris*-linux-gnu, neither -sim not -sim3 are > +# supported options and likely not other targets too. > +set saved_CFLAGS_FOR_TARGET $CFLAGS_FOR_TARGET > +if { $global_cc_os == "newlib" } { > + append CFLAGS_FOR_TARGET " -sim3" > } > > # Using target_compile, since it is less noisy, > -global global_cc_works > -global global_cc_os > if { $global_cc_works == 1 } { > # Now check if we can link a program dynamically, and where > # libc.so is located. If it is, we provide a sym link to the > @@ -239,3 +245,5 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { > $status "$mach $testname" > } > } > + > +set CFLAGS_FOR_TARGET $saved_CFLAGS_FOR_TARGET > -- > 2.30.2 >