aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-25 13:06:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-25 13:06:30 -0500
commit5e2fda4776bb94ee47314e71cefaa8a104f8f4ab (patch)
tree56b316ddbd27ccf63c470f84dd9f0fad39b5100f
parentf61ec2c97cf8a517cd5714efc919138a9d8991cf (diff)
parent10aaa3b7e95b9649fd658ac7e9075093316425d8 (diff)
Merge tag 'kbuild-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada: - use 'pwd' instead of '/bin/pwd' for portability - clean up Makefiles - fix ld-option for clang - fix malloc'ed data size in Kconfig - fix parallel building along with coccicheck - fix a minor issue of package building - prompt to use "rpm-pkg" instead of "rpm" - clean up *.i and *.lst patterns by "make clean" * tag 'kbuild-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: drop $(extra-y) from real-objs-y kbuild: clean up *.i and *.lst patterns by make clean kbuild: rpm: prompt to use "rpm-pkg" if "rpm" target is used kbuild: pkg: use --transform option to prefix paths in tar coccinelle: fix parallel build with CHECK=scripts/coccicheck kconfig/symbol.c: use correct pointer type argument for sizeof kbuild: Set KBUILD_CFLAGS before incl. arch Makefile kbuild: remove all dummy assignments to obj- kbuild: create built-in.o automatically if parent directory wants it kbuild: /bin/pwd -> pwd
-rw-r--r--Documentation/ia64/xen.txt2
-rw-r--r--Makefile77
-rw-r--r--arch/arm/mach-uniphier/Makefile1
-rw-r--r--arch/mips/boot/dts/brcm/Makefile3
-rw-r--r--arch/mips/boot/dts/cavium-octeon/Makefile3
-rw-r--r--arch/mips/boot/dts/img/Makefile3
-rw-r--r--arch/mips/boot/dts/ingenic/Makefile3
-rw-r--r--arch/mips/boot/dts/lantiq/Makefile3
-rw-r--r--arch/mips/boot/dts/mti/Makefile3
-rw-r--r--arch/mips/boot/dts/netlogic/Makefile3
-rw-r--r--arch/mips/boot/dts/ni/Makefile3
-rw-r--r--arch/mips/boot/dts/pic32/Makefile3
-rw-r--r--arch/mips/boot/dts/qca/Makefile3
-rw-r--r--arch/mips/boot/dts/ralink/Makefile3
-rw-r--r--arch/mips/boot/dts/xilfpga/Makefile3
-rw-r--r--firmware/Makefile3
-rw-r--r--samples/bpf/Makefile3
-rw-r--r--samples/hidraw/Makefile3
-rw-r--r--samples/seccomp/Makefile3
-rw-r--r--samples/sockmap/Makefile3
-rw-r--r--samples/statx/Makefile3
-rw-r--r--samples/uhid/Makefile3
-rw-r--r--scripts/Makefile.build4
-rw-r--r--scripts/Makefile.lib2
-rwxr-xr-xscripts/coccicheck15
-rw-r--r--scripts/kconfig/symbol.c2
-rw-r--r--scripts/package/Makefile7
-rw-r--r--tools/power/cpupower/Makefile2
-rw-r--r--tools/scripts/Makefile.include2
29 files changed, 58 insertions, 113 deletions
diff --git a/Documentation/ia64/xen.txt b/Documentation/ia64/xen.txt
index c61a99f7c8bb..a12c74ce2773 100644
--- a/Documentation/ia64/xen.txt
+++ b/Documentation/ia64/xen.txt
@@ -41,7 +41,7 @@ Getting and Building Xen and Dom0
41 41
42 5. make initrd for Dom0/DomU 42 5. make initrd for Dom0/DomU
43 # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \ 43 # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
44 O=$(/bin/pwd)/build-linux-2.6.18-xen_ia64 44 O=$(pwd)/build-linux-2.6.18-xen_ia64
45 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \ 45 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
46 2.6.18.8-xen --builtin mptspi --builtin mptbase \ 46 2.6.18.8-xen --builtin mptspi --builtin mptbase \
47 --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \ 47 --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
diff --git a/Makefile b/Makefile
index efb942ad0b55..60753f2a477b 100644
--- a/Makefile
+++ b/Makefile
@@ -132,7 +132,7 @@ ifneq ($(KBUILD_OUTPUT),)
132# check that the output directory actually exists 132# check that the output directory actually exists
133saved-output := $(KBUILD_OUTPUT) 133saved-output := $(KBUILD_OUTPUT)
134KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ 134KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
135 && /bin/pwd) 135 && pwd)
136$(if $(KBUILD_OUTPUT),, \ 136$(if $(KBUILD_OUTPUT),, \
137 $(error failed to create output directory "$(saved-output)")) 137 $(error failed to create output directory "$(saved-output)"))
138 138
@@ -474,6 +474,38 @@ ifneq ($(KBUILD_SRC),)
474 $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) 474 $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
475endif 475endif
476 476
477ifeq ($(cc-name),clang)
478ifneq ($(CROSS_COMPILE),)
479CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
480GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
481endif
482ifneq ($(GCC_TOOLCHAIN),)
483CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
484endif
485KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
486KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
487KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
488KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
489KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
490KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
491KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
492# Quiet clang warning: comparison of unsigned expression < 0 is always false
493KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
494# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
495# source of a reference will be _MergedGlobals and not on of the whitelisted names.
496# See modpost pattern 2
497KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
498KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
499KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
500KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
501else
502
503# These warnings generated too much noise in a regular build.
504# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
505KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
506KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
507endif
508
477ifeq ($(config-targets),1) 509ifeq ($(config-targets),1)
478# =========================================================================== 510# ===========================================================================
479# *config targets only - make sure prerequisites are updated, and descend 511# *config targets only - make sure prerequisites are updated, and descend
@@ -684,38 +716,6 @@ ifdef CONFIG_CC_STACKPROTECTOR
684endif 716endif
685KBUILD_CFLAGS += $(stackp-flag) 717KBUILD_CFLAGS += $(stackp-flag)
686 718
687ifeq ($(cc-name),clang)
688ifneq ($(CROSS_COMPILE),)
689CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
690GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
691endif
692ifneq ($(GCC_TOOLCHAIN),)
693CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
694endif
695KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
696KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
697KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
698KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
699KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
700KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
701KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
702# Quiet clang warning: comparison of unsigned expression < 0 is always false
703KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
704# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
705# source of a reference will be _MergedGlobals and not on of the whitelisted names.
706# See modpost pattern 2
707KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
708KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
709KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
710KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
711else
712
713# These warnings generated too much noise in a regular build.
714# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
715KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
716KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
717endif
718
719ifdef CONFIG_FRAME_POINTER 719ifdef CONFIG_FRAME_POINTER
720KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls 720KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
721else 721else
@@ -1009,7 +1009,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
1009 1009
1010PHONY += $(vmlinux-dirs) 1010PHONY += $(vmlinux-dirs)
1011$(vmlinux-dirs): prepare scripts 1011$(vmlinux-dirs): prepare scripts
1012 $(Q)$(MAKE) $(build)=$@ 1012 $(Q)$(MAKE) $(build)=$@ need-builtin=1
1013 1013
1014define filechk_kernel.release 1014define filechk_kernel.release
1015 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" 1015 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
@@ -1337,8 +1337,9 @@ package-dir := scripts/package
1337 $(Q)$(MAKE) $(build)=$(package-dir) $@ 1337 $(Q)$(MAKE) $(build)=$(package-dir) $@
1338%pkg: include/config/kernel.release FORCE 1338%pkg: include/config/kernel.release FORCE
1339 $(Q)$(MAKE) $(build)=$(package-dir) $@ 1339 $(Q)$(MAKE) $(build)=$(package-dir) $@
1340rpm: include/config/kernel.release FORCE 1340rpm: rpm-pkg
1341 $(Q)$(MAKE) $(build)=$(package-dir) $@ 1341 @echo " WARNING: \"rpm\" target will be removed after Linux 4.18"
1342 @echo " Please use \"rpm-pkg\" instead."
1342 1343
1343 1344
1344# Brief documentation of the typical targets used 1345# Brief documentation of the typical targets used
@@ -1546,9 +1547,9 @@ clean: $(clean-dirs)
1546 $(call cmd,rmdirs) 1547 $(call cmd,rmdirs)
1547 $(call cmd,rmfiles) 1548 $(call cmd,rmfiles)
1548 @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ 1549 @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
1549 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1550 \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
1550 -o -name '*.ko.*' -o -name '*.dtb' -o -name '*.dtb.S' \ 1551 -o -name '*.ko.*' -o -name '*.dtb' -o -name '*.dtb.S' \
1551 -o -name '*.dwo' \ 1552 -o -name '*.dwo' -o -name '*.lst' \
1552 -o -name '*.su' \ 1553 -o -name '*.su' \
1553 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1554 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
1554 -o -name '*.symtypes' -o -name 'modules.order' \ 1555 -o -name '*.symtypes' -o -name 'modules.order' \
diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index 6bea3d3a2dd7..e69de29bb2d1 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -1 +0,0 @@
1obj- += dummy.o
diff --git a/arch/mips/boot/dts/brcm/Makefile b/arch/mips/boot/dts/brcm/Makefile
index 09ba7e894bad..d8787c9a499e 100644
--- a/arch/mips/boot/dts/brcm/Makefile
+++ b/arch/mips/boot/dts/brcm/Makefile
@@ -35,6 +35,3 @@ dtb-$(CONFIG_DT_NONE) += \
35 bcm97435svmb.dtb 35 bcm97435svmb.dtb
36 36
37obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 37obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
38
39# Force kbuild to make empty built-in.o if necessary
40obj- += dummy.o
diff --git a/arch/mips/boot/dts/cavium-octeon/Makefile b/arch/mips/boot/dts/cavium-octeon/Makefile
index f5d01b31df50..24a8efcd7b03 100644
--- a/arch/mips/boot/dts/cavium-octeon/Makefile
+++ b/arch/mips/boot/dts/cavium-octeon/Makefile
@@ -2,6 +2,3 @@
2dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb 2dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb
3 3
4obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 4obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
5
6# Force kbuild to make empty built-in.o if necessary
7obj- += dummy.o
diff --git a/arch/mips/boot/dts/img/Makefile b/arch/mips/boot/dts/img/Makefile
index 3eb2597a4d6c..441a3c16efb0 100644
--- a/arch/mips/boot/dts/img/Makefile
+++ b/arch/mips/boot/dts/img/Makefile
@@ -3,6 +3,3 @@ dtb-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += boston.dtb
3 3
4dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb 4dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb
5obj-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb.o 5obj-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb.o
6
7# Force kbuild to make empty built-in.o if necessary
8obj- += dummy.o
diff --git a/arch/mips/boot/dts/ingenic/Makefile b/arch/mips/boot/dts/ingenic/Makefile
index 035769269cbc..6a31759839b4 100644
--- a/arch/mips/boot/dts/ingenic/Makefile
+++ b/arch/mips/boot/dts/ingenic/Makefile
@@ -3,6 +3,3 @@ dtb-$(CONFIG_JZ4740_QI_LB60) += qi_lb60.dtb
3dtb-$(CONFIG_JZ4780_CI20) += ci20.dtb 3dtb-$(CONFIG_JZ4780_CI20) += ci20.dtb
4 4
5obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 5obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
6
7# Force kbuild to make empty built-in.o if necessary
8obj- += dummy.o
diff --git a/arch/mips/boot/dts/lantiq/Makefile b/arch/mips/boot/dts/lantiq/Makefile
index 00e2e540ed3f..51ab9c1dff42 100644
--- a/arch/mips/boot/dts/lantiq/Makefile
+++ b/arch/mips/boot/dts/lantiq/Makefile
@@ -2,6 +2,3 @@
2dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb 2dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb
3 3
4obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 4obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
5
6# Force kbuild to make empty built-in.o if necessary
7obj- += dummy.o
diff --git a/arch/mips/boot/dts/mti/Makefile b/arch/mips/boot/dts/mti/Makefile
index 480af498a9dd..3508720cb6d9 100644
--- a/arch/mips/boot/dts/mti/Makefile
+++ b/arch/mips/boot/dts/mti/Makefile
@@ -3,6 +3,3 @@ dtb-$(CONFIG_MIPS_MALTA) += malta.dtb
3dtb-$(CONFIG_LEGACY_BOARD_SEAD3) += sead3.dtb 3dtb-$(CONFIG_LEGACY_BOARD_SEAD3) += sead3.dtb
4 4
5obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 5obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
6
7# Force kbuild to make empty built-in.o if necessary
8obj- += dummy.o
diff --git a/arch/mips/boot/dts/netlogic/Makefile b/arch/mips/boot/dts/netlogic/Makefile
index 2b99450d7433..d630b27950f0 100644
--- a/arch/mips/boot/dts/netlogic/Makefile
+++ b/arch/mips/boot/dts/netlogic/Makefile
@@ -6,6 +6,3 @@ dtb-$(CONFIG_DT_XLP_GVP) += xlp_gvp.dtb
6dtb-$(CONFIG_DT_XLP_RVP) += xlp_rvp.dtb 6dtb-$(CONFIG_DT_XLP_RVP) += xlp_rvp.dtb
7 7
8obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 8obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
9
10# Force kbuild to make empty built-in.o if necessary
11obj- += dummy.o
diff --git a/arch/mips/boot/dts/ni/Makefile b/arch/mips/boot/dts/ni/Makefile
index 6cd9c606f025..9e2c9faede47 100644
--- a/arch/mips/boot/dts/ni/Makefile
+++ b/arch/mips/boot/dts/ni/Makefile
@@ -1,4 +1 @@
1dtb-$(CONFIG_FIT_IMAGE_FDT_NI169445) += 169445.dtb dtb-$(CONFIG_FIT_IMAGE_FDT_NI169445) += 169445.dtb
2
3# Force kbuild to make empty built-in.o if necessary
4obj- += dummy.o
diff --git a/arch/mips/boot/dts/pic32/Makefile b/arch/mips/boot/dts/pic32/Makefile
index a139a0fbd7b7..ba9bcef8fde9 100644
--- a/arch/mips/boot/dts/pic32/Makefile
+++ b/arch/mips/boot/dts/pic32/Makefile
@@ -5,6 +5,3 @@ dtb-$(CONFIG_DTB_PIC32_NONE) += \
5 pic32mzda_sk.dtb 5 pic32mzda_sk.dtb
6 6
7obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 7obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
8
9# Force kbuild to make empty built-in.o if necessary
10obj- += dummy.o
diff --git a/arch/mips/boot/dts/qca/Makefile b/arch/mips/boot/dts/qca/Makefile
index 639adeac90af..4451cf45b0ad 100644
--- a/arch/mips/boot/dts/qca/Makefile
+++ b/arch/mips/boot/dts/qca/Makefile
@@ -5,6 +5,3 @@ dtb-$(CONFIG_ATH79) += ar9331_dpt_module.dtb
5dtb-$(CONFIG_ATH79) += ar9331_dragino_ms14.dtb 5dtb-$(CONFIG_ATH79) += ar9331_dragino_ms14.dtb
6dtb-$(CONFIG_ATH79) += ar9331_omega.dtb 6dtb-$(CONFIG_ATH79) += ar9331_omega.dtb
7dtb-$(CONFIG_ATH79) += ar9331_tl_mr3020.dtb 7dtb-$(CONFIG_ATH79) += ar9331_tl_mr3020.dtb
8
9# Force kbuild to make empty built-in.o if necessary
10obj- += dummy.o
diff --git a/arch/mips/boot/dts/ralink/Makefile b/arch/mips/boot/dts/ralink/Makefile
index 323c8bcfb602..94bee5b38b53 100644
--- a/arch/mips/boot/dts/ralink/Makefile
+++ b/arch/mips/boot/dts/ralink/Makefile
@@ -7,6 +7,3 @@ dtb-$(CONFIG_DTB_OMEGA2P) += omega2p.dtb
7dtb-$(CONFIG_DTB_VOCORE2) += vocore2.dtb 7dtb-$(CONFIG_DTB_VOCORE2) += vocore2.dtb
8 8
9obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 9obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
10
11# Force kbuild to make empty built-in.o if necessary
12obj- += dummy.o
diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
index 616322405ade..9987e0e378c5 100644
--- a/arch/mips/boot/dts/xilfpga/Makefile
+++ b/arch/mips/boot/dts/xilfpga/Makefile
@@ -2,6 +2,3 @@
2dtb-$(CONFIG_FIT_IMAGE_FDT_XILFPGA) += nexys4ddr.dtb 2dtb-$(CONFIG_FIT_IMAGE_FDT_XILFPGA) += nexys4ddr.dtb
3 3
4obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y)) 4obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
5
6# Force kbuild to make empty built-in.o if necessary
7obj- += dummy.o
diff --git a/firmware/Makefile b/firmware/Makefile
index 168094a3fae7..29641383e136 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -59,6 +59,3 @@ endif
59 59
60targets := $(patsubst $(obj)/%,%, \ 60targets := $(patsubst $(obj)/%,%, \
61 $(shell find $(obj) -name \*.gen.S 2>/dev/null)) 61 $(shell find $(obj) -name \*.gen.S 2>/dev/null))
62# Without this, built-in.o won't be created when it's empty, and the
63# final vmlinux link will fail.
64obj- := dummy
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 3b4945c1eab0..adeaa1302f34 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -1,7 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# kbuild trick to avoid linker error. Can be omitted if a module is built.
3obj- := dummy.o
4
5# List of programs to build 2# List of programs to build
6hostprogs-y := test_lru_dist 3hostprogs-y := test_lru_dist
7hostprogs-y += sock_example 4hostprogs-y += sock_example
diff --git a/samples/hidraw/Makefile b/samples/hidraw/Makefile
index f5c3012ffa79..dec1b22adf54 100644
--- a/samples/hidraw/Makefile
+++ b/samples/hidraw/Makefile
@@ -1,7 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# kbuild trick to avoid linker error. Can be omitted if a module is built.
3obj- := dummy.o
4
5# List of programs to build 2# List of programs to build
6hostprogs-y := hid-example 3hostprogs-y := hid-example
7 4
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index 19a870eed82b..0e349b80686e 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -1,7 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# kbuild trick to avoid linker error. Can be omitted if a module is built.
3obj- := dummy.o
4
5hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct 2hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct
6 3
7HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include 4HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
diff --git a/samples/sockmap/Makefile b/samples/sockmap/Makefile
index 9291ab8e0f8c..73f1da4d116c 100644
--- a/samples/sockmap/Makefile
+++ b/samples/sockmap/Makefile
@@ -1,6 +1,3 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build 1# List of programs to build
5hostprogs-y := sockmap 2hostprogs-y := sockmap
6 3
diff --git a/samples/statx/Makefile b/samples/statx/Makefile
index 1f80a3d8cf45..59df7c25a9d1 100644
--- a/samples/statx/Makefile
+++ b/samples/statx/Makefile
@@ -1,6 +1,3 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build 1# List of programs to build
5hostprogs-$(CONFIG_SAMPLE_STATX) := test-statx 2hostprogs-$(CONFIG_SAMPLE_STATX) := test-statx
6 3
diff --git a/samples/uhid/Makefile b/samples/uhid/Makefile
index c95a696560a7..8d7fd6190ac4 100644
--- a/samples/uhid/Makefile
+++ b/samples/uhid/Makefile
@@ -1,6 +1,3 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build 1# List of programs to build
5hostprogs-y := uhid-example 2hostprogs-y := uhid-example
6 3
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 65ea1e6aaaf6..cb8997ed0149 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -76,7 +76,7 @@ lib-target := $(obj)/lib.a
76obj-y += $(obj)/lib-ksyms.o 76obj-y += $(obj)/lib-ksyms.o
77endif 77endif
78 78
79ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),) 79ifneq ($(strip $(obj-y) $(need-builtin)),)
80builtin-target := $(obj)/built-in.o 80builtin-target := $(obj)/built-in.o
81endif 81endif
82 82
@@ -566,7 +566,7 @@ targets := $(filter-out $(PHONY), $(targets))
566 566
567PHONY += $(subdir-ym) 567PHONY += $(subdir-ym)
568$(subdir-ym): 568$(subdir-ym):
569 $(Q)$(MAKE) $(build)=$@ 569 $(Q)$(MAKE) $(build)=$@ need-builtin=$(if $(findstring $@,$(subdir-obj-y)),1)
570 570
571# Add FORCE to the prequisites of a target to force it to be always rebuilt. 571# Add FORCE to the prequisites of a target to force it to be always rebuilt.
572# --------------------------------------------------------------------------- 572# ---------------------------------------------------------------------------
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 08eb40a7729f..1ca4dcd2d500 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -57,7 +57,7 @@ multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y)))
57subdir-obj-y := $(filter %/built-in.o, $(obj-y)) 57subdir-obj-y := $(filter %/built-in.o, $(obj-y))
58 58
59# Replace multi-part objects by their individual parts, look at local dir only 59# Replace multi-part objects by their individual parts, look at local dir only
60real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y) 60real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
61real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) 61real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
62 62
63# DTB 63# DTB
diff --git a/scripts/coccicheck b/scripts/coccicheck
index d5f28d5044e7..ecfac64b39fe 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -30,12 +30,6 @@ else
30 VERBOSE=0 30 VERBOSE=0
31fi 31fi
32 32
33if [ -z "$J" ]; then
34 NPROC=$(getconf _NPROCESSORS_ONLN)
35else
36 NPROC="$J"
37fi
38
39FLAGS="--very-quiet" 33FLAGS="--very-quiet"
40 34
41# You can use SPFLAGS to append extra arguments to coccicheck or override any 35# You can use SPFLAGS to append extra arguments to coccicheck or override any
@@ -70,6 +64,9 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
70 # Take only the last argument, which is the C file to test 64 # Take only the last argument, which is the C file to test
71 shift $(( $# - 1 )) 65 shift $(( $# - 1 ))
72 OPTIONS="$COCCIINCLUDE $1" 66 OPTIONS="$COCCIINCLUDE $1"
67
68 # No need to parallelize Coccinelle since this mode takes one input file.
69 NPROC=1
73else 70else
74 ONLINE=0 71 ONLINE=0
75 if [ "$KBUILD_EXTMOD" = "" ] ; then 72 if [ "$KBUILD_EXTMOD" = "" ] ; then
@@ -77,6 +74,12 @@ else
77 else 74 else
78 OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE" 75 OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
79 fi 76 fi
77
78 if [ -z "$J" ]; then
79 NPROC=$(getconf _NPROCESSORS_ONLN)
80 else
81 NPROC="$J"
82 fi
80fi 83fi
81 84
82if [ "$KBUILD_EXTMOD" != "" ] ; then 85if [ "$KBUILD_EXTMOD" != "" ] ; then
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 20136ffefb23..3c8bd9bb4267 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -1061,7 +1061,7 @@ struct symbol **sym_re_search(const char *pattern)
1061 } 1061 }
1062 if (sym_match_arr) { 1062 if (sym_match_arr) {
1063 qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp); 1063 qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp);
1064 sym_arr = malloc((cnt+1) * sizeof(struct symbol)); 1064 sym_arr = malloc((cnt+1) * sizeof(struct symbol *));
1065 if (!sym_arr) 1065 if (!sym_arr)
1066 goto sym_re_search_free; 1066 goto sym_re_search_free;
1067 for (i = 0; i < cnt; i++) 1067 for (i = 0; i < cnt; i++)
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 9ed96aefc72d..c23534925b38 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -39,14 +39,13 @@ if test "$(objtree)" != "$(srctree)"; then \
39 false; \ 39 false; \
40fi ; \ 40fi ; \
41$(srctree)/scripts/setlocalversion --save-scmversion; \ 41$(srctree)/scripts/setlocalversion --save-scmversion; \
42ln -sf $(srctree) $(2); \
43tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \ 42tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
44 $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \ 43 --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
45rm -f $(2) $(objtree)/.scmversion 44rm -f $(objtree)/.scmversion
46 45
47# rpm-pkg 46# rpm-pkg
48# --------------------------------------------------------------------------- 47# ---------------------------------------------------------------------------
49rpm-pkg rpm: FORCE 48rpm-pkg: FORCE
50 $(MAKE) clean 49 $(MAKE) clean
51 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec 50 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
52 $(call cmd,src_tar,$(KERNELPATH),kernel.spec) 51 $(call cmd,src_tar,$(KERNELPATH),kernel.spec)
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index da205d1fa03c..1dd5f4fcffd5 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -26,7 +26,7 @@ endif
26 26
27ifneq ($(OUTPUT),) 27ifneq ($(OUTPUT),)
28# check that the output directory actually exists 28# check that the output directory actually exists
29OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) 29OUTDIR := $(shell cd $(OUTPUT) && pwd)
30$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) 30$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
31endif 31endif
32 32
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 654efd9768fd..3fab179b1aba 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -13,7 +13,7 @@ endif
13 13
14# check that the output directory actually exists 14# check that the output directory actually exists
15ifneq ($(OUTPUT),) 15ifneq ($(OUTPUT),)
16OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) 16OUTDIR := $(shell cd $(OUTPUT) && pwd)
17$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) 17$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
18endif 18endif
19 19