2022-10-25 20:39:35

by William McVicker

[permalink] [raw]
Subject: [PATCH v1] kbuild: Use '-f' instead of '--file=' for grep

The posix grep utility doesn't support the longer '--file=pattern_file'
command line option which was introduced in commit ce697ccee1a8
("kbuild: remove head-y syntax"). Let's update Makefile to use '-f
pattern_file' to fix the compiling error:

grep: Unknown option 'file=.../scripts/head-object-list.txt'
(see "grep --help")

Signed-off-by: Will McVicker <[email protected]>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

base-commit: 1a2dcbdde82e3a5f1db9b2f4c48aa1aeba534fb2

diff --git a/Makefile b/Makefile
index d148a55bfd0f..e90bb2b38607 100644
--- a/Makefile
+++ b/Makefile
@@ -1218,7 +1218,7 @@ quiet_cmd_ar_vmlinux.a = AR $@
cmd_ar_vmlinux.a = \
rm -f $@; \
$(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \
- $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F --file=$(srctree)/scripts/head-object-list.txt)
+ $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)

targets += vmlinux.a
vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE
--
2.38.0.135.g90850a2211-goog



2022-10-27 15:51:41

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH v1] kbuild: Use '-f' instead of '--file=' for grep

On Wed, Oct 26, 2022 at 5:18 AM Will McVicker <[email protected]> wrote:
>
> The posix grep utility doesn't support the longer '--file=pattern_file'
> command line option which was introduced in commit ce697ccee1a8
> ("kbuild: remove head-y syntax"). Let's update Makefile to use '-f
> pattern_file' to fix the compiling error:
>
> grep: Unknown option 'file=.../scripts/head-object-list.txt'
> (see "grep --help")
>
> Signed-off-by: Will McVicker <[email protected]>


Thanks, but I had already picked up a similar patch.


https://lore.kernel.org/linux-kbuild/[email protected]/



> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> base-commit: 1a2dcbdde82e3a5f1db9b2f4c48aa1aeba534fb2
>
> diff --git a/Makefile b/Makefile
> index d148a55bfd0f..e90bb2b38607 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1218,7 +1218,7 @@ quiet_cmd_ar_vmlinux.a = AR $@
> cmd_ar_vmlinux.a = \
> rm -f $@; \
> $(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \
> - $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F --file=$(srctree)/scripts/head-object-list.txt)
> + $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)
>
> targets += vmlinux.a
> vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE
> --
> 2.38.0.135.g90850a2211-goog
>


--
Best Regards
Masahiro Yamada