Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3998321pxv; Mon, 19 Jul 2021 14:03:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDjgjicQpB31A8k4zVlMLxdTMc5kmYAyqW1/Fry1RPFYAYQLs2vnwcKuH3PMJIykILpolk X-Received: by 2002:a17:906:17c5:: with SMTP id u5mr29461787eje.326.1626728639132; Mon, 19 Jul 2021 14:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626728639; cv=none; d=google.com; s=arc-20160816; b=J6HgGiuPNxdBB9iBdesfFuthrq7ZmmwxnrJSNhHvSpbrIUL+yrTQQ5y6yzJg+RU+Xo V9OfbxCyxhS1tmuDA5ZdJ7Y5MBjF1HwnYXhsU799mBzRul/ei0flBWpTgmIDEXphXgcu NHvEF/8IkjvqciJztkghzP7vVVZBpSnQ2dhoHP0rhsD6EULVYsQS5EIwRm1PstafXtMP A3GdavnjRsdbC7mFo0R/k+0SPBfWNzW6bdddPFBFP+kniXi7pc1wCgr3o5J/Ixdh0LlE u2rg3UHfTXMlu5XHN3O54RC3MU7eiVnXRCNv7YiZbPWSeetQlMFqs1yGxEtA4R4+VYEm M8+Q== 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; bh=3Fk8+31S0fHnH1ziB0T55VcQ2gIsHPuUv22CBZq7JBE=; b=BIc8ARYZLpeN+ZhtWdNyaxNmylwUHQ2TRQWXMC87D2TJsp9i22ftxgSc4cjeQ/xs9N 9CS6WtVhfYci6VkXCHCTpUOYAKQz5/2cFYm9BjxaHc+beI77/ZO2zqM31NgHStRKi+q0 M3EXiueTEhVVNDl1x5pnak6zbUackTYPftzLjQxXZNCZxB6ZNRFS489dgzfug90JXZm2 socoBZa6FsNIYNkY1P/lVP3SdMHOyMwgKIN2HnrLCzHMffMJbhTDwU9hqbBf9j9m4pRH 1Aq4wVr6ULi7WWHhM9eP82gPUmTokRH4aD2IVHY/2J8o9Aby6J/oOI5yxVveWvRDjmuk msfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OX5FHLje; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si3406432edd.122.2021.07.19.14.03.35; Mon, 19 Jul 2021 14:03:59 -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=@google.com header.s=20161025 header.b=OX5FHLje; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385936AbhGSUS2 (ORCPT + 99 others); Mon, 19 Jul 2021 16:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387224AbhGST5K (ORCPT ); Mon, 19 Jul 2021 15:57:10 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ABA6C061767 for ; Mon, 19 Jul 2021 13:34:54 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id v6so32391402lfp.6 for ; Mon, 19 Jul 2021 13:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3Fk8+31S0fHnH1ziB0T55VcQ2gIsHPuUv22CBZq7JBE=; b=OX5FHLjet6+SRAJ4XSnkrNOCO9j8c36OqlYSpKdQ+uH3CJsQqmrlKhV3GPYhW00StA 2bA4iBUxBXGpchoNJ4hW8itBP5nt1XcyoZoG0q0LYC3087a43GX2YDOYo0pEfnfrcK7N C6dCvoe+yC0ZxBr6yIUz7UFC0yM1z8UmgUzMVB4KIg+kfsULXz+yE1RHy5cJelIv8jLb sJyu1J7ofICyDkY/Br896OZ4YIUPBAh/ee4kWTZ6VxSFVuit90+88xhmk0aOwL7x0CoS VdSabBWhP1vJkdW7mJ8XIAZLRti+4Ry9HwjxGfPiTK0xg6fpovA/T/l70Wpr2qn2Lba0 ZzrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3Fk8+31S0fHnH1ziB0T55VcQ2gIsHPuUv22CBZq7JBE=; b=MZQC7p71OILnzIfqSNfYUm3uHo3tMPKuysp8KKpdVpeyEtizHGVKIxhx8Bq0/aiVB5 eI1DVzkHGTIW1BQLf7JBqpp9R7H5oTWt0FzUEuFKYMJnnSBTbZOmvnUzggUSZXMQk+Q1 geR6xQYZgYDVQ485gEQqLg7PlVuDGzY70AHr6tsQy64/sLC09yb92ize7Lf+2weksZym m6MlPM11Y0vMMxaZiRKLnHUE61jLd5syPr3dPXuM34uru6eg5/DlSX9YBSzA5LdvuNdB jc4Pl4HhbJRaABygUwwNmdiQovgNHLbGKbtABZ6cZ8UA7mt4DTzIS6IQzXoDRVqpzrWc 9IyQ== X-Gm-Message-State: AOAM531Zy6E8Nze5RVzV7Wzz09O06GZIFhPiA7RLsY4TupobeudSCKiA sl4j8/Ap1UnNL+V0MfH7eZuawNsDLlQzuAoaH+9LwA== X-Received: by 2002:a05:6512:3e0c:: with SMTP id i12mr18956149lfv.122.1626727067355; Mon, 19 Jul 2021 13:37:47 -0700 (PDT) MIME-Version: 1.0 References: <4AC1CCE9-CCAF-4D4B-BAD5-CEB9E5155FDF@goldelico.com> In-Reply-To: <4AC1CCE9-CCAF-4D4B-BAD5-CEB9E5155FDF@goldelico.com> From: Nick Desaulniers Date: Mon, 19 Jul 2021 13:37:36 -0700 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@kernel.org, Jessica Yu , Miroslav Benes , Emil Velikov , Discussions about the Letux Kernel , "H. Peter Anvin" , linux-mips , linux-kernel@vger.kernel.org, kernel@pyra-handheld.com, Masahiro Yamada , Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + 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