summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-03-12 13:16:18 -0700
committerMike Frysinger <vapier@gentoo.org>2017-03-15 13:26:13 -0700
commite37fc4aa68317bff9d3f668da1c0779d283dab51 (patch)
tree4795670a58801cf38bebd1beb3ef6dec28a0e55a /configure.ac
parentb36a65e5cadc201eb840e2b7716ae878e5c3533f (diff)
downloadglibc-e37fc4aa68317bff9d3f668da1c0779d283dab51.tar.gz
glibc-e37fc4aa68317bff9d3f668da1c0779d283dab51.tar.xz
glibc-e37fc4aa68317bff9d3f668da1c0779d283dab51.zip
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.

While there, replace fgrep with 'grep -F', as fgrep is non-POSIX.

	* configure.ac: Avoid empty subexpression in grep.

Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 5 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 4a77411b71..4981bf9691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1390,8 +1390,8 @@ dnl The following test is a bit weak.  We must use a tool which can test
 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
+dnl look for a section named .rel.dyn or .rela.dyn.
+  if $READELF -S conftest.so | grep -E '.rela?.dyn' > /dev/null; then
     libc_cv_z_combreloc=yes
   else
     libc_cv_z_combreloc=no
@@ -1586,7 +1586,7 @@ void zero (void *x)
 }
 EOF
 dnl
-if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null]);
+if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | grep -F "memset" > /dev/null]);
 then
   libc_cv_gcc_builtin_memset=no
 else
@@ -1606,7 +1606,7 @@ char *foo (const char *a, const char *b)
 }
 EOF
 dnl
-if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null]);
+if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | grep -F "my_strstr" > /dev/null]);
 then
   libc_cv_gcc_builtin_redirection=yes
 else
@@ -1747,7 +1747,7 @@ typedef struct {
 extern const Ehdr __ehdr_start __attribute__ ((visibility ("hidden")));
 long ehdr (void) { return __ehdr_start.val; }
 ])],
-	       [if $READELF -r conftest | fgrep __ehdr_start >/dev/null; then
+	       [if $READELF -r conftest | grep -F __ehdr_start >/dev/null; then
 		  libc_cv_ehdr_start=broken
 		else
 		  libc_cv_ehdr_start=yes