From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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 C3B46C636CE for ; Mon, 19 Jul 2021 20:59:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7CE16115B for ; Mon, 19 Jul 2021 20:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386475AbhGSUSe (ORCPT ); Mon, 19 Jul 2021 16:18:34 -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-Google-Smtp-Source: ABdhPJyJwTN5dBDo3nwDO5PqQM0lY/t5XyBNTZUOfCTw8kchIOEJUhA4dAPgaub/dhyJ2hV58wXSTElY5Sf9L13Ds+c= 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