From patchwork Thu Jul 8 08:57:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 12364771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17E9AC07E96 for ; Thu, 8 Jul 2021 09:09:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED2946142C for ; Thu, 8 Jul 2021 09:09:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231262AbhGHJLz (ORCPT ); Thu, 8 Jul 2021 05:11:55 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.169]:8720 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbhGHJLx (ORCPT ); Thu, 8 Jul 2021 05:11:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1625734633; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=T6ETvbXoVE/hpvkyrA1LsDKpPMonbOGVOXqyXUMKr1o=; b=aC0LdQXdsPA9SOoqQn1OOSmMcewcyfnz9wfRA6gFvmxq9WoSJpHEN53VTo56F2yPsC haQiRWoex4akVnwn/K665Bx1Bq7+jbJQAMT4Caj/PBMPtVEwkU7TlskKhW8xV6cpwxfH u21230KZ/PIowFK4yLiuFz2VLlt0D5sHY4OFmz8krT85VvLD06lQ+lk4BpD7nJ51FdIs qV9o920mhaOjGUpIglhyvLpWjnQd2rPec+9Yc1Bh2aqAE6Uovxd9F3XV2/eu67vosisl 9nAOYpoBFFCYxKgsJoojbjYRj+QaDDHcv5c+pqR73OWzAmW0b50JiXDj18pw+qxSlnPU vbnA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1KHeBQyh+ITDDtsZQ==" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.28.1 DYNA|AUTH) with ESMTPSA id h06665x688vCcED (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 8 Jul 2021 10:57:12 +0200 (CEST) From: "H. Nikolaus Schaller" To: Thomas Bogendoerfer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Jessica Yu , Miroslav Benes , Emil Velikov , Nick Desaulniers Cc: letux-kernel@openphoenux.org, "H. Peter Anvin" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pyra-handheld.com, "H. Nikolaus Schaller" Subject: [PATCH 2/2] arch: mips: Fix non-POSIX regexp Date: Thu, 8 Jul 2021 10:57:10 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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 --- 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