* [PATCH] sim: testsuite: replace global_ld_options with LDFLAGS_FOR_TARGET
@ 2021-11-27 0:15 Mike Frysinger
0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-27 0:15 UTC (permalink / raw)
To: gdb-patches
Only a few tests actually use global_ld_options, but we can replace the
sim-specific settings with the dejagnu common LDFLAGS_FOR_TARGET and get
the same result.
---
sim/testsuite/bpf/allinsn.exp | 6 ++----
sim/testsuite/cris/hw/rv-n-cris/rvc.exp | 17 +++--------------
sim/testsuite/example-synacor/allinsn.exp | 5 +++--
sim/testsuite/lib/sim-defs.exp | 8 ++------
sim/testsuite/or1k/alltests.exp | 4 ++--
sim/testsuite/sh/allinsn.exp | 4 ++--
6 files changed, 14 insertions(+), 30 deletions(-)
diff --git a/sim/testsuite/bpf/allinsn.exp b/sim/testsuite/bpf/allinsn.exp
index 2cca77021afe..c138bb8f18aa 100644
--- a/sim/testsuite/bpf/allinsn.exp
+++ b/sim/testsuite/bpf/allinsn.exp
@@ -9,10 +9,8 @@ if [istarget bpf-unknown-none] {
set global_sim_options "--memory-size=4Mb"
}
- global global_ld_options
- if ![info exists global_ld_options] {
- set global_ld_options "-Ttext=0x0"
- }
+ global LDFLAGS_FOR_TARGET
+ set LDFLAGS_FOR_TARGET "-Ttext=0x0"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
# If we're only testing specific files and this isn't one of them,
diff --git a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
index 908d56ab92d9..82033634e936 100644
--- a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
+++ b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
@@ -21,7 +21,6 @@
proc sim_has_rv_and_cris {} {
global srcdir
global subdir
- global global_ld_options
global global_sim_options
# We need to assemble and link a trivial program and pass that, in
@@ -31,9 +30,6 @@ proc sim_has_rv_and_cris {} {
# what we want to do it to run the simulator without affecting the
# PASS/FAIL counters, and we can use e.g. run_sim_test for that.
- if ![info exists global_ld_options] {
- set global_ld_options ""
- }
if ![info exists global_sim_options] {
set global_sim_options ""
}
@@ -47,7 +43,7 @@ proc sim_has_rv_and_cris {} {
return 0
}
- set comp_output [target_link quit.o quit.x "$global_ld_options"]
+ set comp_output [target_link quit.o quit.x ""]
if ![string match "" $comp_output] {
verbose -log "$comp_output" 3
@@ -114,12 +110,11 @@ proc slurp_rv { file } {
if [istarget cris*-*-*] {
global ASFLAGS_FOR_TARGET
+ global LDFLAGS_FOR_TARGET
set has_rv_and_cris [sim_has_rv_and_cris]
- global global_ld_options
global global_sim_options
set saved_global_sim_options $global_sim_options
- set saved_global_ld_options $global_ld_options
# See the logic in sim-defs.exp for more details.
set sim [board_info target sim]
@@ -162,7 +157,7 @@ if [istarget cris*-*-*] {
}
set sim_defaults "--hw-file $srcdir/$subdir/std.dev"
- set ld_defaults "--section-start=.text=0"
+ set LDFLAGS_FOR_TARGET "--section-start=.text=0"
# We parse options an extra time besides in run_sim_test,
# to determine if our defaults should be overridden.
@@ -178,10 +173,6 @@ if [istarget cris*-*-*] {
if { $opt_name == "sim" && $opt_machs == "" } {
set sim_defaults ""
}
-
- if { $opt_name == "ld" && $opt_machs == "" } {
- set ld_defaults ""
- }
}
set rvdummy_id -1
@@ -220,10 +211,8 @@ if [istarget cris*-*-*] {
# Unfortunately this seems like the only way to pass
# additional sim, ld etc. options to run_sim_test.
set global_sim_options "$saved_global_sim_options $sim_defaults"
- set global_ld_options "$saved_global_ld_options $ld_defaults"
run_sim_test $src $mach
set global_sim_options $saved_global_sim_options
- set global_ld_options $saved_global_ld_options
# Stop the rvdummy, if it's still running. We need to
# wait on it anyway to avoid it turning into a zombie.
diff --git a/sim/testsuite/example-synacor/allinsn.exp b/sim/testsuite/example-synacor/allinsn.exp
index 0f8d856ed0a5..4c8f653ad726 100644
--- a/sim/testsuite/example-synacor/allinsn.exp
+++ b/sim/testsuite/example-synacor/allinsn.exp
@@ -4,7 +4,8 @@ if [istarget *] {
# All machines.
set all_machs "example"
- set global_ld_options "-Ttext=0"
+ global LDFLAGS_FOR_TARGET
+ set LDFLAGS_FOR_TARGET "-Ttext=0"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
# If we're only testing specific files and this isn't one of them,
@@ -15,5 +16,5 @@ if [istarget *] {
run_sim_test $src $all_machs
}
- unset global_ld_options
+ unset LDFLAGS_FOR_TARGET
}
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 68fe2ef3324a..a9431fc46090 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -185,7 +185,6 @@ proc run_sim_test { name requested_machs } {
global opts
global cpu_option
global cpu_option_sep
- global global_ld_options
global global_sim_options
if ![file exists [sim_tool_path]] {
@@ -220,9 +219,6 @@ proc run_sim_test { name requested_machs } {
set opts(kfail) ""
set seen_output 0
- if ![info exists global_ld_options] {
- set global_ld_options ""
- }
if ![info exists global_sim_options] {
set global_sim_options ""
}
@@ -325,7 +321,7 @@ proc run_sim_test { name requested_machs } {
if ![info exists opts(ld,$mach)] {
set opts(ld,$mach) $opts(ld)
}
- regsub {(^ *| +)([^ ]+)} "$opts(ld,$mach) $global_ld_options" { -Wl,\2} c_ld_options
+ regsub {(^ *| +)([^ ]+)} "$opts(ld,$mach)" { -Wl,\2} c_ld_options
if ![info exists opts(cc,$mach)] {
set opts(cc,$mach) $opts(cc)
@@ -351,7 +347,7 @@ proc run_sim_test { name requested_machs } {
continue
}
- set comp_output [target_link ${name}.o ${name}.x "$opts(ld,$mach) $global_ld_options"]
+ set comp_output [target_link ${name}.o ${name}.x "$opts(ld,$mach)"]
set method "linking"
}
diff --git a/sim/testsuite/or1k/alltests.exp b/sim/testsuite/or1k/alltests.exp
index 365f3910debf..701cca6ec643 100644
--- a/sim/testsuite/or1k/alltests.exp
+++ b/sim/testsuite/or1k/alltests.exp
@@ -18,8 +18,8 @@
if [istarget or1k*-*-*] {
set all_machs "or1k"
- global global_ld_options
- set global_ld_options "-T $srcdir/$subdir/or1k-test.ld"
+ global LDFLAGS_FOR_TARGET
+ set LDFLAGS_FOR_TARGET "-T $srcdir/$subdir/or1k-test.ld"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.S]] {
diff --git a/sim/testsuite/sh/allinsn.exp b/sim/testsuite/sh/allinsn.exp
index 233cd9a6ff99..05a28e007422 100644
--- a/sim/testsuite/sh/allinsn.exp
+++ b/sim/testsuite/sh/allinsn.exp
@@ -3,12 +3,12 @@
set all_machs "sh shdsp"
global ASFLAGS_FOR_TARGET
-set global_ld_options ""
+global LDFLAGS_FOR_TARGET
foreach opt $board_variant_list {
switch "x$opt" {
x-ml { set ASFLAGS_FOR_TARGET "-little --defsym LITTLE=1"
- set global_ld_options "-EL" }
+ set LDFLAGS_FOR_TARGET "-EL" }
}
}
--
2.33.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-27 0:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 0:15 [PATCH] sim: testsuite: replace global_ld_options with LDFLAGS_FOR_TARGET Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).