diff mbox series

[v2] lib/raid6: Let $(UNROLL) rules work with macOS userland

Message ID 60f12be3-2f7f-8c7c-55dc-f360ff959fe0@john-millikin.com (mailing list archive)
State New, archived
Headers show
Series [v2] lib/raid6: Let $(UNROLL) rules work with macOS userland | expand

Commit Message

John Millikin Dec. 23, 2020, 6:23 a.m. UTC
Older versions of BSD awk are fussy about the order of '-v' and '-f'
flags, and require a space after the flag name. This causes build
failures on platforms with an old awk, such as macOS and NetBSD.

Since GNU awk and modern versions of BSD awk (distributed with
FreeBSD/OpenBSD) are fine with either form, the definition of
'cmd_unroll' can be trivially tweaked to let the lib/raid6 Makefile
work with both old and new awk flag dialects.

Signed-off-by: John Millikin <john@john-millikin.com>
---
Changes in v2:
  - Updated the patch description to note that only older versions of
    awk (as found in macOS and NetBSD) need this patch to work.

 lib/raid6/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--

Comments

Masahiro Yamada Dec. 23, 2020, 8:11 a.m. UTC | #1
On Wed, Dec 23, 2020 at 3:23 PM John Millikin <john@john-millikin.com> wrote:
>
> Older versions of BSD awk are fussy about the order of '-v' and '-f'
> flags, and require a space after the flag name. This causes build
> failures on platforms with an old awk, such as macOS and NetBSD.
>
> Since GNU awk and modern versions of BSD awk (distributed with
> FreeBSD/OpenBSD) are fine with either form, the definition of
> 'cmd_unroll' can be trivially tweaked to let the lib/raid6 Makefile
> work with both old and new awk flag dialects.
>
> Signed-off-by: John Millikin <john@john-millikin.com>
> ---
> Changes in v2:
>   - Updated the patch description to note that only older versions of
>     awk (as found in macOS and NetBSD) need this patch to work.
>
>  lib/raid6/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
> index b4c0df6d706d..c770570bfe4f 100644
> --- a/lib/raid6/Makefile
> +++ b/lib/raid6/Makefile
> @@ -48,7 +48,7 @@ endif
>  endif
>
>  quiet_cmd_unroll = UNROLL  $@
> -      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$* < $< > $@
> +      cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
>
>  targets += int1.c int2.c int4.c int8.c int16.c int32.c
>  $(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
> --
>


Applied to linux-kbuild. Thanks.

The patch is corrupted somehow (another one too).

I manually fixed it, but please check the patch format next time.


masahiro@grover:~/workspace/linux-kbuild$ git am -s
~/Downloads/v2-lib-raid6-Let-UNROLL-rules-work-with-macOS-userland.patch
Applying: lib/raid6: Let $(UNROLL) rules work with macOS userland
error: corrupt patch at line 16
Patch failed at 0001 lib/raid6: Let $(UNROLL) rules work with macOS userland
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
diff mbox series

Patch

diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
index b4c0df6d706d..c770570bfe4f 100644
--- a/lib/raid6/Makefile
+++ b/lib/raid6/Makefile
@@ -48,7 +48,7 @@  endif
 endif
 
 quiet_cmd_unroll = UNROLL  $@
-      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$* < $< > $@
+      cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
 
 targets += int1.c int2.c int4.c int8.c int16.c int32.c
 $(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE