Skip to content

Commit 5e2fda4

Browse files
committed
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
2 parents f61ec2c + 10aaa3b commit 5e2fda4

File tree

29 files changed

+58
-113
lines changed

29 files changed

+58
-113
lines changed

Documentation/ia64/xen.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Getting and Building Xen and Dom0
4141

4242
5. make initrd for Dom0/DomU
4343
# 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
4545
# mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
4646
2.6.18.8-xen --builtin mptspi --builtin mptbase \
4747
--builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \

Makefile

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ifneq ($(KBUILD_OUTPUT),)
132132
# check that the output directory actually exists
133133
saved-output := $(KBUILD_OUTPUT)
134134
KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
135-
&& /bin/pwd)
135+
&& pwd)
136136
$(if $(KBUILD_OUTPUT),, \
137137
$(error failed to create output directory "$(saved-output)"))
138138

@@ -474,6 +474,38 @@ ifneq ($(KBUILD_SRC),)
474474
$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
475475
endif
476476

477+
ifeq ($(cc-name),clang)
478+
ifneq ($(CROSS_COMPILE),)
479+
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
480+
GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
481+
endif
482+
ifneq ($(GCC_TOOLCHAIN),)
483+
CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
484+
endif
485+
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
486+
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
487+
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
488+
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
489+
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
490+
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
491+
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
492+
# Quiet clang warning: comparison of unsigned expression < 0 is always false
493+
KBUILD_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
497+
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
498+
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
499+
KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
500+
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
501+
else
502+
503+
# These warnings generated too much noise in a regular build.
504+
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
505+
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
506+
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
507+
endif
508+
477509
ifeq ($(config-targets),1)
478510
# ===========================================================================
479511
# *config targets only - make sure prerequisites are updated, and descend
@@ -684,38 +716,6 @@ ifdef CONFIG_CC_STACKPROTECTOR
684716
endif
685717
KBUILD_CFLAGS += $(stackp-flag)
686718

687-
ifeq ($(cc-name),clang)
688-
ifneq ($(CROSS_COMPILE),)
689-
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
690-
GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
691-
endif
692-
ifneq ($(GCC_TOOLCHAIN),)
693-
CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
694-
endif
695-
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
696-
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
697-
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
698-
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
699-
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
700-
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
701-
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
702-
# Quiet clang warning: comparison of unsigned expression < 0 is always false
703-
KBUILD_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
707-
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
708-
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
709-
KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
710-
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
711-
else
712-
713-
# These warnings generated too much noise in a regular build.
714-
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
715-
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
716-
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
717-
endif
718-
719719
ifdef CONFIG_FRAME_POINTER
720720
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
721721
else
@@ -1009,7 +1009,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
10091009

10101010
PHONY += $(vmlinux-dirs)
10111011
$(vmlinux-dirs): prepare scripts
1012-
$(Q)$(MAKE) $(build)=$@
1012+
$(Q)$(MAKE) $(build)=$@ need-builtin=1
10131013

10141014
define filechk_kernel.release
10151015
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
@@ -1337,8 +1337,9 @@ package-dir := scripts/package
13371337
$(Q)$(MAKE) $(build)=$(package-dir) $@
13381338
%pkg: include/config/kernel.release FORCE
13391339
$(Q)$(MAKE) $(build)=$(package-dir) $@
1340-
rpm: include/config/kernel.release FORCE
1341-
$(Q)$(MAKE) $(build)=$(package-dir) $@
1340+
rpm: rpm-pkg
1341+
@echo " WARNING: \"rpm\" target will be removed after Linux 4.18"
1342+
@echo " Please use \"rpm-pkg\" instead."
13421343

13431344

13441345
# Brief documentation of the typical targets used
@@ -1546,9 +1547,9 @@ clean: $(clean-dirs)
15461547
$(call cmd,rmdirs)
15471548
$(call cmd,rmfiles)
15481549
@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' \
15501551
-o -name '*.ko.*' -o -name '*.dtb' -o -name '*.dtb.S' \
1551-
-o -name '*.dwo' \
1552+
-o -name '*.dwo' -o -name '*.lst' \
15521553
-o -name '*.su' \
15531554
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
15541555
-o -name '*.symtypes' -o -name 'modules.order' \

arch/arm/mach-uniphier/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
obj- += dummy.o

arch/mips/boot/dts/brcm/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,3 @@ dtb-$(CONFIG_DT_NONE) += \
3535
bcm97435svmb.dtb
3636

3737
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
38-
39-
# Force kbuild to make empty built-in.o if necessary
40-
obj- += dummy.o

arch/mips/boot/dts/cavium-octeon/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
dtb-$(CONFIG_CAVIUM_OCTEON_SOC) += octeon_3xxx.dtb octeon_68xx.dtb
33

44
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
5-
6-
# Force kbuild to make empty built-in.o if necessary
7-
obj- += dummy.o

arch/mips/boot/dts/img/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ dtb-$(CONFIG_FIT_IMAGE_FDT_BOSTON) += boston.dtb
33

44
dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb
55
obj-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb.o
6-
7-
# Force kbuild to make empty built-in.o if necessary
8-
obj- += dummy.o

arch/mips/boot/dts/ingenic/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ dtb-$(CONFIG_JZ4740_QI_LB60) += qi_lb60.dtb
33
dtb-$(CONFIG_JZ4780_CI20) += ci20.dtb
44

55
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
6-
7-
# Force kbuild to make empty built-in.o if necessary
8-
obj- += dummy.o

arch/mips/boot/dts/lantiq/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
dtb-$(CONFIG_DT_EASY50712) += easy50712.dtb
33

44
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
5-
6-
# Force kbuild to make empty built-in.o if necessary
7-
obj- += dummy.o

arch/mips/boot/dts/mti/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ dtb-$(CONFIG_MIPS_MALTA) += malta.dtb
33
dtb-$(CONFIG_LEGACY_BOARD_SEAD3) += sead3.dtb
44

55
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
6-
7-
# Force kbuild to make empty built-in.o if necessary
8-
obj- += dummy.o

arch/mips/boot/dts/netlogic/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ dtb-$(CONFIG_DT_XLP_GVP) += xlp_gvp.dtb
66
dtb-$(CONFIG_DT_XLP_RVP) += xlp_rvp.dtb
77

88
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
9-
10-
# Force kbuild to make empty built-in.o if necessary
11-
obj- += dummy.o

0 commit comments

Comments
 (0)