This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Two of gold testsuite scripts require bash [patch]


Most of the gold testsuite scripts start with "#!/bin/sh" and run fine on my platform.


The following test scripts don't specify a shell unlike the rest: * icf_safe_so_test.sh * icf_safe_test.sh icf_preemptible_functions_test.sh icf_sht_rel_addend_test.sh


Two of those scripts (asterisk) fail on my platform because they use notation specific to bash. I believe the intent is that all testsuite scripts only require the Bourne shell and therefore these two scripts have a bug. I have attached the patch I used to fix the two broken scripts. Hopefully somebody agrees and incorporates the patches or provides and alternative solution.


Regards,
John

diff --git a/gold/testsuite/icf_safe_so_test.sh b/gold/testsuite/icf_safe_so_test.sh
index 315a016..2c88250 100755
--- a/gold/testsuite/icf_safe_so_test.sh
+++ b/gold/testsuite/icf_safe_so_test.sh
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 # icf_safe_so_test.sh -- test --icf=safe
 
 # Copyright 2010 Free Software Foundation, Inc.
@@ -76,7 +78,7 @@ check_fold()
 
 arch_specific_safe_fold()
 {
-    if [ $1 == 0 ];
+    if [ $1 -eq 0 ];
     then
       check_fold $2 $3 $4
     else
diff --git a/gold/testsuite/icf_safe_test.sh b/gold/testsuite/icf_safe_test.sh
index d26d40b..74a7fb9 100755
--- a/gold/testsuite/icf_safe_test.sh
+++ b/gold/testsuite/icf_safe_test.sh
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 # icf_safe_test.sh -- test --icf=safe
 
 # Copyright 2009 Free Software Foundation, Inc.
@@ -50,7 +52,7 @@ check_fold()
 arch_specific_safe_fold()
 {
     grep_x86=`grep -q -e "Advanced Micro Devices X86-64" -e "Intel 80386" -e "ARM" $2`
-    if [ $? == 0 ];
+    if [ $? -eq 0 ];
     then
       check_fold $1 $3 $4
     else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]