Use tool-prefixed readelf. --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,7 @@ fi # We really want build-ids. Warn and force generating them if gcc was # configure without --enable-linker-build-id AC_CACHE_CHECK([whether the compiler generates build-ids], ac_cv_buildid, [dnl -AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; readelf -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))]) +AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))]) if test "$ac_cv_buildid" = "no"; then AC_MSG_WARN([compiler doesn't generate build-id by default]) LDFLAGS="$LDFLAGS -Wl,--build-id" --- a/configure +++ b/configure @@ -5343,7 +5343,7 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_buildid=yes; readelf -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no + ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}