summaryrefslogblamecommitdiff
path: root/system/binutils/fix-deprecated-egrep-usage.patch
blob: c661117e3d2abd36ac7b053f93d687084e42c993 (plain) (tree)
















































































































































































































































































                                                                                                                                     
diff -ur a/binutils/embedspu.sh b/binutils/embedspu.sh
--- a/binutils/embedspu.sh	2023-04-06 08:16:35.123366257 -0500
+++ b/binutils/embedspu.sh	2023-04-06 08:17:09.700066333 -0500
@@ -110,7 +110,7 @@
   # Sanity check the input file
   if ! ${READELF} -h ${INFILE} | grep 'Class:.*ELF32' >/dev/null 2>/dev/null \
      || ! ${READELF} -h ${INFILE} | grep 'Type:.*EXEC' >/dev/null 2>/dev/null \
-     || ! ${READELF} -h ${INFILE} | egrep 'Machine:.*(SPU|17)' >/dev/null 2>/dev/null
+     || ! ${READELF} -h ${INFILE} | grep -E 'Machine:.*(SPU|17)' >/dev/null 2>/dev/null
   then
     echo "${INFILE}: Does not appear to be an SPU executable"
     exit 1
diff -ur a/config/lib-ld.m4 b/config/lib-ld.m4
--- a/config/lib-ld.m4	2023-04-06 08:16:35.091365610 -0500
+++ b/config/lib-ld.m4	2023-04-06 08:17:09.704066414 -0500
@@ -14,7 +14,7 @@
 AC_DEFUN([AC_LIB_PROG_LD_GNU],
 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+if $LD -v 2>&1 </dev/null | grep -E '(GNU|with BFD)' 1>&5; then
   acl_cv_prog_gnu_ld=yes
 else
   acl_cv_prog_gnu_ld=no
@@ -88,7 +88,7 @@
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | grep -E '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
 	test "$with_gnu_ld" != yes && break
diff -ur a/config.rpath b/config.rpath
--- a/config.rpath	2023-04-06 08:16:36.067385369 -0500
+++ b/config.rpath	2023-04-06 08:17:09.704066414 -0500
@@ -143,7 +143,7 @@
       ld_shlibs=no
       ;;
     beos*)
-      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | grep -E ': supported targets:.* elf' > /dev/null; then
         :
       else
         ld_shlibs=no
@@ -162,9 +162,9 @@
     netbsd*)
       ;;
     solaris* | sysv5*)
-      if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+      if $LD -v 2>&1 | grep -E 'BFD 2\.8' > /dev/null; then
         ld_shlibs=no
-      elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      elif $LD --help 2>&1 | grep -E ': supported targets:.* elf' > /dev/null; then
         :
       else
         ld_shlibs=no
@@ -174,7 +174,7 @@
       hardcode_direct=yes
       ;;
     *)
-      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | grep -E ': supported targets:.* elf' > /dev/null; then
         :
       else
         ld_shlibs=no
diff -ur a/gold/testsuite/bnd_ifunc_1.sh b/gold/testsuite/bnd_ifunc_1.sh
--- a/gold/testsuite/bnd_ifunc_1.sh	2023-04-06 08:16:36.123386503 -0500
+++ b/gold/testsuite/bnd_ifunc_1.sh	2023-04-06 08:17:09.704066414 -0500
@@ -24,13 +24,13 @@
 
 match()
 {
-  if ! egrep "$1" "$2" >/dev/null 2>&1; then
+  if ! grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "could not find '$1' in $2"
     exit 1
   fi
 }
 
 match '[0-9a-f]*:.*bnd jmpq \*0x[0-9a-f]*\(%rip\) *# [0-9a-f]* <_GLOBAL_OFFSET_TABLE_\+0x18>' bnd_ifunc_1.stdout
