lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 13 May 2022 13:40:22 +0200
From:   Nicolas Schier <nicolas@...sle.eu>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-modules@...r.kernel.org, llvm@...ts.linux.dev,
        Ard Biesheuvel <ardb@...nel.org>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v5 11/12] kbuild: add cmd_and_savecmd macro

On Thu, May 12, 2022 at 01:45:13AM +0900, Masahiro Yamada wrote:
> Separate out the command execution part of if_changed, as we did
> for if_changed_dep.
> 
> This allows us to reuse it in if_changed_rule.
> 
>   define rule_foo
>           $(call cmd_and_savecmd,foo)
>           $(call cmd,bar)
>   endef
> 
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> Reviewed-by: Kees Cook <keescook@...omium.org>
> ---
> 
> (no changes since v4)
> 
> Changes in v4:
>   - New.
>     Resent of my previous submission.
>     https://lore.kernel.org/all/20210831074004.3195284-10-masahiroy@kernel.org/
> 
>  scripts/Kbuild.include | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index 455a0a6ce12d..ece44b735061 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -142,9 +142,11 @@ check-FORCE = $(if $(filter FORCE, $^),,$(warning FORCE prerequisite is missing)
>  if-changed-cond = $(newer-prereqs)$(cmd-check)$(check-FORCE)
>  
>  # Execute command if command has changed or prerequisite(s) are updated.
> -if_changed = $(if $(if-changed-cond),                                        \
> +if_changed = $(if $(if-changed-cond),$(cmd_and_savecmd),@:)
> +
> +cmd_and_savecmd =                                                            \
>  	$(cmd);                                                              \
> -	printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
> +	printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd
>  
>  # Execute the command and also postprocess generated .d dependencies file.
>  if_changed_dep = $(if $(if-changed-cond),$(cmd_and_fixdep),@:)
> -- 
> 2.32.0
> 

Reviewed-by: Nicolas Schier <n.schier@....de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