public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Fix cc-with-tweaks.sh being executed in the wrong shell
@ 2018-04-26 19:35 Simon Marchi
  2018-06-20 16:47 ` Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2018-04-26 19:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

The cc-with-tweaks.sh script needs to be executed with bash.  When
trying to run this:

  make check RUNTESTFLAGS="--target_board=dwarf4-gdb-index" TESTS="gdb.base/return.exp"

I get:

  gdb compile failed, /home/emaisin/src/binutils-gdb/gdb/contrib/cc-with-tweaks.sh: 174: /home/emaisin/src/binutils-gdb/gdb/contrib/cc-with-tweaks.sh: Bad substitution

The reason is that the board files execute cc-with-tweaks.sh using
/bin/sh, which points to dash on my machine.  Remove the /bin/sh part
and let the shebang choose the right interpreter.

gdb/testsuite/ChangeLog:

	* boards/cc-with-tweaks.exp: Don't call cc-with-tweaks.sh
	through /bin/sh.
	* boards/dwarf4-gdb-index.exp: Likewise.
	* boards/fission-dwp.exp: Likewise.
---
 gdb/testsuite/boards/cc-with-tweaks.exp   | 4 ++--
 gdb/testsuite/boards/dwarf4-gdb-index.exp | 4 ++--
 gdb/testsuite/boards/fission-dwp.exp      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/boards/cc-with-tweaks.exp b/gdb/testsuite/boards/cc-with-tweaks.exp
index 7f94142..1758e24 100644
--- a/gdb/testsuite/boards/cc-with-tweaks.exp
+++ b/gdb/testsuite/boards/cc-with-tweaks.exp
@@ -44,8 +44,8 @@ set contrib_dir [file normalize $srcdir/../contrib]
 if ![info exists CC_FOR_TARGET] {
     set CC_FOR_TARGET "$found_gcc"
 }
-set CC_FOR_TARGET "/bin/sh $contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $CC_FOR_TARGET"
+set CC_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $CC_FOR_TARGET"
 if ![info exists CXX_FOR_TARGET] {
     set CXX_FOR_TARGET "$found_gxx"
 }
-set CXX_FOR_TARGET "/bin/sh $contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $CXX_FOR_TARGET"
+set CXX_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $CXX_FOR_TARGET"
diff --git a/gdb/testsuite/boards/dwarf4-gdb-index.exp b/gdb/testsuite/boards/dwarf4-gdb-index.exp
index 81bffbd..6e02141 100644
--- a/gdb/testsuite/boards/dwarf4-gdb-index.exp
+++ b/gdb/testsuite/boards/dwarf4-gdb-index.exp
@@ -36,8 +36,8 @@ set contrib_dir [file normalize $srcdir/../contrib]
 if ![info exists CC_FOR_TARGET] {
     set CC_FOR_TARGET "$found_gcc"
 }
-set CC_FOR_TARGET "/bin/sh $contrib_dir/cc-with-tweaks.sh -i $CC_FOR_TARGET"
+set CC_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh -i $CC_FOR_TARGET"
 if ![info exists CXX_FOR_TARGET] {
     set CXX_FOR_TARGET "$found_gxx"
 }
-set CXX_FOR_TARGET "/bin/sh $contrib_dir/cc-with-tweaks.sh -i $CXX_FOR_TARGET"
+set CXX_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh -i $CXX_FOR_TARGET"
diff --git a/gdb/testsuite/boards/fission-dwp.exp b/gdb/testsuite/boards/fission-dwp.exp
index 0414981..82a0253 100644
--- a/gdb/testsuite/boards/fission-dwp.exp
+++ b/gdb/testsuite/boards/fission-dwp.exp
@@ -30,11 +30,11 @@ set contrib_dir [file normalize $srcdir/../contrib]
 if ![info exists CC_FOR_TARGET] {
     set CC_FOR_TARGET "$found_gcc"
 }
-set CC_FOR_TARGET "/bin/sh $contrib_dir/cc-with-tweaks.sh -p $CC_FOR_TARGET"
+set CC_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh -p $CC_FOR_TARGET"
 if ![info exists CXX_FOR_TARGET] {
     set CXX_FOR_TARGET "$found_gxx"
 }
-set CXX_FOR_TARGET "/bin/sh $contrib_dir/cc-with-tweaks.sh -p $CXX_FOR_TARGET"
+set CXX_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh -p $CXX_FOR_TARGET"
 
 if ![info exists READELF_FOR_TARGET] {
     set READELF_FOR_TARGET "[transform readelf]"
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: Fix cc-with-tweaks.sh being executed in the wrong shell
  2018-04-26 19:35 [PATCH] testsuite: Fix cc-with-tweaks.sh being executed in the wrong shell Simon Marchi
@ 2018-06-20 16:47 ` Simon Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2018-06-20 16:47 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

On 2018-04-26 15:34, Simon Marchi wrote:
> The cc-with-tweaks.sh script needs to be executed with bash.  When
> trying to run this:
> 
>   make check RUNTESTFLAGS="--target_board=dwarf4-gdb-index"
> TESTS="gdb.base/return.exp"
> 
> I get:
> 
>   gdb compile failed,
> /home/emaisin/src/binutils-gdb/gdb/contrib/cc-with-tweaks.sh: 174:
> /home/emaisin/src/binutils-gdb/gdb/contrib/cc-with-tweaks.sh: Bad
> substitution
> 
> The reason is that the board files execute cc-with-tweaks.sh using
> /bin/sh, which points to dash on my machine.  Remove the /bin/sh part
> and let the shebang choose the right interpreter.

I pushed this.

Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-20 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 19:35 [PATCH] testsuite: Fix cc-with-tweaks.sh being executed in the wrong shell Simon Marchi
2018-06-20 16:47 ` Simon Marchi

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).