From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79806 invoked by alias); 13 Apr 2015 00:16:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 79794 invoked by uid 89); 13 Apr 2015 00:16:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: bes.se.axis.com Received: from bes.se.axis.com (HELO bes.se.axis.com) (195.60.68.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Apr 2015 00:16:22 +0000 Received: from localhost (localhost [127.0.0.1]) by bes.se.axis.com (Postfix) with ESMTP id 06A8E2E10A; Mon, 13 Apr 2015 02:16:20 +0200 (CEST) Received: from bes.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bes.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id 64atkueU990D; Mon, 13 Apr 2015 02:16:19 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bes.se.axis.com (Postfix) with ESMTP id 12F1B2E108; Mon, 13 Apr 2015 02:16:19 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id E49761213; Mon, 13 Apr 2015 02:16:18 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by boulder.se.axis.com (Postfix) with ESMTP id CEAF9FC0; Mon, 13 Apr 2015 02:16:18 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id CBFDE3E049; Mon, 13 Apr 2015 02:16:18 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id t3D0GIBc032417; Mon, 13 Apr 2015 02:16:18 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id t3D0GI9A032410; Mon, 13 Apr 2015 02:16:18 +0200 Date: Mon, 13 Apr 2015 00:16:00 -0000 Message-Id: <201504130016.t3D0GI9A032410@ignucius.se.axis.com> From: Hans-Peter Nilsson To: vapier@gentoo.org CC: gdb-patches@sourceware.org In-reply-to: <20150412082145.GG16816@vapier> (message from Mike Frysinger on Sun, 12 Apr 2015 10:21:45 +0200) Subject: Re: Patch, sim: fix m68hc11 and iq2000 testsuites using dejagnu baseboard files MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-SW-Source: 2015-04/txt/msg00441.txt.bz2 > From: Mike Frysinger > Date: Sun, 12 Apr 2015 10:21:45 +0200 > On 07 Apr 2015 05:59, Hans-Peter Nilsson wrote: > > And that's what I referred to as the "too smart" alternative of > > moving it do run_sim_test (I did have a quick look). Better > > keep it target-specific, as it's the specific target board file > > that's "broken" (besides the "-Wl,"-stripping). If those > > targets change in level of activity, I expect the ldscript > > business to be fixed too. > > the sim is not board specific, nor does the testsuite (generally) care about the > C library. it certainly is not a test ground for making sure newlib/libgloss > itself is bug free (that's what testsuites in those projects are for). that > leads me to the opinion that board-specific linkage information does not make > sense in the sim so we should simply clear it for all targets. in fact, we want > the sim to be board agnostic (ignoring the model support, and tests that > exercise those models directly, but is still orthogonal to dejagnu setup). Maybe, maybe not. If a simulator needs a specific linker-script to work with a specific linker, it should have a means to specify that without colliding with workarounds for wrong assumptions and ldscript settings for certain *other* targets. Anyway, I found a "less smart" alternative than to push this into run_sim_test; add it to the sim_init proc. (duh :) After checking that it indeed works, this is what I just checked in. Though, I didn't check that a target *can* set its own ldscript variable to override this; if the need arises, we'll have to revisit and move this to just the targets that have broken board files. (N.B. this is *ldscript*; there is a separate *ldflags*.) sim/testsuite: * sim-defs.exp (sim_init): Unset target ldscript here. sim/testsuite/sim/mips: * basic.exp: Don't unset target ldscript here. diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp index fb2346a..2faf5dc 100644 --- a/sim/testsuite/lib/sim-defs.exp +++ b/sim/testsuite/lib/sim-defs.exp @@ -12,6 +12,16 @@ proc sim_init { args } { global sim_path set sim_path [board_info target sim] # Need to return an empty string (copied from GAS). + + # As gross as it is, we unset the linker script specified by the target + # board. The simulator board file mips-sim.exp, sets ldscript to the + # MIPS libgloss linker scripts which include libgcc (and possibly other + # libraries), which the linker (used to link these tests rather than the + # compiler) can't necessarily find. Similarly iq2000-sim.exp and + # m68hc11-sim.exp. So, we make it a common rule to clear the slate for + # all simulators. + unset_currtarget_info ldscript + return "" } diff --git a/sim/testsuite/sim/mips/basic.exp b/sim/testsuite/sim/mips/basic.exp index 1c78c87..ddef535 100644 --- a/sim/testsuite/sim/mips/basic.exp +++ b/sim/testsuite/sim/mips/basic.exp @@ -1,11 +1,5 @@ # MIPS simulator instruction tests -# As gross as it is, we unset the linker script specified by the target -# board. The MIPS libgloss linker scripts include libgcc (and possibly -# other libraries), which the linker (used to link these tests rather -# than the compiler) can't necessarily find. -unset_currtarget_info ldscript - # Do "run_sim_test TESTFILE MODELS" for each combination of the # mf{lo,hi} -> mult/div/mt{lo,hi} hazard described in mips.igen. # Insert NOPS nops after the mflo or mfhi. brgds, H-P