History

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

Linus Torvalds committed 8 years ago

Commit 5e2fda42 parents f61ec2c 10aaa3b29 files · +58 −113Browse files

Showing the changes to scripts (5 of 29 files). Show all

Unified · Split

5 files
  1. scripts/Makefile.build +2 −2
  2. scripts/Makefile.lib +1 −1
  3. scripts/coccicheck +9 −6
  4. scripts/kconfig/symbol.c +1 −1
  5. scripts/package/Makefile +3 −4
scripts/Makefile.build+2−2
@@ -76,7 +76,7 @@ lib-target := $(obj)/lib.a · 75 unmodified lines
7676 obj-y += $(obj)/lib-ksyms.o
7777 endif
7878
79−ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
79+ifneq ($(strip $(obj-y) $(need-builtin)),)
8080 builtin-target := $(obj)/built-in.o
8181 endif
8282
@@ -566,7 +566,7 @@ targets := $(filter-out $(PHONY), $(targets)) · 483 unmodified lines
566566
567567 PHONY += $(subdir-ym)
568568 $(subdir-ym):
569− $(Q)$(MAKE) $(build)=$@
569+ $(Q)$(MAKE) $(build)=$@ need-builtin=$(if $(findstring $@,$(subdir-obj-y)),1)
570570
571571 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
572572 # ---------------------------------------------------------------------------
scripts/Makefile.lib+1−1
@@ -57,7 +57,7 @@ multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y))) · 56 unmodified lines
5757 subdir-obj-y := $(filter %/built-in.o, $(obj-y))
5858
5959 # Replace multi-part objects by their individual parts, look at local dir only
60−real-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)
60+real-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)))
6161 real-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)))
6262
6363 # DTB
scripts/coccicheck+9−6
@@ -30,12 +30,6 @@ else · 29 unmodified lines
3030 VERBOSE=0
3131 fi
3232
33−if [ -z "$J" ]; then
34− NPROC=$(getconf _NPROCESSORS_ONLN)
35−else
36− NPROC="$J"
37−fi
38−
3933 FLAGS="--very-quiet"
4034
4135 # You can use SPFLAGS to append extra arguments to coccicheck or override any
@@ -70,6 +64,9 @@ if [ "$C" = "1" -o "$C" = "2" ]; then · 28 unmodified lines
7064 # Take only the last argument, which is the C file to test
7165 shift $(( $# - 1 ))
7266 OPTIONS="$COCCIINCLUDE $1"
67+
68+ # No need to parallelize Coccinelle since this mode takes one input file.
69+ NPROC=1
7370 else
7471 ONLINE=0
7572 if [ "$KBUILD_EXTMOD" = "" ] ; then
@@ -77,6 +74,12 @@ else · 1 unmodified line
7774 else
7875 OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
7976 fi
77+
78+ if [ -z "$J" ]; then
79+ NPROC=$(getconf _NPROCESSORS_ONLN)
80+ else
81+ NPROC="$J"
82+ fi
8083 fi
8184
8285 if [ "$KBUILD_EXTMOD" != "" ] ; then
scripts/kconfig/symbol.c+1−1
@@ -1061,7 +1061,7 @@ struct symbol **sym_re_search(const char *pattern) · 1060 unmodified lines
10611061 }
10621062 if (sym_match_arr) {
10631063 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 *));
10651065 if (!sym_arr)
10661066 goto sym_re_search_free;
10671067 for (i = 0; i < cnt; i++)
scripts/package/Makefile+3−4
@@ -39,14 +39,13 @@ if test "$(objtree)" != "$(srctree)"; then \ · 38 unmodified lines
3939 false; \
4040 fi ; \
4141 $(srctree)/scripts/setlocalversion --save-scmversion; \
42−ln -sf $(srctree) $(2); \
4342 tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
44− $(addprefix $(2)/,$(TAR_CONTENT) $(3)); \
45−rm -f $(2) $(objtree)/.scmversion
43+ --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
44+rm -f $(objtree)/.scmversion
4645
4746 # rpm-pkg
4847 # ---------------------------------------------------------------------------
49−rpm-pkg rpm: FORCE
48+rpm-pkg: FORCE
5049 $(MAKE) clean
5150 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
5251 $(call cmd,src_tar,$(KERNELPATH),kernel.spec)