summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2023-04-06 08:22:27 -0500
committerZach van Rijn <me@zv.io>2023-04-06 08:22:31 -0500
commit68dacf903378d9a3f2230d26218b4928759f77b6 (patch)
tree1eb08eef550f5cd2e8552bbd4b7b4c6b13e15667
parentbd152f905f4f6d4de2f4ee11809b38cf41e2d9ab (diff)
downloadpackages-68dacf903378d9a3f2230d26218b4928759f77b6.tar.gz
packages-68dacf903378d9a3f2230d26218b4928759f77b6.tar.bz2
packages-68dacf903378d9a3f2230d26218b4928759f77b6.tar.xz
packages-68dacf903378d9a3f2230d26218b4928759f77b6.zip
system/binutils: add patch for deprecated egrep usage. fixes #978.
-rw-r--r--system/binutils/APKBUILD4
-rw-r--r--system/binutils/fix-deprecated-egrep-usage.patch273
2 files changed, 276 insertions, 1 deletions
diff --git a/system/binutils/APKBUILD b/system/binutils/APKBUILD
index 4c3bb4621..3399281d9 100644
--- a/system/binutils/APKBUILD
+++ b/system/binutils/APKBUILD
@@ -38,6 +38,7 @@ source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
CVE-2019-17451.patch
BTS-170.patch
BTS-196.patch
+ fix-deprecated-egrep-usage.patch
"
if [ "$CHOST" != "$CTARGET" ]; then
@@ -165,4 +166,5 @@ c277202272d9883741c2530a94c6d50d55dd9d0a9efaa43a1f8c9fc7529bd45e635255c0d90035df
4e8cbe3985ca4a7cb8954e4e03f094687985b3afec6bb14f1599665e0ab13e601b68cefdbb63e88f9dd59852036dcfee05af14014493c16c76dc38d406efc8fd CVE-2019-17450.patch
a71a035db5e14f105b5d58ec01ad250447f6282cae04e8c931fbdbf7adf118a065c6c9be9c72a204e0f8115b19598dc52f3953ae91200d48328b58cc274939d8 CVE-2019-17451.patch
d4543d2f77808d317d17a5f0eb9af21540ef8543fceaed4e3524213e31e058333321f3ba3b495199e3b57bfd0c4164929cf679369470389e26871b8895cb0110 BTS-170.patch
-9cc17d9fe3fc1351d1f6b4fc1c916254529f3304c95db6f4698b867eeb623210b914dc798fb837eafbad2b287b78b31c4ed5482b3151a2992864da04e1dd5fac BTS-196.patch"
+9cc17d9fe3fc1351d1f6b4fc1c916254529f3304c95db6f4698b867eeb623210b914dc798fb837eafbad2b287b78b31c4ed5482b3151a2992864da04e1dd5fac BTS-196.patch
+2a1c66a4526e9afd2db59d560f2f1d491ea0c7741978bb75f35acfd3d883408b0374a47ce1013aad7579ed838a60820ffe34ef8cdd8ba390dca3a3244220803f fix-deprecated-egrep-usage.patch"
diff --git a/system/binutils/fix-deprecated-egrep-usage.patch b/system/binutils/fix-deprecated-egrep-usage.patch
new file mode 100644
index 000000000..c661117e3
--- /dev/null
+++ b/system/binutils/fix-deprecated-egrep-usage.patch
@@ -0,0 +1,273 @@
+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 {