From 473fc279c898d113cc5eff656efbbf08e1bea1d3 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 17 Jun 2021 18:07:25 -0400 Subject: kconfig / kbuild: Re-sync with Linux 4.20 Align Kconfig and Kbuild logic to Linux 4.20 release with minimal impact on files outside of this scope. Our previous Kconfig sync was done by commit 587e4a429698 ("kconfig / kbuild: Re-sync with Linux 4.19"). As part of this re-sync, a few related changes from previous Linux releases were found to have been missed and merged in, and are not in the following list. The imported Linux commits are: [From prior to v4.19] b1e0d8b70fa3 kbuild: Fix gcc -x syntax a4353898980c kconfig: add CC_IS_GCC and GCC_VERSION 469cb7376c06 kconfig: add CC_IS_CLANG and CLANG_VERSION [From v4.19 to v4.20] 487c7c7702ab kbuild: prefix Makefile.dtbinst path with $(srctree) unconditionally 0d91bf584fe5 kbuild: remove old check for CFLAGS use 25815cf5ffec kbuild: hide most of targets when running config or mixed targets 00d78ab2ba75 kbuild: remove dead code in cmd_files calculation in top Makefile 23066c3f4e21 Compiler Attributes: enable -Wstringop-truncation on W=1 (gcc >= 8) 37c8a5fafa3b kbuild: consolidate Devicetree dtb build rules 80463f1b7bf9 kbuild: add --include-dir flag only for out-of-tree build 77ec0c20c7e0 kbuild: remove VERSION and PATCHLEVEL from $(objtree)/Makefile 74bc0c09b2da kbuild: remove user ID check in scripts/mkmakefile 4fd61277f662 kbuild: do not pass $(objtree) to scripts/mkmakefile 80d0dda3a4e5 kbuild: simplify command line creation in scripts/mkmakefile fb073a4b473e kbuild: add -Wno-pointer-sign flag unconditionally 9df3e7a7d7d6 kbuild: add -Wno-unused-but-set-variable flag unconditionally 69ea912fda74 kbuild: remove unneeded link_multi_deps 7d0ea2524202 kbuild: use 'else ifeq' for checksrc to improve readability 04c459d20448 kconfig: remove oldnoconfig target 0085b4191f3e kconfig: remove silentoldconfig target 3f80babd9ca4 kbuild: remove unused cc-fullversion variable 2cd3faf87d2d merge_config.sh: Allow to define config prefix 076f421da5d4 kbuild: replace cc-name test with CONFIG_CC_IS_CLANG 6bbe4385d035 kconfig: merge_config: avoid false positive matches from comment lines [From post v4.20] 885480b08469 Makefile: Move -Wno-unused-but-set-variable out of GCC only block There are a number of changes related to additional warnings as well as being able to drop cc-name entirely that have been omitted for now as additional work is required first. Cc: Masahiro Yamada Signed-off-by: Tom Rini --- scripts/Makefile.build | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) (limited to 'scripts/Makefile.build') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 7e59ca54cd0..5df8f61aa58 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -48,9 +48,6 @@ include scripts/Makefile.uncmd_spl include scripts/Kbuild.include -# For backward compatibility check that these variables do not change -save-cflags := $(CFLAGS) - # The filename Kbuild has precedence over Makefile kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) @@ -61,13 +58,6 @@ asflags-y += $(PLATFORM_CPPFLAGS) ccflags-y += $(PLATFORM_CPPFLAGS) cppflags-y += $(PLATFORM_CPPFLAGS) -# If the save-* variables changed error out -ifeq ($(KBUILD_NOPEDANTIC),) - ifneq ("$(save-cflags)","$(CFLAGS)") - $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use ccflags-y) - endif -endif - include scripts/Makefile.lib # Do not include host rules unless needed @@ -99,14 +89,12 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ @: # Linus' kernel sanity checking tool -ifneq ($(KBUILD_CHECKSRC),0) - ifeq ($(KBUILD_CHECKSRC),2) - quiet_cmd_force_checksrc = CHECK $< - cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; - else - quiet_cmd_checksrc = CHECK $< - cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; - endif +ifeq ($(KBUILD_CHECKSRC),1) + quiet_cmd_checksrc = CHECK $< + cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; +else ifeq ($(KBUILD_CHECKSRC),2) + quiet_cmd_force_checksrc = CHECK $< + cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; endif # Do section mismatch analysis for each module/built-in.o @@ -369,21 +357,8 @@ $(lib-target): $(lib-y) FORCE targets += $(lib-target) endif -# -# Rule to link composite objects -# -# Composite objects are specified in kbuild makefile as follows: -# -objs := -# or -# -y := -link_multi_deps = \ -$(filter $(addprefix $(obj)/, \ -$($(subst $(obj)/,,$(@:.o=-objs))) \ -$($(subst $(obj)/,,$(@:.o=-y)))), $^) - - quiet_cmd_link_multi-y = AR $@ -cmd_link_multi-y = rm -f $@; $(AR) cDPrsT$(KBUILD_ARFLAGS) $@ $(link_multi_deps) +cmd_link_multi-y = rm -f $@; $(AR) cDPrsT$(KBUILD_ARFLAGS) $@ $(filter %.o,$^) quiet_cmd_link_multi-m = AR [M] $@ cmd_link_multi-m = $(cmd_link_multi-y) @@ -394,7 +369,7 @@ $(call multi_depend, $(multi-used-y), .o, -objs -y) $(multi-used-m): FORCE $(call if_changed,link_multi-m) - @{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod) + @{ echo $(@:.o=.ko); echo $(filter %.o,$^); } > $(MODVERDIR)/$(@F:.o=.mod) $(call multi_depend, $(multi-used-m), .o, -objs -y) targets += $(multi-used-y) $(multi-used-m) -- cgit v1.2.3