about summary refs log tree commit diff
path: root/configure
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
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')
-rwxr-xr-xconfigure8
1 files changed, 4 insertions, 4 deletions
diff --git a/configure b/configure
index eecd0ace74..5be4ff611f 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 -E '.rela?.dyn' > /dev/null; then
     libc_cv_z_combreloc=yes
   else
     libc_cv_z_combreloc=no
@@ -6120,7 +6120,7 @@ void zero (void *x)
   __builtin_memset (x, 0, 1000);
 }
 EOF
-if { ac_try='${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null'
+if { ac_try='${CC-cc} -O3 -S conftest.c -o - | grep -F "memset" > /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6152,7 +6152,7 @@ char *foo (const char *a, const char *b)
   return __builtin_strstr (a, b);
 }
 EOF
-if { ac_try='${CC-cc} -O3 -S conftest.c -o - | fgrep "my_strstr" > /dev/null'
+if { ac_try='${CC-cc} -O3 -S conftest.c -o - | grep -F "my_strstr" > /dev/null'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6511,7 +6511,7 @@ long ehdr (void) { return __ehdr_start.val; }
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  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