diff options
| author | H. Nikolaus Schaller <hns@goldelico.com> | 2021-07-08 10:57:10 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-15 13:03:29 +0200 |
| commit | 2a465b741e7dafaa216c0e11a0fa06d24252bd0f (patch) | |
| tree | c55ed18f02679c1fdd00c43523f13bb93eed8c5b | |
| parent | f97f6b83e5403b52f085918fa27e8915fec09c4e (diff) | |
| download | linux-2a465b741e7dafaa216c0e11a0fa06d24252bd0f.tar.gz linux-2a465b741e7dafaa216c0e11a0fa06d24252bd0f.tar.bz2 linux-2a465b741e7dafaa216c0e11a0fa06d24252bd0f.zip | |
mips: Fix non-POSIX regexp
[ Upstream commit 28bbbb9875a35975904e46f9b06fa689d051b290 ]
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@goldelico.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | arch/mips/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index a4a06d173858..1190e6f75d4b 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -314,7 +314,7 @@ 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') ifdef CONFIG_64BIT CHECKFLAGS += -m64 |
