This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Patch, sim: fix m68hc11 and iq2000 testsuites using dejagnu baseboard files
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: vapier at gentoo dot org
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 13 Apr 2015 02:16:18 +0200
- Subject: Re: Patch, sim: fix m68hc11 and iq2000 testsuites using dejagnu baseboard files
- Authentication-results: sourceware.org; auth=none
> From: Mike Frysinger <vapier@gentoo.org>
> 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