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]

Re: [committed, PATCH] Update PR ld/21903 tests for dejagnu 1.4.4


On Wed, Aug 23, 2017 at 04:04:37PM -0700, H.J. Lu wrote:
> Add '\' before -- to workaround dejagnu 1.4.4 which complains:
> 
> ERROR: bad switch "--no-define-common may not be used without -shared":...
> 
> 	* testsuite/ld-elf/pr21903c.d: Add '\' before --.
> 	* testsuite/ld-elf/pr21903d.d: Likewise.
> 	* testsuite/ld-elf/pr21903e.d: Likewise.

I checked in this patch to workaround another dejagnu 1.4.4 issue.


H.J.
---
Subject: [PATCH] ld: Replace regexp with string match

Replace regexp with string match to workaround dejagnu 1.4.4 which
complains:

ERROR: bad switch "-fPIE": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --

	* testsuite/ld-i386/i386.exp (undefined_weak): Replace regexp
	with string match.
	* testsuite/ld-x86-64/x86-64.exp (undefined_weak): Likewise.
---
 ld/ChangeLog                      | 6 ++++++
 ld/testsuite/ld-i386/i386.exp     | 4 ++--
 ld/testsuite/ld-x86-64/x86-64.exp | 4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6a3a35f2fc..e6d0f41c0f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,11 @@
 2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* testsuite/ld-i386/i386.exp (undefined_weak): Replace regexp
+	with string match.
+	* testsuite/ld-x86-64/x86-64.exp (undefined_weak): Likewise.
+
+2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* testsuite/ld-x86-64/x86-64.exp: Run pr22001-1b on x32.
 
 2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index c91a8611f3..c813a80551 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -468,8 +468,8 @@ proc undefined_weak {cflags ldflags} {
 	set testname "$testname ($cflags $ldflags)"
     }
 
-    if { [ regexp "\-fPIE" $cflags]
-	 && ![ regexp "\-z nodynamic-undefined-weak" $ldflags] } {
+    if { [string match "*-fPIE*" $cflags]
+	 && ![string match "*-z nodynamic-undefined-weak*" $ldflags] } {
 	set weak_symbol "Weak defined"
     } else {
 	set weak_symbol "Weak undefined"
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 7382a1bbfe..45e93b2c96 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -577,8 +577,8 @@ proc undefined_weak {cflags ldflags} {
 	set testname "$testname ($cflags $ldflags)"
     }
 
-    if { [ regexp "\-fPIE" $cflags]
-	 && ![ regexp "nodynamic-undefined-weak" $ldflags] } {
+    if { [string match "*-fPIE*" $cflags]
+	 && ![string match "*nodynamic-undefined-weak*" $ldflags] } {
 	set weak_symbol "Weak defined"
     } else {
 	set weak_symbol "Weak undefined"
-- 
2.13.5


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