LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	X86 ML <x86@kernel.org>, Jessica Yu <jeyu@kernel.org>,
	Miroslav Benes <mbenes@suse.cz>,
	Emil Velikov <emil.l.velikov@gmail.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Discussions about the Letux Kernel 
	<letux-kernel@openphoenux.org>, "H. Peter Anvin" <hpa@zytor.com>,
	"open list:BROADCOM NVRAM DRIVER" <linux-mips@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kernel@pyra-handheld.com
Subject: Re: [PATCH 1/2] x86/tools/relocs: Fix non-POSIX regexp
Date: Thu, 5 Aug 2021 20:52:50 +0900	[thread overview]
Message-ID: <CAK7LNATJtBACoZ0Cyakgo5J1gBU+DNBrtKRYUoqnHNE3mqsSXA@mail.gmail.com> (raw)
In-Reply-To: <81c6de380d932bfb94d96fb70459dd47afd6ed5d.1625734629.git.hns@goldelico.com>

On Thu, Jul 8, 2021 at 5:57 PM H. Nikolaus Schaller <hns@goldelico.com> wrote:
>
> Trying to run a cross-compiled x86 relocs tool on a BSD based
> HOSTCC 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
>
> It turns out that relocs.c uses patterns like
>
>         "something(|_end)"
>
> 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 regexp() implementation
> while a BSD host complains.
>
> Such patterns can be replaced by a transformation like
>
>         "(|p1|p2)" -> "(p1|p2)?"
>
> Fixes: fd952815307f ("x86-32, relocs: Whitelist more symbols for ld bug workaround")
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> ---



Applied to linux-kbuild/fixes.
Thanks.





>  arch/x86/tools/relocs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
> index 04c5a44b96827..9ba700dc47de4 100644
> --- a/arch/x86/tools/relocs.c
> +++ b/arch/x86/tools/relocs.c
> @@ -57,12 +57,12 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
>         [S_REL] =
>         "^(__init_(begin|end)|"
>         "__x86_cpu_dev_(start|end)|"
> -       "(__parainstructions|__alt_instructions)(|_end)|"
> -       "(__iommu_table|__apicdrivers|__smp_locks)(|_end)|"
> +       "(__parainstructions|__alt_instructions)(_end)?|"
> +       "(__iommu_table|__apicdrivers|__smp_locks)(_end)?|"
>         "__(start|end)_pci_.*|"
>         "__(start|end)_builtin_fw|"
> -       "__(start|stop)___ksymtab(|_gpl)|"
> -       "__(start|stop)___kcrctab(|_gpl)|"
> +       "__(start|stop)___ksymtab(_gpl)?|"
> +       "__(start|stop)___kcrctab(_gpl)?|"
>         "__(start|stop)___param|"
>         "__(start|stop)___modver|"
>         "__(start|stop)___bug_table|"
> --
> 2.31.1
>


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2021-08-05 11:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08  8:57 [PATCH 0/2] Regex fixes for mips and x86 cross-compile H. Nikolaus Schaller
2021-07-08  8:57 ` [PATCH 1/2] x86/tools/relocs: Fix non-POSIX regexp H. Nikolaus Schaller
2021-08-05 11:52   ` Masahiro Yamada [this message]
2021-07-08  8:57 ` [PATCH 2/2] arch: mips: " H. Nikolaus Schaller
2021-08-05 11:53   ` Masahiro Yamada
2021-07-19 19:04 ` [PATCH 0/2] Regex fixes for mips and x86 cross-compile H. Nikolaus Schaller
2021-07-19 20:37   ` Nick Desaulniers
2021-08-03 15:58     ` H. Nikolaus Schaller
2021-08-05 11:54       ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNATJtBACoZ0Cyakgo5J1gBU+DNBrtKRYUoqnHNE3mqsSXA@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=bp@alien8.de \
    --cc=emil.l.velikov@gmail.com \
    --cc=hns@goldelico.com \
    --cc=hpa@zytor.com \
    --cc=jeyu@kernel.org \
    --cc=kernel@pyra-handheld.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mingo@redhat.com \
    --cc=ndesaulniers@google.com \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH 1/2] x86/tools/relocs: Fix non-POSIX regexp' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).