Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp726025pxt; Thu, 5 Aug 2021 10:06:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDRr4jQ87JkVscp5s+uL4DgAtITfbjOpdHZ1kNNkTXJipIFl4rKmFv6w5fBsa6PyBqzkRk X-Received: by 2002:a5e:8c19:: with SMTP id n25mr795667ioj.155.1628183168020; Thu, 05 Aug 2021 10:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628183168; cv=none; d=google.com; s=arc-20160816; b=mfAX0sk3zVDhHg2mS3jSC6M+rBhsSg5UWqwVO+GmyaE8vvjsWAKgjCYAaLb+QNFoFg UYy9k7pKa5sAoXutRQyqI1GbJrUO59yuUw7GIxLJj8dXc6dYyWuINa7/uV3y9/vr5cLd 70PLs2QJjO+ok/Btoer3f2J2N+80KuUAYm9PYEDOKX5yi3rX2NMLb3iymMrmWFiZsTbQ W8s9uTDD1mDLUc08UiMi5bLaIzgoKWfMRFDaNXonHGCn5dAIgvCe4wEmBqTK/Z0DMYkJ DBWLTk8uGLABRG6ZZzVknUcaTWifFjaaDzy2mI66puPAGtgsWkPE2A/GJ45RyGGVHUZ4 Cd0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=QtmFIMbSkPrFHJ5F2MOHK1582vI0vTuaUebcEfPiA5I=; b=N2CmBi+rfSG+yY7NfZ5Hf7EoKChzeVZroRTRnzwlwyiP09oDxsFG5hJ73uhgEe+9wS o4kLi8bryfvMTbchqVXDE7OWsj2rluS5omGrbMv7rsz6jzmm2ZwUOzTr5IC1uEumkAW4 n9Y9VQd/nIomA8snfvEHozpqfjaitU9uwjMlzf0G7S3YOuOv3A9CphL0HUyRcbWVxc0k LDz79TMCgrkLw6WVKQKm0GrmPe9SNkDdRKYyW9ENSUWD/eW0XapAprnfMeJwdf6O75LE TQrfSm7JSRcKq1kn1w3iT5ODwN9tvfb2cEseqokk5GC2wV6ZN+/9Dus5amgHEOlliVra LubQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=P2xXn+b3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l20si6092231ion.36.2021.08.05.10.05.55; Thu, 05 Aug 2021 10:06:08 -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=@nifty.com header.s=dec2015msa header.b=P2xXn+b3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238521AbhHELzs (ORCPT + 99 others); Thu, 5 Aug 2021 07:55:48 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:50384 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbhHELzr (ORCPT ); Thu, 5 Aug 2021 07:55:47 -0400 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 175Bt3iE011866; Thu, 5 Aug 2021 20:55:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 175Bt3iE011866 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1628164504; bh=QtmFIMbSkPrFHJ5F2MOHK1582vI0vTuaUebcEfPiA5I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=P2xXn+b35DN1tjVaqBC5J0Eoh24Uq4fU5ixhEuAyg8ZgoPFU+vQmBTV7o32YcfXj+ KEe288tTzDZBmtGWDcybLxztOpuglgDFKb0oTajI4aaJDJpDXgheo/FjiR2/lq6mBB i2Xt8feKtE9Min3x9RRWywKVgQWAJFx1PzPHSEHI0ym/eNe8Frwek1vCtKLdd4C5sp vE/EWZ2mUehmQz0ZsGOAIpSb8Lzc0IGQLm37zWGe3GcHlm+zVmx2nsZ3TiVD1y5cNc DR5SOCNrE4xKPuxOmTO6TT+U5R2hn0lpKk4xwwtoi3WSEIzRdKFl2CrAOj0CjDVVSV 4rSc4WypAOL1A== X-Nifty-SrcIP: [209.85.216.44] Received: by mail-pj1-f44.google.com with SMTP id cl16-20020a17090af690b02901782c35c4ccso4969357pjb.5; Thu, 05 Aug 2021 04:55:03 -0700 (PDT) X-Gm-Message-State: AOAM5336A2wdWgtkke5PtxzC2eRtOWVZ7apwcV8DZ7wreOes+DVdwXIh ggHJiVbQRXFrhGz66+30hKcQJCp2ac+bjbTxDrk= X-Received: by 2002:a63:dd51:: with SMTP id g17mr1794883pgj.47.1628164503024; Thu, 05 Aug 2021 04:55:03 -0700 (PDT) MIME-Version: 1.0 References: <4AC1CCE9-CCAF-4D4B-BAD5-CEB9E5155FDF@goldelico.com> In-Reply-To: From: Masahiro Yamada Date: Thu, 5 Aug 2021 20:54:26 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] Regex fixes for mips and x86 cross-compile To: "H. Nikolaus Schaller" Cc: Thomas Bogendoerfer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , 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-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 4, 2021 at 12:59 AM H. Nikolaus Schaller wrote: > > Hi all, > any chance to get that reviewed and merged into v5.15-rc1 and backported to stable? > Thank you, > Nikolaus Schaller I have a macbook (macOS catalina), and was able to reproduce this issue. I applied both to kbuild tree. Thanks. > > > Am 19.07.2021 um 22:37 schrieb Nick Desaulniers : > > > > + Masahiro, linux-kbuild (EOM) > > > > On Mon, Jul 19, 2021 at 12:07 PM H. Nikolaus Schaller wrote: > >> > >> Any chance that it gets merged? > >> > >>> Am 08.07.2021 um 10:57 schrieb H. Nikolaus Schaller : > >>> > >>> Trying to run the x86 relocs tool on a BSD based HOSTCC (cross > >>> compilation environment) leads to errors like > >>> > >>> 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 > >>> > >>> and when cross compiling a MIPS kernel on a BSD based HOSTCC > >>> we get 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 relocs.c on x86 uses patterns like > >>> > >>> "something(|_end)" > >>> > >>> while MIPS uses egrep with > >>> > >>> (|MINOR_|PATCHLEVEL_) > >>> > >>> In both cases it 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 regcmp() or egrep > >>> implementation while a BSD host complains. > >>> > >>> Such patterns can be replaced by a transformation like > >>> > >>> "(|p1|p2)" -> "(p1|p2)?" > >>> > >>> Test Linux: > >>> > >>> 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)$' > >>> > >>> 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)?$' > >>> > >>> root@letux:~# > >>> > >>> Test BSD: > >>> > >>> 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)?$' > >>> > >>> iMac:master hns$ > >>> > >>> > >>> H. Nikolaus Schaller (2): > >>> x86/tools/relocs: Fix non-POSIX regexp > >>> arch: mips: Fix non-POSIX regexp > >>> > >>> arch/mips/Makefile | 2 +- > >>> arch/x86/tools/relocs.c | 8 ++++---- > >>> 2 files changed, 5 insertions(+), 5 deletions(-) > >>> > >>> -- > >>> 2.31.1 > >>> > >> > > > > > > -- > > Thanks, > > ~Nick Desaulniers > -- Best Regards Masahiro Yamada