-APLT_ADDR=$(egrep '[0-9a-f]*:.*bnd jmpq \*0x[0-9a-f]*\(%rip\) *# [0-9a-f]* <_GLOBAL_OFFSET_TABLE_\+0x18>' bnd_ifunc_1.stdout |
+APLT_ADDR=$(grep -E '[0-9a-f]*:.*bnd jmpq \*0x[0-9a-f]*\(%rip\) *# [0-9a-f]* <_GLOBAL_OFFSET_TABLE_\+0x18>' bnd_ifunc_1.stdout |
   sed -e 's/ *\([0-9a-f]*\):.*/\1/')
 match "bnd callq $APLT_ADDR" bnd_ifunc_1.stdout
diff -ur a/gold/testsuite/bnd_ifunc_2.sh b/gold/testsuite/bnd_ifunc_2.sh
--- a/gold/testsuite/bnd_ifunc_2.sh	2023-04-06 08:16:36.139386827 -0500
+++ b/gold/testsuite/bnd_ifunc_2.sh	2023-04-06 08:17:09.708066495 -0500
@@ -24,7 +24,7 @@
 
 match()
 {
-  if ! egrep "$1" "$2" >/dev/null 2>&1; then
+  if ! grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "could not find '$1' in $2"
     exit 1
   fi
diff -ur a/gold/testsuite/bnd_plt_1.sh b/gold/testsuite/bnd_plt_1.sh
--- a/gold/testsuite/bnd_plt_1.sh	2023-04-06 08:16:36.131386665 -0500
+++ b/gold/testsuite/bnd_plt_1.sh	2023-04-06 08:17:09.708066495 -0500
@@ -24,7 +24,7 @@
 
 match()
 {
-  if ! egrep "$1" "$2" >/dev/null 2>&1; then
+  if ! grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "could not find '$1' in $2"
     exit 1
   fi
diff -ur a/gold/testsuite/discard_locals_test.sh b/gold/testsuite/discard_locals_test.sh
--- a/gold/testsuite/discard_locals_test.sh	2023-04-06 08:16:36.119386422 -0500
+++ b/gold/testsuite/discard_locals_test.sh	2023-04-06 08:17:09.708066495 -0500
@@ -32,7 +32,7 @@
     file=$1
     sym=$2
 
-    found=`egrep $sym $file`
+    found=`grep -E $sym $file`
     if test -n "$found"; then
 	echo "These local symbols are not discarded in $file:"
 	echo "$found"
@@ -45,7 +45,7 @@
     file=$1
     sym=$2
 
-    found=`egrep $sym $file`
+    found=`grep -E $sym $file`
     if test -z "$found"; then
 	echo "This local symbol is discarded in $file:"
 	echo "$2"
diff -ur a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
--- a/gold/testsuite/Makefile.am	2023-04-06 08:16:36.131386665 -0500
+++ b/gold/testsuite/Makefile.am	2023-04-06 08:17:09.712066576 -0500
@@ -1650,7 +1650,7 @@
 
 # Check there are compressed DWARF .debug_* sections.
 flagstest_compress_debug_sections.check: flagstest_compress_debug_sections
-	$(TEST_READELF) -SW $< | egrep ".debug_.* C *" > $@.tmp
+	$(TEST_READELF) -SW $< | grep -E ".debug_.* C *" > $@.tmp
 	mv -f $@.tmp $@
 
 # Compare DWARF debug info.
diff -ur a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
--- a/gold/testsuite/Makefile.in	2023-04-06 08:16:36.123386503 -0500
+++ b/gold/testsuite/Makefile.in	2023-04-06 08:17:09.720066738 -0500
@@ -8577,7 +8577,7 @@
 
 # Check there are compressed DWARF .debug_* sections.
 @GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections.check: flagstest_compress_debug_sections
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -SW $< | egrep ".debug_.* C *" > $@.tmp
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -SW $< | grep -E ".debug_.* C *" > $@.tmp
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	mv -f $@.tmp $@
 
 # Compare DWARF debug info.
diff -ur a/gold/testsuite/no_version_test.sh b/gold/testsuite/no_version_test.sh
--- a/gold/testsuite/no_version_test.sh	2023-04-06 08:16:36.119386422 -0500
+++ b/gold/testsuite/no_version_test.sh	2023-04-06 08:17:09.720066738 -0500
@@ -32,7 +32,7 @@
 {
     file=$1
 
-    found=`egrep "\.gnu\.version.*" $file`
+    found=`grep -E "\.gnu\.version.*" $file`
     if test -n "$found"; then
 	echo "These section should not be in $file:"
 	echo "$found"
diff -ur a/gold/testsuite/pr18689.sh b/gold/testsuite/pr18689.sh
--- a/gold/testsuite/pr18689.sh	2023-04-06 08:16:36.131386665 -0500
+++ b/gold/testsuite/pr18689.sh	2023-04-06 08:17:09.720066738 -0500
@@ -23,6 +23,6 @@
 
 set -e
 
-egrep -q "..debug_mac[ro|info][ ]+*" pr18689.stdout
+grep -E -q "..debug_mac[ro|info][ ]+*" pr18689.stdout
 
 exit 0
diff -ur a/gold/testsuite/split_i386.sh b/gold/testsuite/split_i386.sh
--- a/gold/testsuite/split_i386.sh	2023-04-06 08:16:36.115386341 -0500
+++ b/gold/testsuite/split_i386.sh	2023-04-06 08:17:09.724066819 -0500
@@ -24,7 +24,7 @@
 
 match()
 {
-  if ! egrep "$1" "$2" >/dev/null 2>&1; then
+  if ! grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "could not find '$1' in $2"
     exit 1
   fi
@@ -32,7 +32,7 @@
 
 nomatch()
 {
-  if egrep "$1" "$2" >/dev/null 2>&1; then
+  if grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "found unexpected '$1' in $2"
     exit 1
   fi
diff -ur a/gold/testsuite/split_s390.sh b/gold/testsuite/split_s390.sh
--- a/gold/testsuite/split_s390.sh	2023-04-06 08:16:36.115386341 -0500
+++ b/gold/testsuite/split_s390.sh	2023-04-06 08:17:09.724066819 -0500
@@ -24,7 +24,7 @@
 
 match()
 {
-  if ! egrep "$1" "$2" >/dev/null 2>&1; then
+  if ! grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "could not find '$1' in $2"
     exit 1
   fi
@@ -32,7 +32,7 @@
 
 nomatch()
 {
-  if egrep "$1" "$2" >/dev/null 2>&1; then
+  if grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "found unexpected '$1' in $2"
     exit 1
   fi
diff -ur a/gold/testsuite/split_x32.sh b/gold/testsuite/split_x32.sh
--- a/gold/testsuite/split_x32.sh	2023-04-06 08:16:36.119386422 -0500
+++ b/gold/testsuite/split_x32.sh	2023-04-06 08:17:09.724066819 -0500
@@ -25,7 +25,7 @@
 
 match()
 {
-  if ! egrep "$1" "$2" >/dev/null 2>&1; then
+  if ! grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "could not find '$1' in $2"
     exit 1
   fi
@@ -33,7 +33,7 @@
 
 nomatch()
 {
-  if egrep "$1" "$2" >/dev/null 2>&1; then
+  if grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "found unexpected '$1' in $2"
     exit 1
   fi
diff -ur a/gold/testsuite/split_x86_64.sh b/gold/testsuite/split_x86_64.sh
--- a/gold/testsuite/split_x86_64.sh	2023-04-06 08:16:36.115386341 -0500
+++ b/gold/testsuite/split_x86_64.sh	2023-04-06 08:17:09.728066900 -0500
@@ -24,7 +24,7 @@
 
 match()
 {
-  if ! egrep "$1" "$2" >/dev/null 2>&1; then
+  if ! grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "could not find '$1' in $2"
     exit 1
   fi
@@ -32,7 +32,7 @@
 
 nomatch()
 {
-  if egrep "$1" "$2" >/dev/null 2>&1; then
+  if grep -E "$1" "$2" >/dev/null 2>&1; then
     echo 1>&2 "found unexpected '$1' in $2"
     exit 1
   fi
diff -ur a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
--- a/ld/testsuite/ld-elfvers/vers.exp	2023-04-06 08:16:35.139366581 -0500
+++ b/ld/testsuite/ld-elfvers/vers.exp	2023-04-06 08:17:09.728066900 -0500
@@ -115,7 +115,7 @@
 	return
     }
 
-    set cmd "$nm --print-armap $tmpdir/$lib | grep \\\ in\\\  | egrep VERS\\\|bar\\\|foo | grep -v ^\\\\. | sort > $tmpdir/nm.out"
+    set cmd "$nm --print-armap $tmpdir/$lib | grep \\\ in\\\  | grep -E VERS\\\|bar\\\|foo | grep -v ^\\\\. | sort > $tmpdir/nm.out"
     verbose -log $cmd
     catch "exec $cmd" exec_output
     if [string match "" $exec_output] then {