ld: Replace regexp with string match
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 24 Aug 2017 15:33:16 +0000 (08:33 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 24 Aug 2017 15:33:16 +0000 (08:33 -0700)
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
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-x86-64/x86-64.exp

index 6a3a35f2fc99875a26c8e75b88a671673c1964f6..e6d0f41c0f94f3becac9095005d668e113bbd659 100644 (file)
@@ -1,3 +1,9 @@
+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.
index c91a8611f374c6bd7a9ec2e0a5486b43402be83b..c813a80551a4c9a852b7fc92a8e1ad314dc01c9f 100644 (file)
@@ -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"
index 7382a1bbfe61f9845a9fe390a4695880c7e1f224..45e93b2c96bcf3864db68e4ef83f3fe8265146ca 100644 (file)
@@ -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"