[v2,3/7] libbacktrace: use grep instead of fgrep
Commit Message
fgrep has been deprecated in favor of grep -F for a long time, and the
next grep release (3.8 or 4.0) will print a warning of fgrep is used.
But, we can't simply replace fgrep to grep -F, or the build will break
with some non-GNU grep implementations (lacking -F support).
As "add-gnu-debuglink" is definitely not a non-trivial regex, simply
replace fgrep with grep.
libbacktrace/ChangeLog:
* configure.ac (AC_PROG_FGREP): Use grep instead of fgrep.
* configure: Regenerate.
---
libbacktrace/configure | 2 +-
libbacktrace/configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Mon, 27 Jun 2022 at 07:09, Xi Ruoyao wrote:
>
> fgrep has been deprecated in favor of grep -F for a long time, and the
> next grep release (3.8 or 4.0) will print a warning of fgrep is used.
> But, we can't simply replace fgrep to grep -F, or the build will break
> with some non-GNU grep implementations (lacking -F support).
>
> As "add-gnu-debuglink" is definitely not a non-trivial regex, simply
> replace fgrep with grep.
FWIW, GNU grep will be just as fast when using grep as fgrep in this
case, because it detects that the pattern is a fixed string that
contains no special characters and automatically uses the same
matching engine as fgrep. So for GNU grep, there's no downside to this
change.
On Sun, Jun 26, 2022 at 11:10 PM Xi Ruoyao via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> libbacktrace/ChangeLog:
>
> * configure.ac (AC_PROG_FGREP): Use grep instead of fgrep.
> * configure: Regenerate.
Thanks. Committed to mainline.
Ian
@@ -13831,7 +13831,7 @@ else
libbacktrace_cv_objcopy_debuglink=no
elif ! test -n "${OBJCOPY}"; then
libbacktrace_cv_objcopy_debuglink=no
-elif ${OBJCOPY} --help | fgrep add-gnu-debuglink >/dev/null 2>&1; then
+elif ${OBJCOPY} --help | grep add-gnu-debuglink >/dev/null 2>&1; then
libbacktrace_cv_objcopy_debuglink=yes
else
libbacktrace_cv_objcopy_debuglink=no
@@ -500,7 +500,7 @@ AC_CACHE_CHECK([whether objcopy supports debuglink],
libbacktrace_cv_objcopy_debuglink=no
elif ! test -n "${OBJCOPY}"; then
libbacktrace_cv_objcopy_debuglink=no
-elif ${OBJCOPY} --help | fgrep add-gnu-debuglink >/dev/null 2>&1; then
+elif ${OBJCOPY} --help | grep add-gnu-debuglink >/dev/null 2>&1; then
libbacktrace_cv_objcopy_debuglink=yes
else
libbacktrace_cv_objcopy_debuglink=no