Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2552516pxy; Tue, 3 Aug 2021 09:03:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9ZMVqEI4T4deCDnFvU0tqJD75nLjLZQD8N9FZokKRckKrA9++By0N3JVFtAvVra4avhGh X-Received: by 2002:a05:6402:35c7:: with SMTP id z7mr26247590edc.85.1628006591910; Tue, 03 Aug 2021 09:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628006591; cv=none; d=google.com; s=arc-20160816; b=bnV7XjhiRYP/IkRMj1nzcSH5QWH28U9bkgEoIddEMB1QVKk1DG/fs2FBBQo6+mhnE+ mT+wD3/E1nbabcmVYa5C1wZi2deKYdKbEjH5Y8XpVHahg2//3QGQhyVT4ASW98ymfvx9 3k89wotEKqbmTBYDsrKRNgJRs0b524oZJPRcTO/QMBdQl/HC/ViAqfRBotwcnxrQu3lb p1EPLTZTVcybRrMVEjafWLy6fBQThqAYiWdLr+GrYOF8Bu8dSG4Ifa5UzgxRMWwkl9Oh zjf9TQjf5N/FHSzPmYOaH5fDJ7Vo93qLFY7r7xS9jky2X0Ky55TiNY/a27zOV//xFGjc W73Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=mU3eT7eyGsL5o6LF8h+YK7bclXW4GXpf5fpmDUrcIzU=; b=XwVYX4lDFnTI9L4QiJ1i66ipH+y30VklztCmX3G8JrZ1Ul0Ac5CiRalNpe2JSp6Xsh ygS8GFVAnsMVWoK7Jrwdbzm78o5x9tk+XnfDMRPyM1D0Cn7CjmNE6nVR1Lw+tDDfbsyD S9Kz5wUsl7Lj2IRKn1OgMQsBrbTiGsLwLMK/0KExliSArGo4h/nGtxRYUa3YePJgOSPn gSBo/2XzFSVNBp1tFmUiqBZPPYtAR9jRseV6+Bpi96t1GbA9HyIltKpaAkklY+B/5PJU T3DVOII28liPJvct9WDkBls0eGbDB3t6G+8ap7kvKxIbOXX++RRrZMaO7iefVIpgHjys 8W3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=nlZQVoan; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec28si14683613edb.401.2021.08.03.09.02.46; Tue, 03 Aug 2021 09:03:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=nlZQVoan; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237152AbhHCP7K (ORCPT + 99 others); Tue, 3 Aug 2021 11:59:10 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.165]:36076 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237131AbhHCP7J (ORCPT ); Tue, 3 Aug 2021 11:59:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1628006307; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject:Cc:Date: From:Subject:Sender; bh=mU3eT7eyGsL5o6LF8h+YK7bclXW4GXpf5fpmDUrcIzU=; b=nlZQVoanb18I3z7wIRRMbvOjqNJXGdBzEiIlUkhXUsWy76YbvNAsAfvfBgjOdRKEaD U29d7bn6ardkbbrpOq1Zqqz3Gh0jnE00shaf+vEjFcBY2WLTdd6ajrcGNrVNdku0E/oS z3EP2PWzZ4E0bqt8Xuy4JM/fArKzo4CH2EDI4iFg4SRRi6HQcx+0Jk23kLaLt4pC1oGc dM0S6TURFE+bKosjdfOw1MPAK1BMjVMavaJyqxeNv6p8srMQjmSMhhJPQwyGoXe4jhN7 htFB2QF/uVeiR8s2okhFIuGGcKuRZaQzUw2302hT5o0sGaw5ae5LGL7yf7ou7YjDZqTr bfvw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj7wpz8NIGH/jrwDOqAdo=" X-RZG-CLASS-ID: mo00 Received: from imac.fritz.box by smtp.strato.de (RZmta 47.30.1 DYNA|AUTH) with ESMTPSA id K060b1x73FwN0fL (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Tue, 3 Aug 2021 17:58:23 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [PATCH 0/2] Regex fixes for mips and x86 cross-compile From: "H. Nikolaus Schaller" In-Reply-To: Date: Tue, 3 Aug 2021 17:58:22 +0200 Cc: Thomas Bogendoerfer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Jessica Yu , Miroslav Benes , Emil Velikov , Discussions about the Letux Kernel , "H. Peter Anvin" , linux-mips , Linux Kernel Mailing List , kernel@pyra-handheld.com, Linux Kbuild mailing list , Nick Desaulniers Content-Transfer-Encoding: quoted-printable Message-Id: References: <4AC1CCE9-CCAF-4D4B-BAD5-CEB9E5155FDF@goldelico.com> To: Masahiro Yamada X-Mailer: Apple Mail (2.3445.104.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, any chance to get that reviewed and merged into v5.15-rc1 and backported = to stable? Thank you, Nikolaus Schaller > Am 19.07.2021 um 22:37 schrieb Nick Desaulniers = : >=20 > + Masahiro, linux-kbuild (EOM) >=20 > On Mon, Jul 19, 2021 at 12:07 PM H. Nikolaus Schaller = wrote: >>=20 >> Any chance that it gets merged? >>=20 >>> Am 08.07.2021 um 10:57 schrieb H. Nikolaus Schaller = : >>>=20 >>> Trying to run the x86 relocs tool on a BSD based HOSTCC (cross >>> compilation environment) leads to errors like >>>=20 >>> VOFFSET arch/x86/boot/compressed/../voffset.h - due to: vmlinux >>> CC arch/x86/boot/compressed/misc.o - due to: = arch/x86/boot/compressed/../voffset.h >>> OBJCOPY arch/x86/boot/compressed/vmlinux.bin - due to: vmlinux >>> RELOCS arch/x86/boot/compressed/vmlinux.relocs - due to: vmlinux >>> empty (sub)expressionarch/x86/boot/compressed/Makefile:118: recipe = for target 'arch/x86/boot/compressed/vmlinux.relocs' failed >>> make[3]: *** [arch/x86/boot/compressed/vmlinux.relocs] Error 1 >>>=20 >>> and when cross compiling a MIPS kernel on a BSD based HOSTCC >>> we get errors like >>>=20 >>> 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 >>>=20 >>> It turns out that relocs.c on x86 uses patterns like >>>=20 >>> "something(|_end)" >>>=20 >>> while MIPS uses egrep with >>>=20 >>> (|MINOR_|PATCHLEVEL_) >>>=20 >>> In both cases it is not valid syntax or gives undefined results >>> according to POSIX 9.5.3 ERE Grammar >>>=20 >>> = https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html >>>=20 >>> It seems to be silently accepted by the Linux regcmp() or egrep >>> implementation while a BSD host complains. >>>=20 >>> Such patterns can be replaced by a transformation like >>>=20 >>> "(|p1|p2)" -> "(p1|p2)?" >>>=20 >>> Test Linux: >>>=20 >>> root@letux:~# echo foo | egrep '^(|foo)$' >>> foo >>> root@letux:~# echo fool | egrep '^(foo)?$' >>> root@letux:~# echo fun | egrep '^(|foo)$' >>> root@letux:~# echo f | egrep '^(|foo)$' >>> root@letux:~# echo | egrep '^(|foo)$' >>>=20 >>> root@letux:~# echo foo | egrep '^(foo)?$' >>> foo >>> root@letux:~# echo fool | egrep '^(foo)?$' >>> root@letux:~# echo fun | egrep '^(foo)?$' >>> root@letux:~# echo f | egrep '^(foo)?$' >>> root@letux:~# echo | egrep '^(foo)?$' >>>=20 >>> root@letux:~# >>>=20 >>> Test BSD: >>>=20 >>> iMac:master hns$ echo foo | egrep '^(|foo)$' >>> egrep: empty (sub)expression >>> iMac:master hns$ echo fool | egrep '^(foo)?$' >>> egrep: empty (sub)expression >>> iMac:master hns$ echo fun | egrep '^(|foo)$' >>> egrep: empty (sub)expression >>> iMac:master hns$ echo f | egrep '^(|foo)$' >>> egrep: empty (sub)expression >>> iMac:master hns$ echo | egrep '^(|foo)$' >>> egrep: empty (sub)expression >>> iMac:master hns$ echo foo | egrep '^(foo)?$' >>> foo >>> iMac:master hns$ echo fool | egrep '^(foo)?$' >>> iMac:master hns$ echo fun | egrep '^(foo)?$' >>> iMac:master hns$ echo f | egrep '^(foo)?$' >>> iMac:master hns$ echo | egrep '^(foo)?$' >>>=20 >>> iMac:master hns$ >>>=20 >>>=20 >>> H. Nikolaus Schaller (2): >>> x86/tools/relocs: Fix non-POSIX regexp >>> arch: mips: Fix non-POSIX regexp >>>=20 >>> arch/mips/Makefile | 2 +- >>> arch/x86/tools/relocs.c | 8 ++++---- >>> 2 files changed, 5 insertions(+), 5 deletions(-) >>>=20 >>> -- >>> 2.31.1 >>>=20 >>=20 >=20 >=20 > --=20 > Thanks, > ~Nick Desaulniers