From 55c806a360c6dcdc7e53f9b9e777d4c33589157c Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 8 Mar 2017 15:47:48 -0800 Subject: [PATCH 1/3] Correct warning text to include newer glibc versions Signed-off-by: Alexey Neyman --- scripts/build/arch/sparc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/arch/sparc.sh b/scripts/build/arch/sparc.sh index 74f6f785..b5f8140d 100644 --- a/scripts/build/arch/sparc.sh +++ b/scripts/build/arch/sparc.sh @@ -61,7 +61,7 @@ CT_DoArchGlibcAdjustTuple() { # support is reintroduced, configure as sparcv9. sparc-*) if [ "${CT_LIBC_GLIBC_2_23_or_later}" = y ]; then - CT_DoLog WARN "GLIBC 2.23 only supports SPARCv9" + CT_DoLog WARN "GLIBC 2.23 and newer only support SPARCv9" target_=${target_/#sparc-/sparcv9-} fi ;; From a61f1c5bc285f4a1a05a25e39ab67a70cac16770 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 8 Mar 2017 17:06:46 -0800 Subject: [PATCH 2/3] Check for ggrep/gegrep in configure Signed-off-by: Alexey Neyman --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index d80a5cd8..d10bf71d 100644 --- a/configure.ac +++ b/configure.ac @@ -163,6 +163,10 @@ AC_PROG_INSTALL ACX_WITH_DEPRECATED([grep], [GREP]) AC_ARG_VAR([GREP], [Specify the full path to GNU grep]) + +# This is not a typo! Prefer GNU grep on macOS if it is installed. +ACX_PATH_TOOL_REQ([GREP], [ggrep grep], [grep]) +ACX_PATH_TOOL_REQ([EGREP], [gegrep egrep], [egrep]) AC_PROG_GREP AC_PROG_EGREP AS_IF([test "$EGREP" != "$GREP -E"], From 3b658d15d320e39149e858f74d00397e76514d9f Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 8 Mar 2017 21:21:36 -0800 Subject: [PATCH 3/3] Patch failing grep expression in glibc configure Signed-off-by: Alexey Neyman --- .../140-Fix-combreloc-test-BSD-grep.patch | 44 +++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 44 +++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 44 +++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 44 +++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 44 +++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 44 +++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ .../140-Fix-combreloc-test-BSD-grep.patch | 49 +++++++++++++++++++ 17 files changed, 803 insertions(+) create mode 100644 patches/glibc/2.12.1/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.12.2/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.13/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.14.1/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.14/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.15/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.16.0/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.17/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.18/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.19/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.20/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.21/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.22/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.23/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.24/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/2.25/140-Fix-combreloc-test-BSD-grep.patch create mode 100644 patches/glibc/linaro-2.20-2014.11/140-Fix-combreloc-test-BSD-grep.patch diff --git a/patches/glibc/2.12.1/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.12.1/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..530d4ff1 --- /dev/null +++ b/patches/glibc/2.12.1/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,44 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff -urpN glibc-2.12.2.orig/configure glibc-2.12.2/configure +--- glibc-2.12.2.orig/configure 2010-12-13 02:47:26.000000000 -0800 ++++ glibc-2.12.2/configure 2017-03-08 21:18:07.000000000 -0800 +@@ -6710,7 +6710,7 @@ EOF + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff -urpN glibc-2.12.2.orig/configure.in glibc-2.12.2/configure.in +--- glibc-2.12.2.orig/configure.in 2010-12-13 02:47:26.000000000 -0800 ++++ glibc-2.12.2/configure.in 2017-03-08 21:18:17.000000000 -0800 +@@ -1671,7 +1671,7 @@ dnl cross-platform since the gcc used ca + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/patches/glibc/2.12.2/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.12.2/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..530d4ff1 --- /dev/null +++ b/patches/glibc/2.12.2/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,44 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff -urpN glibc-2.12.2.orig/configure glibc-2.12.2/configure +--- glibc-2.12.2.orig/configure 2010-12-13 02:47:26.000000000 -0800 ++++ glibc-2.12.2/configure 2017-03-08 21:18:07.000000000 -0800 +@@ -6710,7 +6710,7 @@ EOF + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff -urpN glibc-2.12.2.orig/configure.in glibc-2.12.2/configure.in +--- glibc-2.12.2.orig/configure.in 2010-12-13 02:47:26.000000000 -0800 ++++ glibc-2.12.2/configure.in 2017-03-08 21:18:17.000000000 -0800 +@@ -1671,7 +1671,7 @@ dnl cross-platform since the gcc used ca + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/patches/glibc/2.13/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.13/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..da21d9e6 --- /dev/null +++ b/patches/glibc/2.13/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,44 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff -urpN glibc-2.13.orig/configure glibc-2.13/configure +--- glibc-2.13.orig/configure 2011-01-17 20:34:07.000000000 -0800 ++++ glibc-2.13/configure 2017-03-08 21:11:09.000000000 -0800 +@@ -6504,7 +6504,7 @@ EOF + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff -urpN glibc-2.13.orig/configure.in glibc-2.13/configure.in +--- glibc-2.13.orig/configure.in 2011-01-17 20:34:07.000000000 -0800 ++++ glibc-2.13/configure.in 2017-03-08 21:11:22.000000000 -0800 +@@ -1673,7 +1673,7 @@ dnl cross-platform since the gcc used ca + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/patches/glibc/2.14.1/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.14.1/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..d720d391 --- /dev/null +++ b/patches/glibc/2.14.1/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,44 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff -urpN glibc-2.14.1.orig/configure glibc-2.14.1/configure +--- glibc-2.14.1.orig/configure 2011-10-07 02:48:55.000000000 -0700 ++++ glibc-2.14.1/configure 2017-03-08 21:06:36.000000000 -0800 +@@ -6377,7 +6377,7 @@ EOF + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff -urpN glibc-2.14.1.orig/configure.in glibc-2.14.1/configure.in +--- glibc-2.14.1.orig/configure.in 2011-10-07 02:48:55.000000000 -0700 ++++ glibc-2.14.1/configure.in 2017-03-08 21:06:50.000000000 -0800 +@@ -1655,7 +1655,7 @@ dnl cross-platform since the gcc used ca + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/patches/glibc/2.14/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.14/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..d720d391 --- /dev/null +++ b/patches/glibc/2.14/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,44 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff -urpN glibc-2.14.1.orig/configure glibc-2.14.1/configure +--- glibc-2.14.1.orig/configure 2011-10-07 02:48:55.000000000 -0700 ++++ glibc-2.14.1/configure 2017-03-08 21:06:36.000000000 -0800 +@@ -6377,7 +6377,7 @@ EOF + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff -urpN glibc-2.14.1.orig/configure.in glibc-2.14.1/configure.in +--- glibc-2.14.1.orig/configure.in 2011-10-07 02:48:55.000000000 -0700 ++++ glibc-2.14.1/configure.in 2017-03-08 21:06:50.000000000 -0800 +@@ -1655,7 +1655,7 @@ dnl cross-platform since the gcc used ca + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if readelf -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/patches/glibc/2.15/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.15/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..c36cdf43 --- /dev/null +++ b/patches/glibc/2.15/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,44 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff -urpN glibc-2.15.orig/configure glibc-2.15/configure +--- glibc-2.15.orig/configure 2012-03-19 07:56:58.000000000 -0700 ++++ glibc-2.15/configure 2017-03-08 21:02:21.000000000 -0800 +@@ -6566,7 +6566,7 @@ EOF + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff -urpN glibc-2.15.orig/configure.in glibc-2.15/configure.in +--- glibc-2.15.orig/configure.in 2012-01-01 04:16:32.000000000 -0800 ++++ glibc-2.15/configure.in 2017-03-08 21:01:54.000000000 -0800 +@@ -1716,7 +1716,7 @@ dnl cross-platform since the gcc used ca + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no diff --git a/patches/glibc/2.16.0/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.16.0/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..3c34e01d --- /dev/null +++ b/patches/glibc/2.16.0/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.in ++++ b/configure.in +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.17/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.17/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..3c34e01d --- /dev/null +++ b/patches/glibc/2.17/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.in ++++ b/configure.in +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.18/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.18/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..3c34e01d --- /dev/null +++ b/patches/glibc/2.18/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.in ++++ b/configure.in +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.19/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.19/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/2.19/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.20/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.20/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/2.20/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.21/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.21/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/2.21/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.22/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.22/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/2.22/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.23/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.23/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/2.23/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.24/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.24/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/2.24/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/2.25/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/2.25/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/2.25/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 + diff --git a/patches/glibc/linaro-2.20-2014.11/140-Fix-combreloc-test-BSD-grep.patch b/patches/glibc/linaro-2.20-2014.11/140-Fix-combreloc-test-BSD-grep.patch new file mode 100644 index 00000000..fdc3a606 --- /dev/null +++ b/patches/glibc/linaro-2.20-2014.11/140-Fix-combreloc-test-BSD-grep.patch @@ -0,0 +1,49 @@ +From 61d5f9c09b3157db76bd1a393e248c262a8d9dd4 Mon Sep 17 00:00:00 2001 +From: Alexey Neyman +Date: Wed, 8 Mar 2017 14:31:10 -0800 +Subject: [PATCH] Fix combreloc test with BSD grep + +The test for "-z combreloc" fails when cross-compiling on a machine +that uses BSD grep (e.g. on macos). grep complains about empty +subexpression and exits with non-zero status, which is interpreted +by configure as "not found". As a result, support for "-z combreloc" +(HAVE_Z_COMBRELOC) is not detected, leading to link failure on SPARC. + + * configure.ac: Avoid empty subexpression in grep. + +Signed-off-by: Alexey Neyman +--- + ChangeLog | 5 +++++ + configure | 2 +- + configure.ac | 2 +- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index eecd0ac..0118bd1 100755 +--- a/configure ++++ b/configure +@@ -5804,7 +5804,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +diff --git a/configure.ac b/configure.ac +index 4a77411..19f6d87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1391,7 +1391,7 @@ dnl cross-platform since the gcc used can be a cross compiler. Without + dnl introducing new options this is not easily doable. Instead use a tool + dnl which always is cross-platform: readelf. To detect whether -z combreloc + dnl look for a section named .rel.dyn. +- if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then ++ if $READELF -S conftest.so | grep '\.\(rel\|rela\)\.dyn' > /dev/null; then + libc_cv_z_combreloc=yes + else + libc_cv_z_combreloc=no +-- +2.9.3 +