[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNARJbEZt_erpOw20S_fz-G5rZrEBTgY4RrHV5-+iTrxesg@mail.gmail.com>
Date: Thu, 5 Aug 2021 20:53:12 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: "H. Nikolaus Schaller" <hns@...delico.com>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>, Jessica Yu <jeyu@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Emil Velikov <emil.l.velikov@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Discussions about the Letux Kernel
<letux-kernel@...nphoenux.org>, "H. Peter Anvin" <hpa@...or.com>,
"open list:BROADCOM NVRAM DRIVER" <linux-mips@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kernel@...a-handheld.com
Subject: Re: [PATCH 2/2] arch: mips: Fix non-POSIX regexp
On Thu, Jul 8, 2021 at 5:57 PM H. Nikolaus Schaller <hns@...delico.com> wrote:
>
> When cross compiling a MIPS kernel on a BSD based HOSTCC leads
> to errors like
>
> SYNC include/config/auto.conf.cmd - due to: .config
> egrep: empty (sub)expression
> UPD include/config/kernel.release
> HOSTCC scripts/dtc/dtc.o - due to target missing
>
> It turns out that egrep uses this egrep pattern:
>
> (|MINOR_|PATCHLEVEL_)
>
> This is not valid syntax or gives undefined results according
> to POSIX 9.5.3 ERE Grammar
>
> https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html
>
> It seems to be silently accepted by the Linux egrep implementation
> while a BSD host complains.
>
> Such patterns can be replaced by a transformation like
>
> "(|p1|p2)" -> "(p1|p2)?"
>
> Fixes: 48c35b2d245f ("[MIPS] There is no __GNUC_MAJOR__")
> Signed-off-by: H. Nikolaus Schaller <hns@...delico.com>
> ---
Applied to linux-kbuild/fixes.
Thanks.
> arch/mips/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> index 258234c35a096..674f68d16a73f 100644
> --- a/arch/mips/Makefile
> +++ b/arch/mips/Makefile
> @@ -321,7 +321,7 @@ KBUILD_LDFLAGS += -m $(ld-emul)
>
> ifdef CONFIG_MIPS
> CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
> - egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \
> + egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
> sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
> endif
>
> --
> 2.31.1
>
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists