LoongArch: Makefile: use "grep -E" instead of "egrep"

Message ID 1668506549-28261-1-git-send-email-yangtiezhu@loongson.cn
State New
Headers
Series LoongArch: Makefile: use "grep -E" instead of "egrep" |

Commit Message

Tiezhu Yang Nov. 15, 2022, 10:02 a.m. UTC
  The latest version of grep claims the egrep is now obsolete so the build
now contains warnings that look like:
	egrep: warning: egrep is obsolescent; using grep -E
fix this up by moving the LoongArch Makefile to use "grep -E" instead.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Xi Ruoyao Nov. 15, 2022, 2:27 p.m. UTC | #1
On Tue, 2022-11-15 at 18:02 +0800, Tiezhu Yang wrote:
> The latest version of grep claims the egrep is now obsolete so the
> build
> now contains warnings that look like:
>         egrep: warning: egrep is obsolescent; using grep -E
> fix this up by moving the LoongArch Makefile to use "grep -E" instead.

For future reference: this warning message is imprecise because on some
non-POSIX platforms grep does not support -E (see "Limitations of Usual
Tools" in autoconf info page).

However (1) we are already using -w, which is not guaranteed to be
supported as well; (2) I don't think anyone will build LoongArch kernel
on such an old non-POSIX system.

So LGTM.

> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>  arch/loongarch/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
> index a0fc1f9..5232d8c 100644
> --- a/arch/loongarch/Makefile
> +++ b/arch/loongarch/Makefile
> @@ -97,7 +97,7 @@ KBUILD_LDFLAGS        += -m $(ld-emul)
>  
>  ifdef CONFIG_LOONGARCH
>  CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null |
> \
> -       egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
> +       grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
>         sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e
> 's/\$$/&&/g')
>  endif
>
  
Huacai Chen Nov. 16, 2022, 1:42 a.m. UTC | #2
Queued for loongarch-fixes, thanks.

Huacai

On Tue, Nov 15, 2022 at 10:28 PM Xi Ruoyao <xry111@xry111.site> wrote:
>
> On Tue, 2022-11-15 at 18:02 +0800, Tiezhu Yang wrote:
> > The latest version of grep claims the egrep is now obsolete so the
> > build
> > now contains warnings that look like:
> >         egrep: warning: egrep is obsolescent; using grep -E
> > fix this up by moving the LoongArch Makefile to use "grep -E" instead.
>
> For future reference: this warning message is imprecise because on some
> non-POSIX platforms grep does not support -E (see "Limitations of Usual
> Tools" in autoconf info page).
>
> However (1) we are already using -w, which is not guaranteed to be
> supported as well; (2) I don't think anyone will build LoongArch kernel
> on such an old non-POSIX system.
>
> So LGTM.
>
> > Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> > ---
> >  arch/loongarch/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
> > index a0fc1f9..5232d8c 100644
> > --- a/arch/loongarch/Makefile
> > +++ b/arch/loongarch/Makefile
> > @@ -97,7 +97,7 @@ KBUILD_LDFLAGS        += -m $(ld-emul)
> >
> >  ifdef CONFIG_LOONGARCH
> >  CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null |
> > \
> > -       egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
> > +       grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
> >         sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e
> > 's/\$$/&&/g')
> >  endif
> >
>
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University
  

Patch

diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index a0fc1f9..5232d8c 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -97,7 +97,7 @@  KBUILD_LDFLAGS	+= -m $(ld-emul)
 
 ifdef CONFIG_LOONGARCH
 CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
-	egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
+	grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
 	sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
 endif