[PATCH] kbuild: invoke generate_builtin_ranges.awk using gawk explicitly

Kris Van Hees posted 1 patch 2 months, 2 weeks ago
scripts/Makefile.vmlinux | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] kbuild: invoke generate_builtin_ranges.awk using gawk explicitly
Posted by Kris Van Hees 2 months, 2 weeks ago
The gawk utility might be installed in different locations depending
on the distributions, etc.  That means that the locations in the
shebang at the beginning of the generate_builtin_ranges.awk script
may not be correct, causing an error.

Use "gawk -f <script> <args>" instead from the Makefile.vmlinux, so
the $PATH will be used to locate gawk appropriately.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 scripts/Makefile.vmlinux | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index dfb408aa19c6..1284f05555b9 100644
--- a/scripts/Makefile.vmlinux
+++ b/scripts/Makefile.vmlinux
@@ -39,7 +39,7 @@ ifdef CONFIG_BUILTIN_MODULE_RANGES
 __default: modules.builtin.ranges
 
 quiet_cmd_modules_builtin_ranges = GEN     $@
-      cmd_modules_builtin_ranges = $(real-prereqs) > $@
+      cmd_modules_builtin_ranges = gawk -f $(real-prereqs) > $@
 
 targets += modules.builtin.ranges
 modules.builtin.ranges: $(srctree)/scripts/generate_builtin_ranges.awk \
-- 
2.45.2
Re: [PATCH] kbuild: invoke generate_builtin_ranges.awk using gawk explicitly
Posted by Masahiro Yamada 2 months, 1 week ago
On Fri, Sep 13, 2024 at 2:17 AM Kris Van Hees <kris.van.hees@oracle.com> wrote:
>
> The gawk utility might be installed in different locations depending
> on the distributions, etc.  That means that the locations in the
> shebang at the beginning of the generate_builtin_ranges.awk script
> may not be correct, causing an error.
>
> Use "gawk -f <script> <args>" instead from the Makefile.vmlinux, so
> the $PATH will be used to locate gawk appropriately.
>
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
>  scripts/Makefile.vmlinux | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
> index dfb408aa19c6..1284f05555b9 100644
> --- a/scripts/Makefile.vmlinux
> +++ b/scripts/Makefile.vmlinux
> @@ -39,7 +39,7 @@ ifdef CONFIG_BUILTIN_MODULE_RANGES
>  __default: modules.builtin.ranges
>
>  quiet_cmd_modules_builtin_ranges = GEN     $@
> -      cmd_modules_builtin_ranges = $(real-prereqs) > $@
> +      cmd_modules_builtin_ranges = gawk -f $(real-prereqs) > $@
>
>  targets += modules.builtin.ranges
>  modules.builtin.ranges: $(srctree)/scripts/generate_builtin_ranges.awk \
> --
> 2.45.2
>

I squashed this to v10 2/4.
Thanks!


-- 
Best Regards
Masahiro Yamada