diff mbox series

[5/5] kbuild: unify no-compiler-targets and no-sync-config-targets

Message ID 20231009124210.1064021-5-masahiroy@kernel.org (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series [1/5] csky: remove unused cmd_vdso_install | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR warning PR summary
conchuod/patch-5-test-1 success .github/scripts/patches/build_rv32_defconfig.sh
conchuod/patch-5-test-2 success .github/scripts/patches/build_rv64_clang_allmodconfig.sh
conchuod/patch-5-test-3 success .github/scripts/patches/build_rv64_gcc_allmodconfig.sh
conchuod/patch-5-test-4 success .github/scripts/patches/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-5-test-5 success .github/scripts/patches/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-5-test-6 success .github/scripts/patches/checkpatch.sh
conchuod/patch-5-test-7 success .github/scripts/patches/dtb_warn_rv64.sh
conchuod/patch-5-test-8 success .github/scripts/patches/header_inline.sh
conchuod/patch-5-test-9 success .github/scripts/patches/kdoc.sh
conchuod/patch-5-test-10 success .github/scripts/patches/maintainers_patterns.sh
conchuod/patch-5-test-11 success .github/scripts/patches/module_param.sh
conchuod/patch-5-test-12 success .github/scripts/patches/verify_fixes.sh
conchuod/patch-5-test-13 success .github/scripts/patches/verify_signedoff.sh

Commit Message

Masahiro Yamada Oct. 9, 2023, 12:42 p.m. UTC
Now that vdso_install does not depend on any in-tree build artifact,
it no longer invokes a compiler, making no-compiler-targets the same
as no-sync-config-targets.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Nathan Chancellor Oct. 9, 2023, 4:44 p.m. UTC | #1
On Mon, Oct 09, 2023 at 09:42:10PM +0900, Masahiro Yamada wrote:
> Now that vdso_install does not depend on any in-tree build artifact,
> it no longer invokes a compiler, making no-compiler-targets the same
> as no-sync-config-targets.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  Makefile | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 2170d56630e8..982b1ad33287 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -277,10 +277,6 @@ no-dot-config-targets := $(clean-targets) \
>  			 $(version_h) headers headers_% archheaders archscripts \
>  			 %asm-generic kernelversion %src-pkg dt_binding_check \
>  			 outputmakefile rustavailable rustfmt rustfmtcheck
> -# Installation targets should not require compiler. Unfortunately, vdso_install
> -# is an exception where build artifacts may be updated. This must be fixed.
> -no-compiler-targets := $(no-dot-config-targets) install dtbs_install \
> -			headers_install modules_install modules_sign kernelrelease image_name
>  no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
>  			  image_name
>  single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %/
> @@ -288,7 +284,6 @@ single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %
>  config-build	:=
>  mixed-build	:=
>  need-config	:= 1
> -need-compiler	:= 1
>  may-sync-config	:= 1
>  single-build	:=
>  
> @@ -298,12 +293,6 @@ ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
>  	endif
>  endif
>  
> -ifneq ($(filter $(no-compiler-targets), $(MAKECMDGOALS)),)
> -	ifeq ($(filter-out $(no-compiler-targets), $(MAKECMDGOALS)),)
> -		need-compiler :=
> -	endif
> -endif
> -

MIPS and LoongArch seem to have grown a usage of need-compiler in
4fe4a6374c4d ("MIPS: Only fiddle with CHECKFLAGS if `need-compiler'")
and 54c2c9df083f ("LoongArch: Only fiddle with CHECKFLAGS if
`need-compiler'"). With this removal, should those be updated as well?

>  ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
>  	ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
>  		may-sync-config :=
> @@ -675,7 +664,7 @@ endif
>  
>  # Include this also for config targets because some architectures need
>  # cc-cross-prefix to determine CROSS_COMPILE.
> -ifdef need-compiler
> +ifdef may-sync-config
>  include $(srctree)/scripts/Makefile.compiler
>  endif
>  
> -- 
> 2.39.2
>
Masahiro Yamada Oct. 14, 2023, 8:41 a.m. UTC | #2
On Tue, Oct 10, 2023 at 1:44 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Mon, Oct 09, 2023 at 09:42:10PM +0900, Masahiro Yamada wrote:
> > Now that vdso_install does not depend on any in-tree build artifact,
> > it no longer invokes a compiler, making no-compiler-targets the same
> > as no-sync-config-targets.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  Makefile | 13 +------------
> >  1 file changed, 1 insertion(+), 12 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 2170d56630e8..982b1ad33287 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -277,10 +277,6 @@ no-dot-config-targets := $(clean-targets) \
> >                        $(version_h) headers headers_% archheaders archscripts \
> >                        %asm-generic kernelversion %src-pkg dt_binding_check \
> >                        outputmakefile rustavailable rustfmt rustfmtcheck
> > -# Installation targets should not require compiler. Unfortunately, vdso_install
> > -# is an exception where build artifacts may be updated. This must be fixed.
> > -no-compiler-targets := $(no-dot-config-targets) install dtbs_install \
> > -                     headers_install modules_install modules_sign kernelrelease image_name
> >  no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
> >                         image_name
> >  single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %/
> > @@ -288,7 +284,6 @@ single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %
> >  config-build :=
> >  mixed-build  :=
> >  need-config  := 1
> > -need-compiler        := 1
> >  may-sync-config      := 1
> >  single-build :=
> >
> > @@ -298,12 +293,6 @@ ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
> >       endif
> >  endif
> >
> > -ifneq ($(filter $(no-compiler-targets), $(MAKECMDGOALS)),)
> > -     ifeq ($(filter-out $(no-compiler-targets), $(MAKECMDGOALS)),)
> > -             need-compiler :=
> > -     endif
> > -endif
> > -
>
> MIPS and LoongArch seem to have grown a usage of need-compiler in
> 4fe4a6374c4d ("MIPS: Only fiddle with CHECKFLAGS if `need-compiler'")
> and 54c2c9df083f ("LoongArch: Only fiddle with CHECKFLAGS if
> `need-compiler'"). With this removal, should those be updated as well?


Right, but may-sync-config and need-compiler are not
interchangeable due to the following code.

ifneq ($(KBUILD_EXTMOD),)
        may-sync-config :=
endif


I will keep both.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 2170d56630e8..982b1ad33287 100644
--- a/Makefile
+++ b/Makefile
@@ -277,10 +277,6 @@  no-dot-config-targets := $(clean-targets) \
 			 $(version_h) headers headers_% archheaders archscripts \
 			 %asm-generic kernelversion %src-pkg dt_binding_check \
 			 outputmakefile rustavailable rustfmt rustfmtcheck
-# Installation targets should not require compiler. Unfortunately, vdso_install
-# is an exception where build artifacts may be updated. This must be fixed.
-no-compiler-targets := $(no-dot-config-targets) install dtbs_install \
-			headers_install modules_install modules_sign kernelrelease image_name
 no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
 			  image_name
 single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %/
@@ -288,7 +284,6 @@  single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %
 config-build	:=
 mixed-build	:=
 need-config	:= 1
-need-compiler	:= 1
 may-sync-config	:= 1
 single-build	:=
 
@@ -298,12 +293,6 @@  ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
 	endif
 endif
 
-ifneq ($(filter $(no-compiler-targets), $(MAKECMDGOALS)),)
-	ifeq ($(filter-out $(no-compiler-targets), $(MAKECMDGOALS)),)
-		need-compiler :=
-	endif
-endif
-
 ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
 	ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
 		may-sync-config :=
@@ -675,7 +664,7 @@  endif
 
 # Include this also for config targets because some architectures need
 # cc-cross-prefix to determine CROSS_COMPILE.
-ifdef need-compiler
+ifdef may-sync-config
 include $(srctree)/scripts/Makefile.compiler
 endif