Linux-KBuild Archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 0/2] Regex fixes for mips and x86 cross-compile
       [not found] ` <4AC1CCE9-CCAF-4D4B-BAD5-CEB9E5155FDF@goldelico.com>
@ 2021-07-19 20:37   ` Nick Desaulniers
  2021-08-03 15:58     ` H. Nikolaus Schaller
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Desaulniers @ 2021-07-19 20:37 UTC (permalink / raw
  To: H. Nikolaus Schaller
  Cc: Thomas Bogendoerfer, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, Jessica Yu, Miroslav Benes, Emil Velikov,
	Discussions about the Letux Kernel, H. Peter Anvin, linux-mips,
	linux-kernel, kernel, Masahiro Yamada, Linux Kbuild mailing list

+ Masahiro, linux-kbuild (EOM)

On Mon, Jul 19, 2021 at 12:07 PM H. Nikolaus Schaller <hns@goldelico.com> wrote:
>
> Any chance that it gets merged?
>
> > Am 08.07.2021 um 10:57 schrieb H. Nikolaus Schaller <hns@goldelico.com>:
> >
> > 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/2] Regex fixes for mips and x86 cross-compile
  2021-07-19 20:37   ` [PATCH 0/2] Regex fixes for mips and x86 cross-compile Nick Desaulniers
@ 2021-08-03 15:58     ` H. Nikolaus Schaller
  2021-08-05 11:54       ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: H. Nikolaus Schaller @ 2021-08-03 15:58 UTC (permalink / raw
  To: Masahiro Yamada
  Cc: Thomas Bogendoerfer, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, Jessica Yu, Miroslav Benes, Emil Velikov,
	Discussions about the Letux Kernel, H. Peter Anvin, linux-mips,
	Linux Kernel Mailing List, kernel, Linux Kbuild mailing list,
	Nick Desaulniers

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 <ndesaulniers@google.com>:
> 
> + Masahiro, linux-kbuild (EOM)
> 
> On Mon, Jul 19, 2021 at 12:07 PM H. Nikolaus Schaller <hns@goldelico.com> wrote:
>> 
>> Any chance that it gets merged?
>> 
>>> Am 08.07.2021 um 10:57 schrieb H. Nikolaus Schaller <hns@goldelico.com>:
>>> 
>>> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/2] Regex fixes for mips and x86 cross-compile
  2021-08-03 15:58     ` H. Nikolaus Schaller
@ 2021-08-05 11:54       ` Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2021-08-05 11:54 UTC (permalink / raw
  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, Linux Kbuild mailing list,
	Nick Desaulniers

On Wed, Aug 4, 2021 at 12:59 AM H. Nikolaus Schaller <hns@goldelico.com> 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 <ndesaulniers@google.com>:
> >
> > + Masahiro, linux-kbuild (EOM)
> >
> > On Mon, Jul 19, 2021 at 12:07 PM H. Nikolaus Schaller <hns@goldelico.com> wrote:
> >>
> >> Any chance that it gets merged?
> >>
> >>> Am 08.07.2021 um 10:57 schrieb H. Nikolaus Schaller <hns@goldelico.com>:
> >>>
> >>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-05 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1625734629.git.hns@goldelico.com>
     [not found] ` <4AC1CCE9-CCAF-4D4B-BAD5-CEB9E5155FDF@goldelico.com>
2021-07-19 20:37   ` [PATCH 0/2] Regex fixes for mips and x86 cross-compile Nick Desaulniers
2021-08-03 15:58     ` H. Nikolaus Schaller
2021-08-05 11:54       ` Masahiro Yamada

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 read-only IMAP folder(s) and NNTP newsgroup(s).