diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-20 12:34:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-20 12:34:55 -0400 |
commit | 168c79971b4a7be7011e73bf488b740a8e1135c8 (patch) | |
tree | a8a6ac0bf4ede9d1e53063fcbc02bac40982402f | |
parent | 18253e034d2aeee140f82fc9fe89c4bce5c81799 (diff) | |
parent | 29be86d7f9cb18df4123f309ac7857570513e8bc (diff) |
Merge tag 'kbuild-v5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada:
- match the directory structure of the linux-libc-dev package to that
of Debian-based distributions
- fix incorrect include/config/auto.conf generation when Kconfig
creates it along with the .config file
- remove misleading $(AS) from documents
- clean up precious tag files by distclean instead of mrproper
- add a new coccinelle patch for devm_platform_ioremap_resource
migration
- refactor module-related scripts to read modules.order instead of
$(MODVERDIR)/*.mod files to get the list of created modules
- remove MODVERDIR
- update list of header compile-test
- add -fcf-protection=none flag to avoid conflict with the retpoline
flags when CONFIG_RETPOLINE=y
- misc cleanups
* tag 'kbuild-v5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
kbuild: add -fcf-protection=none when using retpoline flags
kbuild: update compile-test header list for v5.3-rc1
kbuild: split out *.mod out of {single,multi}-used-m rules
kbuild: remove 'prepare1' target
kbuild: remove the first line of *.mod files
kbuild: create *.mod with full directory path and remove MODVERDIR
kbuild: export_report: read modules.order instead of .tmp_versions/*.mod
kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod
kbuild: modsign: read modules.order instead of $(MODVERDIR)/*.mod
kbuild: modinst: read modules.order instead of $(MODVERDIR)/*.mod
scsi: remove pointless $(MODVERDIR)/$(obj)/53c700.ver
kbuild: remove duplication from modules.order in sub-directories
kbuild: get rid of kernel/ prefix from in-tree modules.{order,builtin}
kbuild: do not create empty modules.order in the prepare stage
coccinelle: api: add devm_platform_ioremap_resource script
kbuild: compile-test headers listed in header-test-m as well
kbuild: remove unused hostcc-option
kbuild: remove tag files by distclean instead of mrproper
kbuild: add --hash-style= and --build-id unconditionally
kbuild: get rid of misleading $(AS) from documents
...
36 files changed, 178 insertions, 173 deletions
diff --git a/.gitignore b/.gitignore index 7587ef56b92d..8f5422cba6e2 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -30,6 +30,7 @@ | |||
30 | *.lz4 | 30 | *.lz4 |
31 | *.lzma | 31 | *.lzma |
32 | *.lzo | 32 | *.lzo |
33 | *.mod | ||
33 | *.mod.c | 34 | *.mod.c |
34 | *.o | 35 | *.o |
35 | *.o.* | 36 | *.o.* |
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index 5eba889ea84d..9f4392876099 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -30,6 +30,7 @@ | |||
30 | *.lzo | 30 | *.lzo |
31 | *.mo | 31 | *.mo |
32 | *.moc | 32 | *.moc |
33 | *.mod | ||
33 | *.mod.c | 34 | *.mod.c |
34 | *.o | 35 | *.o |
35 | *.o.* | 36 | *.o.* |
diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst index ce9b99c004ae..61b2181ed3ea 100644 --- a/Documentation/kbuild/kbuild.rst +++ b/Documentation/kbuild/kbuild.rst | |||
@@ -38,12 +38,11 @@ Additional options to the assembler (for built-in and modules). | |||
38 | 38 | ||
39 | AFLAGS_MODULE | 39 | AFLAGS_MODULE |
40 | ------------- | 40 | ------------- |
41 | Additional module specific options to use for $(AS). | 41 | Additional assembler options for modules. |
42 | 42 | ||
43 | AFLAGS_KERNEL | 43 | AFLAGS_KERNEL |
44 | ------------- | 44 | ------------- |
45 | Additional options for $(AS) when used for assembler | 45 | Additional assembler options for built-in. |
46 | code for code that is compiled as built-in. | ||
47 | 46 | ||
48 | KCFLAGS | 47 | KCFLAGS |
49 | ------- | 48 | ------- |
diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst index f31158457753..f4f0f7ffde2b 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst | |||
@@ -328,7 +328,7 @@ more details, with real examples. | |||
328 | variable $(KBUILD_CFLAGS) and uses it for compilation flags for the | 328 | variable $(KBUILD_CFLAGS) and uses it for compilation flags for the |
329 | entire tree. | 329 | entire tree. |
330 | 330 | ||
331 | asflags-y specifies options for assembling with $(AS). | 331 | asflags-y specifies assembler options. |
332 | 332 | ||
333 | Example:: | 333 | Example:: |
334 | 334 | ||
@@ -490,7 +490,7 @@ more details, with real examples. | |||
490 | as-instr checks if the assembler reports a specific instruction | 490 | as-instr checks if the assembler reports a specific instruction |
491 | and then outputs either option1 or option2 | 491 | and then outputs either option1 or option2 |
492 | C escapes are supported in the test instruction | 492 | C escapes are supported in the test instruction |
493 | Note: as-instr-option uses KBUILD_AFLAGS for $(AS) options | 493 | Note: as-instr-option uses KBUILD_AFLAGS for assembler options |
494 | 494 | ||
495 | cc-option | 495 | cc-option |
496 | cc-option is used to check if $(CC) supports a given option, and if | 496 | cc-option is used to check if $(CC) supports a given option, and if |
@@ -906,7 +906,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
906 | vmlinux. The usage of $(call if_changed,xxx) will be described later. | 906 | vmlinux. The usage of $(call if_changed,xxx) will be described later. |
907 | 907 | ||
908 | KBUILD_AFLAGS | 908 | KBUILD_AFLAGS |
909 | $(AS) assembler flags | 909 | Assembler flags |
910 | 910 | ||
911 | Default value - see top level Makefile | 911 | Default value - see top level Makefile |
912 | Append or modify as required per architecture. | 912 | Append or modify as required per architecture. |
@@ -949,16 +949,16 @@ When kbuild executes, the following steps are followed (roughly): | |||
949 | to 'y' when selected. | 949 | to 'y' when selected. |
950 | 950 | ||
951 | KBUILD_AFLAGS_KERNEL | 951 | KBUILD_AFLAGS_KERNEL |
952 | $(AS) options specific for built-in | 952 | Assembler options specific for built-in |
953 | 953 | ||
954 | $(KBUILD_AFLAGS_KERNEL) contains extra C compiler flags used to compile | 954 | $(KBUILD_AFLAGS_KERNEL) contains extra C compiler flags used to compile |
955 | resident kernel code. | 955 | resident kernel code. |
956 | 956 | ||
957 | KBUILD_AFLAGS_MODULE | 957 | KBUILD_AFLAGS_MODULE |
958 | Options for $(AS) when building modules | 958 | Assembler options specific for modules |
959 | 959 | ||
960 | $(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that | 960 | $(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that |
961 | are used for $(AS). | 961 | are used for assembler. |
962 | 962 | ||
963 | From commandline AFLAGS_MODULE shall be used (see kbuild.txt). | 963 | From commandline AFLAGS_MODULE shall be used (see kbuild.txt). |
964 | 964 | ||
@@ -486,11 +486,6 @@ export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | |||
486 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL | 486 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL |
487 | export KBUILD_ARFLAGS | 487 | export KBUILD_ARFLAGS |
488 | 488 | ||
489 | # When compiling out-of-tree modules, put MODVERDIR in the module | ||
490 | # tree rather than in the kernel tree. The kernel tree might | ||
491 | # even be read-only. | ||
492 | export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions | ||
493 | |||
494 | # Files to ignore in find ... statements | 489 | # Files to ignore in find ... statements |
495 | 490 | ||
496 | export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ | 491 | export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ |
@@ -887,6 +882,12 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) | |||
887 | # change __FILE__ to the relative path from the srctree | 882 | # change __FILE__ to the relative path from the srctree |
888 | KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) | 883 | KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) |
889 | 884 | ||
885 | # ensure -fcf-protection is disabled when using retpoline as it is | ||
886 | # incompatible with -mindirect-branch=thunk-extern | ||
887 | ifdef CONFIG_RETPOLINE | ||
888 | KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) | ||
889 | endif | ||
890 | |||
890 | # use the deterministic mode of AR if available | 891 | # use the deterministic mode of AR if available |
891 | KBUILD_ARFLAGS := $(call ar-option,D) | 892 | KBUILD_ARFLAGS := $(call ar-option,D) |
892 | 893 | ||
@@ -900,10 +901,8 @@ KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS) | |||
900 | KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS) | 901 | KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS) |
901 | KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS) | 902 | KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS) |
902 | 903 | ||
903 | # Use --build-id when available. | 904 | KBUILD_LDFLAGS_MODULE += --build-id |
904 | LDFLAGS_BUILD_ID := $(call ld-option, --build-id) | 905 | LDFLAGS_vmlinux += --build-id |
905 | KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) | ||
906 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) | ||
907 | 906 | ||
908 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) | 907 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) |
909 | LDFLAGS_vmlinux += $(call ld-option, -X,) | 908 | LDFLAGS_vmlinux += $(call ld-option, -X,) |
@@ -1031,8 +1030,8 @@ vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) | |||
1031 | 1030 | ||
1032 | # Recurse until adjust_autoksyms.sh is satisfied | 1031 | # Recurse until adjust_autoksyms.sh is satisfied |
1033 | PHONY += autoksyms_recursive | 1032 | PHONY += autoksyms_recursive |
1034 | autoksyms_recursive: $(vmlinux-deps) | ||
1035 | ifdef CONFIG_TRIM_UNUSED_KSYMS | 1033 | ifdef CONFIG_TRIM_UNUSED_KSYMS |
1034 | autoksyms_recursive: $(vmlinux-deps) modules.order | ||
1036 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ | 1035 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ |
1037 | "$(MAKE) -f $(srctree)/Makefile vmlinux" | 1036 | "$(MAKE) -f $(srctree)/Makefile vmlinux" |
1038 | endif | 1037 | endif |
@@ -1074,7 +1073,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; | |||
1074 | 1073 | ||
1075 | PHONY += $(vmlinux-dirs) | 1074 | PHONY += $(vmlinux-dirs) |
1076 | $(vmlinux-dirs): prepare | 1075 | $(vmlinux-dirs): prepare |
1077 | $(Q)$(MAKE) $(build)=$@ need-builtin=1 | 1076 | $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 |
1078 | 1077 | ||
1079 | filechk_kernel.release = \ | 1078 | filechk_kernel.release = \ |
1080 | echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" | 1079 | echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" |
@@ -1096,7 +1095,7 @@ scripts: scripts_basic scripts_dtc | |||
1096 | # archprepare is used in arch Makefiles and when processed asm symlink, | 1095 | # archprepare is used in arch Makefiles and when processed asm symlink, |
1097 | # version.h and scripts_basic is processed / created. | 1096 | # version.h and scripts_basic is processed / created. |
1098 | 1097 | ||
1099 | PHONY += prepare archprepare prepare1 prepare3 | 1098 | PHONY += prepare archprepare prepare3 |
1100 | 1099 | ||
1101 | # prepare3 is used to check if we are building in a separate output directory, | 1100 | # prepare3 is used to check if we are building in a separate output directory, |
1102 | # and if so do: | 1101 | # and if so do: |
@@ -1113,11 +1112,8 @@ ifdef building_out_of_srctree | |||
1113 | fi; | 1112 | fi; |
1114 | endif | 1113 | endif |
1115 | 1114 | ||
1116 | prepare1: prepare3 outputmakefile asm-generic $(version_h) $(autoksyms_h) \ | 1115 | archprepare: archheaders archscripts scripts prepare3 outputmakefile \ |
1117 | include/generated/utsrelease.h | 1116 | asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h |
1118 | $(cmd_crmodverdir) | ||
1119 | |||
1120 | archprepare: archheaders archscripts prepare1 scripts | ||
1121 | 1117 | ||
1122 | prepare0: archprepare | 1118 | prepare0: archprepare |
1123 | $(Q)$(MAKE) $(build)=scripts/mod | 1119 | $(Q)$(MAKE) $(build)=scripts/mod |
@@ -1331,8 +1327,8 @@ _modinst_: | |||
1331 | rm -f $(MODLIB)/build ; \ | 1327 | rm -f $(MODLIB)/build ; \ |
1332 | ln -s $(CURDIR) $(MODLIB)/build ; \ | 1328 | ln -s $(CURDIR) $(MODLIB)/build ; \ |
1333 | fi | 1329 | fi |
1334 | @cp -f $(objtree)/modules.order $(MODLIB)/ | 1330 | @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order |
1335 | @cp -f $(objtree)/modules.builtin $(MODLIB)/ | 1331 | @sed 's:^:kernel/:' modules.builtin > $(MODLIB)/modules.builtin |
1336 | @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ | 1332 | @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ |
1337 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst | 1333 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
1338 | 1334 | ||
@@ -1373,18 +1369,22 @@ endif # CONFIG_MODULES | |||
1373 | # make distclean Remove editor backup files, patch leftover files and the like | 1369 | # make distclean Remove editor backup files, patch leftover files and the like |
1374 | 1370 | ||
1375 | # Directories & files removed with 'make clean' | 1371 | # Directories & files removed with 'make clean' |
1376 | CLEAN_DIRS += $(MODVERDIR) include/ksym | 1372 | CLEAN_DIRS += include/ksym |
1377 | CLEAN_FILES += modules.builtin.modinfo | 1373 | CLEAN_FILES += modules.builtin.modinfo |
1378 | 1374 | ||
1379 | # Directories & files removed with 'make mrproper' | 1375 | # Directories & files removed with 'make mrproper' |
1380 | MRPROPER_DIRS += include/config include/generated \ | 1376 | MRPROPER_DIRS += include/config include/generated \ |
1381 | arch/$(SRCARCH)/include/generated .tmp_objdiff | 1377 | arch/$(SRCARCH)/include/generated .tmp_objdiff |
1382 | MRPROPER_FILES += .config .config.old .version \ | 1378 | MRPROPER_FILES += .config .config.old .version \ |
1383 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ | 1379 | Module.symvers \ |
1384 | signing_key.pem signing_key.priv signing_key.x509 \ | 1380 | signing_key.pem signing_key.priv signing_key.x509 \ |
1385 | x509.genkey extra_certificates signing_key.x509.keyid \ | 1381 | x509.genkey extra_certificates signing_key.x509.keyid \ |
1386 | signing_key.x509.signer vmlinux-gdb.py | 1382 | signing_key.x509.signer vmlinux-gdb.py |
1387 | 1383 | ||
1384 | # Directories & files removed with 'make distclean' | ||
1385 | DISTCLEAN_DIRS += | ||
1386 | DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS | ||
1387 | |||
1388 | # clean - Delete most, but leave enough to build external modules | 1388 | # clean - Delete most, but leave enough to build external modules |
1389 | # | 1389 | # |
1390 | clean: rm-dirs := $(CLEAN_DIRS) | 1390 | clean: rm-dirs := $(CLEAN_DIRS) |
@@ -1417,9 +1417,14 @@ mrproper: clean $(mrproper-dirs) | |||
1417 | 1417 | ||
1418 | # distclean | 1418 | # distclean |
1419 | # | 1419 | # |
1420 | distclean: rm-dirs := $(wildcard $(DISTCLEAN_DIRS)) | ||
1421 | distclean: rm-files := $(wildcard $(DISTCLEAN_FILES)) | ||
1422 | |||
1420 | PHONY += distclean | 1423 | PHONY += distclean |
1421 | 1424 | ||
1422 | distclean: mrproper | 1425 | distclean: mrproper |
1426 | $(call cmd,rmdirs) | ||
1427 | $(call cmd,rmfiles) | ||
1423 | @find $(srctree) $(RCS_FIND_IGNORE) \ | 1428 | @find $(srctree) $(RCS_FIND_IGNORE) \ |
1424 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ | 1429 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ |
1425 | -o -name '*.bak' -o -name '#*#' -o -name '*%' \ | 1430 | -o -name '*.bak' -o -name '#*#' -o -name '*%' \ |
@@ -1609,7 +1614,7 @@ $(objtree)/Module.symvers: | |||
1609 | module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) | 1614 | module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) |
1610 | PHONY += $(module-dirs) modules | 1615 | PHONY += $(module-dirs) modules |
1611 | $(module-dirs): prepare $(objtree)/Module.symvers | 1616 | $(module-dirs): prepare $(objtree)/Module.symvers |
1612 | $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) | 1617 | $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) need-modorder=1 |
1613 | 1618 | ||
1614 | modules: $(module-dirs) | 1619 | modules: $(module-dirs) |
1615 | @$(kecho) ' Building modules, stage 2.'; | 1620 | @$(kecho) ' Building modules, stage 2.'; |
@@ -1634,7 +1639,6 @@ PHONY += $(clean-dirs) clean | |||
1634 | $(clean-dirs): | 1639 | $(clean-dirs): |
1635 | $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) | 1640 | $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) |
1636 | 1641 | ||
1637 | clean: rm-dirs := $(MODVERDIR) | ||
1638 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers | 1642 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers |
1639 | 1643 | ||
1640 | PHONY += help | 1644 | PHONY += help |
@@ -1648,8 +1652,6 @@ help: | |||
1648 | @echo '' | 1652 | @echo '' |
1649 | 1653 | ||
1650 | PHONY += prepare | 1654 | PHONY += prepare |
1651 | prepare: | ||
1652 | $(cmd_crmodverdir) | ||
1653 | endif # KBUILD_EXTMOD | 1655 | endif # KBUILD_EXTMOD |
1654 | 1656 | ||
1655 | clean: $(clean-dirs) | 1657 | clean: $(clean-dirs) |
@@ -1660,7 +1662,7 @@ clean: $(clean-dirs) | |||
1660 | -o -name '*.ko.*' \ | 1662 | -o -name '*.ko.*' \ |
1661 | -o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ | 1663 | -o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ |
1662 | -o -name '*.dwo' -o -name '*.lst' \ | 1664 | -o -name '*.dwo' -o -name '*.lst' \ |
1663 | -o -name '*.su' \ | 1665 | -o -name '*.su' -o -name '*.mod' \ |
1664 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | 1666 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
1665 | -o -name '*.lex.c' -o -name '*.tab.[ch]' \ | 1667 | -o -name '*.lex.c' -o -name '*.tab.[ch]' \ |
1666 | -o -name '*.asn1.[ch]' \ | 1668 | -o -name '*.asn1.[ch]' \ |
@@ -1765,8 +1767,6 @@ build-dir = $(patsubst %/,%,$(dir $(build-target))) | |||
1765 | $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) | 1767 | $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) |
1766 | %.symtypes: prepare FORCE | 1768 | %.symtypes: prepare FORCE |
1767 | $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) | 1769 | $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) |
1768 | %.ko: %.o | ||
1769 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | ||
1770 | 1770 | ||
1771 | # Modules | 1771 | # Modules |
1772 | PHONY += / | 1772 | PHONY += / |
@@ -1789,11 +1789,6 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) | |||
1789 | cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ | 1789 | cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ |
1790 | $(KERNELRELEASE) | 1790 | $(KERNELRELEASE) |
1791 | 1791 | ||
1792 | # Create temporary dir for module support files | ||
1793 | # clean it up only when building all modules | ||
1794 | cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ | ||
1795 | $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) | ||
1796 | |||
1797 | # read saved command lines for existing targets | 1792 | # read saved command lines for existing targets |
1798 | existing-targets := $(wildcard $(sort $(targets))) | 1793 | existing-targets := $(wildcard $(sort $(targets))) |
1799 | 1794 | ||
diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile index ca85df247775..87b7769214e0 100644 --- a/arch/arm/vdso/Makefile +++ b/arch/arm/vdso/Makefile | |||
@@ -13,8 +13,7 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING | |||
13 | ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8 | 13 | ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8 |
14 | ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ | 14 | ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ |
15 | -z max-page-size=4096 -nostdlib -shared $(ldflags-y) \ | 15 | -z max-page-size=4096 -nostdlib -shared $(ldflags-y) \ |
16 | $(call ld-option, --hash-style=sysv) \ | 16 | --hash-style=sysv --build-id \ |
17 | $(call ld-option, --build-id) \ | ||
18 | -T | 17 | -T |
19 | 18 | ||
20 | obj-$(CONFIG_VDSO) += vdso.o | 19 | obj-$(CONFIG_VDSO) += vdso.o |
diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index 288c14d30b45..60a4c6239712 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile | |||
@@ -96,8 +96,8 @@ VDSO_LDFLAGS := $(VDSO_CPPFLAGS) | |||
96 | VDSO_LDFLAGS += -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 | 96 | VDSO_LDFLAGS += -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 |
97 | VDSO_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 | 97 | VDSO_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 |
98 | VDSO_LDFLAGS += -nostdlib -shared -mfloat-abi=soft | 98 | VDSO_LDFLAGS += -nostdlib -shared -mfloat-abi=soft |
99 | VDSO_LDFLAGS += $(call cc32-ldoption,-Wl$(comma)--hash-style=sysv) | 99 | VDSO_LDFLAGS += -Wl,--hash-style=sysv |
100 | VDSO_LDFLAGS += $(call cc32-ldoption,-Wl$(comma)--build-id) | 100 | VDSO_LDFLAGS += -Wl,--build-id |
101 | VDSO_LDFLAGS += $(call cc32-ldoption,-fuse-ld=bfd) | 101 | VDSO_LDFLAGS += $(call cc32-ldoption,-fuse-ld=bfd) |
102 | 102 | ||
103 | 103 | ||
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index f8b3b07e4247..7a117be8297c 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile | |||
@@ -34,8 +34,6 @@ else | |||
34 | KBUILD_LDFLAGS += -melf32lriscv | 34 | KBUILD_LDFLAGS += -melf32lriscv |
35 | endif | 35 | endif |
36 | 36 | ||
37 | KBUILD_CFLAGS += -Wall | ||
38 | |||
39 | # ISA string setting | 37 | # ISA string setting |
40 | riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima | 38 | riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima |
41 | riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima | 39 | riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima |
diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile index 5a9e4e1f9f81..324a23947585 100644 --- a/arch/sparc/vdso/Makefile +++ b/arch/sparc/vdso/Makefile | |||
@@ -115,8 +115,7 @@ quiet_cmd_vdso = VDSO $@ | |||
115 | -T $(filter %.lds,$^) $(filter %.o,$^) && \ | 115 | -T $(filter %.lds,$^) $(filter %.o,$^) && \ |
116 | sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@' | 116 | sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@' |
117 | 117 | ||
118 | VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \ | 118 | VDSO_LDFLAGS = -shared --hash-style=both --build-id -Bsymbolic |
119 | $(call ld-option, --build-id) -Bsymbolic | ||
120 | GCOV_PROFILE := n | 119 | GCOV_PROFILE := n |
121 | 120 | ||
122 | # | 121 | # |
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 34773395139a..8df549138193 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile | |||
@@ -176,9 +176,8 @@ quiet_cmd_vdso = VDSO $@ | |||
176 | -T $(filter %.lds,$^) $(filter %.o,$^) && \ | 176 | -T $(filter %.lds,$^) $(filter %.o,$^) && \ |
177 | sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' | 177 | sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' |
178 | 178 | ||
179 | VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \ | 179 | VDSO_LDFLAGS = -shared --hash-style=both --build-id \ |
180 | $(call ld-option, --build-id) $(call ld-option, --eh-frame-hdr) \ | 180 | $(call ld-option, --eh-frame-hdr) -Bsymbolic |
181 | -Bsymbolic | ||
182 | GCOV_PROFILE := n | 181 | GCOV_PROFILE := n |
183 | 182 | ||
184 | quiet_cmd_vdso_and_check = VDSO $@ | 183 | quiet_cmd_vdso_and_check = VDSO $@ |
diff --git a/drivers/memory/.gitignore b/drivers/memory/.gitignore new file mode 100644 index 000000000000..cbca8b028437 --- /dev/null +++ b/drivers/memory/.gitignore | |||
@@ -0,0 +1 @@ | |||
ti-emif-asm-offsets.h | |||
diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile index 9d5c409a1591..27b493435e61 100644 --- a/drivers/memory/Makefile +++ b/drivers/memory/Makefile | |||
@@ -29,9 +29,10 @@ ti-emif-sram-objs := ti-emif-pm.o ti-emif-sram-pm.o | |||
29 | 29 | ||
30 | AFLAGS_ti-emif-sram-pm.o :=-Wa,-march=armv7-a | 30 | AFLAGS_ti-emif-sram-pm.o :=-Wa,-march=armv7-a |
31 | 31 | ||
32 | drivers/memory/ti-emif-sram-pm.o: include/generated/ti-emif-asm-offsets.h | 32 | $(obj)/ti-emif-sram-pm.o: $(obj)/ti-emif-asm-offsets.h |
33 | 33 | ||
34 | include/generated/ti-emif-asm-offsets.h: drivers/memory/emif-asm-offsets.s FORCE | 34 | $(obj)/ti-emif-asm-offsets.h: $(obj)/emif-asm-offsets.s FORCE |
35 | $(call filechk,offsets,__TI_EMIF_ASM_OFFSETS_H__) | 35 | $(call filechk,offsets,__TI_EMIF_ASM_OFFSETS_H__) |
36 | 36 | ||
37 | targets += emif-asm-offsets.s | 37 | targets += emif-asm-offsets.s |
38 | clean-files += ti-emif-asm-offsets.h | ||
diff --git a/drivers/memory/ti-emif-sram-pm.S b/drivers/memory/ti-emif-sram-pm.S index d75ae18efa7d..d1c83bd5b98e 100644 --- a/drivers/memory/ti-emif-sram-pm.S +++ b/drivers/memory/ti-emif-sram-pm.S | |||
@@ -14,12 +14,12 @@ | |||
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <generated/ti-emif-asm-offsets.h> | ||
18 | #include <linux/linkage.h> | 17 | #include <linux/linkage.h> |
19 | #include <asm/assembler.h> | 18 | #include <asm/assembler.h> |
20 | #include <asm/memory.h> | 19 | #include <asm/memory.h> |
21 | 20 | ||
22 | #include "emif.h" | 21 | #include "emif.h" |
22 | #include "ti-emif-asm-offsets.h" | ||
23 | 23 | ||
24 | #define EMIF_POWER_MGMT_WAIT_SELF_REFRESH_8192_CYCLES 0x00a0 | 24 | #define EMIF_POWER_MGMT_WAIT_SELF_REFRESH_8192_CYCLES 0x00a0 |
25 | #define EMIF_POWER_MGMT_SR_TIMER_MASK 0x00f0 | 25 | #define EMIF_POWER_MGMT_SR_TIMER_MASK 0x00f0 |
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index aeda53901064..c00e3dd57990 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile | |||
@@ -185,7 +185,7 @@ zalon7xx-objs := zalon.o ncr53c8xx.o | |||
185 | # Files generated that shall be removed upon make clean | 185 | # Files generated that shall be removed upon make clean |
186 | clean-files := 53c700_d.h 53c700_u.h scsi_devinfo_tbl.c | 186 | clean-files := 53c700_d.h 53c700_u.h scsi_devinfo_tbl.c |
187 | 187 | ||
188 | $(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h | 188 | $(obj)/53c700.o: $(obj)/53c700_d.h |
189 | 189 | ||
190 | $(obj)/scsi_sysfs.o: $(obj)/scsi_devinfo_tbl.c | 190 | $(obj)/scsi_sysfs.o: $(obj)/scsi_devinfo_tbl.c |
191 | 191 | ||
diff --git a/include/Kbuild b/include/Kbuild index 7e9f1acb9dd5..c38f0d46b267 100644 --- a/include/Kbuild +++ b/include/Kbuild | |||
@@ -31,7 +31,7 @@ header-test- += acpi/platform/acintel.h | |||
31 | header-test- += acpi/platform/aclinux.h | 31 | header-test- += acpi/platform/aclinux.h |
32 | header-test- += acpi/platform/aclinuxex.h | 32 | header-test- += acpi/platform/aclinuxex.h |
33 | header-test- += acpi/processor.h | 33 | header-test- += acpi/processor.h |
34 | header-test- += clocksource/hyperv_timer.h | 34 | header-test-$(CONFIG_X86) += clocksource/hyperv_timer.h |
35 | header-test- += clocksource/timer-sp804.h | 35 | header-test- += clocksource/timer-sp804.h |
36 | header-test- += crypto/cast_common.h | 36 | header-test- += crypto/cast_common.h |
37 | header-test- += crypto/internal/cryptouser.h | 37 | header-test- += crypto/internal/cryptouser.h |
@@ -246,6 +246,7 @@ header-test- += linux/intel-pti.h | |||
246 | header-test- += linux/intel-svm.h | 246 | header-test- += linux/intel-svm.h |
247 | header-test- += linux/interconnect-provider.h | 247 | header-test- += linux/interconnect-provider.h |
248 | header-test- += linux/ioc3.h | 248 | header-test- += linux/ioc3.h |
249 | header-test-$(CONFIG_BLOCK) += linux/iomap.h | ||
249 | header-test- += linux/ipack.h | 250 | header-test- += linux/ipack.h |
250 | header-test- += linux/irq_cpustat.h | 251 | header-test- += linux/irq_cpustat.h |
251 | header-test- += linux/irq_poll.h | 252 | header-test- += linux/irq_poll.h |
@@ -454,9 +455,6 @@ header-test- += linux/phy/omap_control_phy.h | |||
454 | header-test- += linux/phy/tegra/xusb.h | 455 | header-test- += linux/phy/tegra/xusb.h |
455 | header-test- += linux/phy/ulpi_phy.h | 456 | header-test- += linux/phy/ulpi_phy.h |
456 | header-test- += linux/phy_fixed.h | 457 | header-test- += linux/phy_fixed.h |
457 | header-test- += linux/pinctrl/pinconf-generic.h | ||
458 | header-test- += linux/pinctrl/pinconf.h | ||
459 | header-test- += linux/pinctrl/pinctrl.h | ||
460 | header-test- += linux/pipe_fs_i.h | 458 | header-test- += linux/pipe_fs_i.h |
461 | header-test- += linux/pktcdvd.h | 459 | header-test- += linux/pktcdvd.h |
462 | header-test- += linux/pl320-ipc.h | 460 | header-test- += linux/pl320-ipc.h |
@@ -905,10 +903,11 @@ header-test- += net/netfilter/nf_nat_redirect.h | |||
905 | header-test- += net/netfilter/nf_queue.h | 903 | header-test- += net/netfilter/nf_queue.h |
906 | header-test- += net/netfilter/nf_reject.h | 904 | header-test- += net/netfilter/nf_reject.h |
907 | header-test- += net/netfilter/nf_synproxy.h | 905 | header-test- += net/netfilter/nf_synproxy.h |
908 | header-test- += net/netfilter/nf_tables.h | 906 | header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables.h |
909 | header-test- += net/netfilter/nf_tables_core.h | 907 | header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables_core.h |
910 | header-test- += net/netfilter/nf_tables_ipv4.h | 908 | header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables_ipv4.h |
911 | header-test- += net/netfilter/nf_tables_ipv6.h | 909 | header-test- += net/netfilter/nf_tables_ipv6.h |
910 | header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables_offload.h | ||
912 | header-test- += net/netfilter/nft_fib.h | 911 | header-test- += net/netfilter/nft_fib.h |
913 | header-test- += net/netfilter/nft_meta.h | 912 | header-test- += net/netfilter/nft_meta.h |
914 | header-test- += net/netfilter/nft_reject.h | 913 | header-test- += net/netfilter/nft_reject.h |
@@ -949,7 +948,6 @@ header-test- += pcmcia/ds.h | |||
949 | header-test- += rdma/ib.h | 948 | header-test- += rdma/ib.h |
950 | header-test- += rdma/iw_portmap.h | 949 | header-test- += rdma/iw_portmap.h |
951 | header-test- += rdma/opa_port_info.h | 950 | header-test- += rdma/opa_port_info.h |
952 | header-test- += rdma/rdma_counter.h | ||
953 | header-test- += rdma/rdmavt_cq.h | 951 | header-test- += rdma/rdmavt_cq.h |
954 | header-test- += rdma/restrack.h | 952 | header-test- += rdma/restrack.h |
955 | header-test- += rdma/signature.h | 953 | header-test- += rdma/signature.h |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index bc6673ab3a08..5960e2980a8a 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -353,23 +353,13 @@ config DEBUG_SECTION_MISMATCH | |||
353 | which results in the code/data being placed in specific sections. | 353 | which results in the code/data being placed in specific sections. |
354 | The section mismatch analysis is always performed after a full | 354 | The section mismatch analysis is always performed after a full |
355 | kernel build, and enabling this option causes the following | 355 | kernel build, and enabling this option causes the following |
356 | additional steps to occur: | 356 | additional step to occur: |
357 | - Add the option -fno-inline-functions-called-once to gcc commands. | 357 | - Add the option -fno-inline-functions-called-once to gcc commands. |
358 | When inlining a function annotated with __init in a non-init | 358 | When inlining a function annotated with __init in a non-init |
359 | function, we would lose the section information and thus | 359 | function, we would lose the section information and thus |
360 | the analysis would not catch the illegal reference. | 360 | the analysis would not catch the illegal reference. |
361 | This option tells gcc to inline less (but it does result in | 361 | This option tells gcc to inline less (but it does result in |
362 | a larger kernel). | 362 | a larger kernel). |
363 | - Run the section mismatch analysis for each module/built-in.a file. | ||
364 | When we run the section mismatch analysis on vmlinux.o, we | ||
365 | lose valuable information about where the mismatch was | ||
366 | introduced. | ||
367 | Running the analysis for each module/built-in.a file | ||
368 | tells where the mismatch happens much closer to the | ||
369 | source. The drawback is that the same mismatch is | ||
370 | reported at least twice. | ||
371 | - Enable verbose reporting from modpost in order to help resolve | ||
372 | the section mismatches that are reported. | ||
373 | 363 | ||
374 | config SECTION_MISMATCH_WARN_ONLY | 364 | config SECTION_MISMATCH_WARN_ONLY |
375 | bool "Make section mismatch errors non-fatal" | 365 | bool "Make section mismatch errors non-fatal" |
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 73e80b917f12..77c742fa4fb1 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -125,11 +125,6 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS)) | |||
125 | cc-option = $(call __cc-option, $(CC),\ | 125 | cc-option = $(call __cc-option, $(CC),\ |
126 | $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS),$(1),$(2)) | 126 | $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS),$(1),$(2)) |
127 | 127 | ||
128 | # hostcc-option | ||
129 | # Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) | ||
130 | hostcc-option = $(call __cc-option, $(HOSTCC),\ | ||
131 | $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) | ||
132 | |||
133 | # cc-option-yn | 128 | # cc-option-yn |
134 | # Usage: flag := $(call cc-option-yn,-march=winchip-c6) | 129 | # Usage: flag := $(call cc-option-yn,-march=winchip-c6) |
135 | cc-option-yn = $(call try-run,\ | 130 | cc-option-yn = $(call try-run,\ |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index be38198d98b2..0d434d0afc0b 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -63,14 +63,14 @@ ifneq ($(strip $(real-obj-y) $(need-builtin)),) | |||
63 | builtin-target := $(obj)/built-in.a | 63 | builtin-target := $(obj)/built-in.a |
64 | endif | 64 | endif |
65 | 65 | ||
66 | ifdef CONFIG_MODULES | 66 | ifeq ($(CONFIG_MODULES)$(need-modorder),y1) |
67 | modorder-target := $(obj)/modules.order | 67 | modorder-target := $(obj)/modules.order |
68 | endif | 68 | endif |
69 | 69 | ||
70 | # We keep a list of all modules in $(MODVERDIR) | 70 | mod-targets := $(patsubst %.o, %.mod, $(obj-m)) |
71 | 71 | ||
72 | __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ | 72 | __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ |
73 | $(if $(KBUILD_MODULES),$(obj-m) $(modorder-target)) \ | 73 | $(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \ |
74 | $(subdir-ym) $(always) | 74 | $(subdir-ym) $(always) |
75 | @: | 75 | @: |
76 | 76 | ||
@@ -87,11 +87,6 @@ ifneq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) | |||
87 | cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< | 87 | cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< |
88 | endif | 88 | endif |
89 | 89 | ||
90 | # Do section mismatch analysis for each module/built-in.a | ||
91 | ifdef CONFIG_DEBUG_SECTION_MISMATCH | ||
92 | cmd_secanalysis = ; scripts/mod/modpost $@ | ||
93 | endif | ||
94 | |||
95 | # Compile C sources (.c) | 90 | # Compile C sources (.c) |
96 | # --------------------------------------------------------------------------- | 91 | # --------------------------------------------------------------------------- |
97 | 92 | ||
@@ -268,7 +263,7 @@ endef | |||
268 | 263 | ||
269 | # List module undefined symbols (or empty line if not enabled) | 264 | # List module undefined symbols (or empty line if not enabled) |
270 | ifdef CONFIG_TRIM_UNUSED_KSYMS | 265 | ifdef CONFIG_TRIM_UNUSED_KSYMS |
271 | cmd_undef_syms = $(NM) $@ | sed -n 's/^ *U //p' | xargs echo | 266 | cmd_undef_syms = $(NM) $< | sed -n 's/^ *U //p' | xargs echo |
272 | else | 267 | else |
273 | cmd_undef_syms = echo | 268 | cmd_undef_syms = echo |
274 | endif | 269 | endif |
@@ -278,13 +273,15 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE | |||
278 | $(call cmd,force_checksrc) | 273 | $(call cmd,force_checksrc) |
279 | $(call if_changed_rule,cc_o_c) | 274 | $(call if_changed_rule,cc_o_c) |
280 | 275 | ||
281 | # Single-part modules are special since we need to mark them in $(MODVERDIR) | 276 | cmd_mod = { \ |
277 | echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \ | ||
278 | $(cmd_undef_syms); \ | ||
279 | } > $@ | ||
282 | 280 | ||
283 | $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE | 281 | $(obj)/%.mod: $(obj)/%.o FORCE |
284 | $(call cmd,force_checksrc) | 282 | $(call if_changed,mod) |
285 | $(call if_changed_rule,cc_o_c) | 283 | |
286 | @{ echo $(@:.o=.ko); echo $@; \ | 284 | targets += $(mod-targets) |
287 | $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) | ||
288 | 285 | ||
289 | quiet_cmd_cc_lst_c = MKLST $@ | 286 | quiet_cmd_cc_lst_c = MKLST $@ |
290 | cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ | 287 | cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ |
@@ -294,7 +291,7 @@ quiet_cmd_cc_lst_c = MKLST $@ | |||
294 | $(obj)/%.lst: $(src)/%.c FORCE | 291 | $(obj)/%.lst: $(src)/%.c FORCE |
295 | $(call if_changed_dep,cc_lst_c) | 292 | $(call if_changed_dep,cc_lst_c) |
296 | 293 | ||
297 | # header test (header-test-y target) | 294 | # header test (header-test-y, header-test-m target) |
298 | # --------------------------------------------------------------------------- | 295 | # --------------------------------------------------------------------------- |
299 | 296 | ||
300 | quiet_cmd_cc_s_h = CC $@ | 297 | quiet_cmd_cc_s_h = CC $@ |
@@ -423,13 +420,10 @@ endif # builtin-target | |||
423 | # | 420 | # |
424 | # Create commands to either record .ko file or cat modules.order from | 421 | # Create commands to either record .ko file or cat modules.order from |
425 | # a subdirectory | 422 | # a subdirectory |
426 | modorder-cmds = \ | ||
427 | $(foreach m, $(modorder), \ | ||
428 | $(if $(filter %/modules.order, $m), \ | ||
429 | cat $m;, echo kernel/$m;)) | ||
430 | |||
431 | $(modorder-target): $(subdir-ym) FORCE | 423 | $(modorder-target): $(subdir-ym) FORCE |
432 | $(Q)(cat /dev/null; $(modorder-cmds)) > $@ | 424 | $(Q){ $(foreach m, $(modorder), \ |
425 | $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \ | ||
426 | | $(AWK) '!x[$$0]++' - > $@ | ||
433 | 427 | ||
434 | # | 428 | # |
435 | # Rule to compile a set of .o files into one .a file (with symbol table) | 429 | # Rule to compile a set of .o files into one .a file (with symbol table) |
@@ -464,12 +458,10 @@ endif | |||
464 | # module is turned into a multi object module, $^ will contain header file | 458 | # module is turned into a multi object module, $^ will contain header file |
465 | # dependencies recorded in the .*.cmd file. | 459 | # dependencies recorded in the .*.cmd file. |
466 | quiet_cmd_link_multi-m = LD [M] $@ | 460 | quiet_cmd_link_multi-m = LD [M] $@ |
467 | cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis) | 461 | cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) |
468 | 462 | ||
469 | $(multi-used-m): FORCE | 463 | $(multi-used-m): FORCE |
470 | $(call if_changed,link_multi-m) | 464 | $(call if_changed,link_multi-m) |
471 | @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \ | ||
472 | $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) | ||
473 | $(call multi_depend, $(multi-used-m), .o, -objs -y -m) | 465 | $(call multi_depend, $(multi-used-m), .o, -objs -y -m) |
474 | 466 | ||
475 | targets += $(multi-used-m) | 467 | targets += $(multi-used-m) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 6cb3aa5cbc79..5241d0751eb0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -78,7 +78,7 @@ header-test-y += $(filter-out $(header-test-), \ | |||
78 | $(wildcard $(addprefix $(srctree)/$(src)/, \ | 78 | $(wildcard $(addprefix $(srctree)/$(src)/, \ |
79 | $(header-test-pattern-y))))) | 79 | $(header-test-pattern-y))))) |
80 | 80 | ||
81 | extra-$(CONFIG_HEADER_TEST) += $(addsuffix .s, $(header-test-y)) | 81 | extra-$(CONFIG_HEADER_TEST) += $(addsuffix .s, $(header-test-y) $(header-test-m)) |
82 | 82 | ||
83 | # Add subdir path | 83 | # Add subdir path |
84 | 84 | ||
diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin index 50a9990760f3..7d4711b88656 100644 --- a/scripts/Makefile.modbuiltin +++ b/scripts/Makefile.modbuiltin | |||
@@ -40,7 +40,7 @@ __modbuiltin: $(modbuiltin-target) $(subdir-ym) | |||
40 | @: | 40 | @: |
41 | 41 | ||
42 | $(modbuiltin-target): $(subdir-ym) FORCE | 42 | $(modbuiltin-target): $(subdir-ym) FORCE |
43 | $(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done; \ | 43 | $(Q)(for m in $(modbuiltin-mods); do echo $$m; done; \ |
44 | cat /dev/null $(modbuiltin-subdirs)) > $@ | 44 | cat /dev/null $(modbuiltin-subdirs)) > $@ |
45 | 45 | ||
46 | PHONY += FORCE | 46 | PHONY += FORCE |
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 0dae402661f3..5a4579e76485 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst | |||
@@ -8,10 +8,7 @@ __modinst: | |||
8 | 8 | ||
9 | include scripts/Kbuild.include | 9 | include scripts/Kbuild.include |
10 | 10 | ||
11 | # | 11 | modules := $(sort $(shell cat $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order)) |
12 | |||
13 | __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) | ||
14 | modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) | ||
15 | 12 | ||
16 | PHONY += $(modules) | 13 | PHONY += $(modules) |
17 | __modinst: $(modules) | 14 | __modinst: $(modules) |
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index fec6ec2ffa47..6b19c1a4eae5 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
@@ -6,11 +6,12 @@ | |||
6 | # Stage one of module building created the following: | 6 | # Stage one of module building created the following: |
7 | # a) The individual .o files used for the module | 7 | # a) The individual .o files used for the module |
8 | # b) A <module>.o file which is the .o files above linked together | 8 | # b) A <module>.o file which is the .o files above linked together |
9 | # c) A <module>.mod file in $(MODVERDIR)/, listing the name of the | 9 | # c) A <module>.mod file, listing the name of the preliminary <module>.o file, |
10 | # the preliminary <module>.o file, plus all .o files | 10 | # plus all .o files |
11 | # d) modules.order, which lists all the modules | ||
11 | 12 | ||
12 | # Stage 2 is handled by this file and does the following | 13 | # Stage 2 is handled by this file and does the following |
13 | # 1) Find all modules from the files listed in $(MODVERDIR)/ | 14 | # 1) Find all modules listed in modules.order |
14 | # 2) modpost is then used to | 15 | # 2) modpost is then used to |
15 | # 3) create one <module>.mod.c file pr. module | 16 | # 3) create one <module>.mod.c file pr. module |
16 | # 4) create one Module.symvers file with CRC for all exported symbols | 17 | # 4) create one Module.symvers file with CRC for all exported symbols |
@@ -60,10 +61,12 @@ include scripts/Makefile.lib | |||
60 | kernelsymfile := $(objtree)/Module.symvers | 61 | kernelsymfile := $(objtree)/Module.symvers |
61 | modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers | 62 | modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers |
62 | 63 | ||
63 | # Step 1), find all modules listed in $(MODVERDIR)/ | 64 | modorder := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order |
64 | MODLISTCMD := find $(MODVERDIR) -name '*.mod' | xargs -r grep -h '\.ko$$' | sort -u | 65 | |
65 | __modules := $(shell $(MODLISTCMD)) | 66 | # Step 1), find all modules listed in modules.order |
66 | modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) | 67 | ifdef CONFIG_MODULES |
68 | modules := $(sort $(shell cat $(modorder))) | ||
69 | endif | ||
67 | 70 | ||
68 | # Stop after building .o files if NOFINAL is set. Makes compile tests quicker | 71 | # Stop after building .o files if NOFINAL is set. Makes compile tests quicker |
69 | _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) | 72 | _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) |
@@ -84,7 +87,7 @@ MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS))) | |||
84 | 87 | ||
85 | # We can go over command line length here, so be careful. | 88 | # We can go over command line length here, so be careful. |
86 | quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules | 89 | quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules |
87 | cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) $(MODPOST_OPT) -s -T - | 90 | cmd_modpost = sed 's/ko$$/o/' $(modorder) | $(modpost) $(MODPOST_OPT) -s -T - |
88 | 91 | ||
89 | PHONY += __modpost | 92 | PHONY += __modpost |
90 | __modpost: $(modules:.ko=.o) FORCE | 93 | __modpost: $(modules:.ko=.o) FORCE |
diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign index da56aa78d245..d7325cefe709 100644 --- a/scripts/Makefile.modsign +++ b/scripts/Makefile.modsign | |||
@@ -8,8 +8,7 @@ __modsign: | |||
8 | 8 | ||
9 | include scripts/Kbuild.include | 9 | include scripts/Kbuild.include |
10 | 10 | ||
11 | __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) | 11 | modules := $(sort $(shell cat modules.order)) |
12 | modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) | ||
13 | 12 | ||
14 | PHONY += $(modules) | 13 | PHONY += $(modules) |
15 | __modsign: $(modules) | 14 | __modsign: $(modules) |
diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index aab4e299d7a2..a904bf1f5e67 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh | |||
@@ -8,8 +8,7 @@ | |||
8 | # | 8 | # |
9 | 9 | ||
10 | # Create/update the include/generated/autoksyms.h file from the list | 10 | # Create/update the include/generated/autoksyms.h file from the list |
11 | # of all module's needed symbols as recorded on the third line of | 11 | # of all module's needed symbols as recorded on the second line of *.mod files. |
12 | # .tmp_versions/*.mod files. | ||
13 | # | 12 | # |
14 | # For each symbol being added or removed, the corresponding dependency | 13 | # For each symbol being added or removed, the corresponding dependency |
15 | # file's timestamp is updated to force a rebuild of the affected source | 14 | # file's timestamp is updated to force a rebuild of the affected source |
@@ -47,13 +46,10 @@ cat > "$new_ksyms_file" << EOT | |||
47 | */ | 46 | */ |
48 | 47 | ||
49 | EOT | 48 | EOT |
50 | [ "$(ls -A "$MODVERDIR")" ] && | 49 | sed 's/ko$/mod/' modules.order | |
51 | for mod in "$MODVERDIR"/*.mod; do | 50 | xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | |
52 | sed -n -e '3{s/ /\n/g;/^$/!p;}' "$mod" | 51 | sort -u | |
53 | done | sort -u | | 52 | sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file" |
54 | while read sym; do | ||
55 | echo "#define __KSYM_${sym} 1" | ||
56 | done >> "$new_ksyms_file" | ||
57 | 53 | ||
58 | # Special case for modversions (see modpost.c) | 54 | # Special case for modversions (see modpost.c) |
59 | if [ -n "$CONFIG_MODVERSIONS" ]; then | 55 | if [ -n "$CONFIG_MODVERSIONS" ]; then |
diff --git a/scripts/coccinelle/api/devm_platform_ioremap_resource.cocci b/scripts/coccinelle/api/devm_platform_ioremap_resource.cocci new file mode 100644 index 000000000000..56a2e261d61d --- /dev/null +++ b/scripts/coccinelle/api/devm_platform_ioremap_resource.cocci | |||
@@ -0,0 +1,60 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /// Use devm_platform_ioremap_resource helper which wraps | ||
3 | /// platform_get_resource() and devm_ioremap_resource() together. | ||
4 | /// | ||
5 | // Confidence: High | ||
6 | // Copyright: (C) 2019 Himanshu Jha GPLv2. | ||
7 | // Copyright: (C) 2019 Julia Lawall, Inria/LIP6. GPLv2. | ||
8 | // Keywords: platform_get_resource, devm_ioremap_resource, | ||
9 | // Keywords: devm_platform_ioremap_resource | ||
10 | |||
11 | virtual patch | ||
12 | virtual report | ||
13 | |||
14 | @r depends on patch && !report@ | ||
15 | expression e1, e2, arg1, arg2, arg3; | ||
16 | identifier id; | ||
17 | @@ | ||
18 | |||
19 | ( | ||
20 | - id = platform_get_resource(arg1, IORESOURCE_MEM, arg2); | ||
21 | | | ||
22 | - struct resource *id = platform_get_resource(arg1, IORESOURCE_MEM, arg2); | ||
23 | ) | ||
24 | ... when != id | ||
25 | - e1 = devm_ioremap_resource(arg3, id); | ||
26 | + e1 = devm_platform_ioremap_resource(arg1, arg2); | ||
27 | ... when != id | ||
28 | ? id = e2 | ||
29 | |||
30 | @r1 depends on patch && !report@ | ||
31 | identifier r.id; | ||
32 | type T; | ||
33 | @@ | ||
34 | |||
35 | - T *id; | ||
36 | ...when != id | ||
37 | |||
38 | @r2 depends on report && !patch@ | ||
39 | identifier id; | ||
40 | expression e1, e2, arg1, arg2, arg3; | ||
41 | position j0; | ||
42 | @@ | ||
43 | |||
44 | ( | ||
45 | id = platform_get_resource(arg1, IORESOURCE_MEM, arg2); | ||
46 | | | ||
47 | struct resource *id = platform_get_resource(arg1, IORESOURCE_MEM, arg2); | ||
48 | ) | ||
49 | ... when != id | ||
50 | e1@j0 = devm_ioremap_resource(arg3, id); | ||
51 | ... when != id | ||
52 | ? id = e2 | ||
53 | |||
54 | @script:python depends on report && !patch@ | ||
55 | e1 << r2.e1; | ||
56 | j0 << r2.j0; | ||
57 | @@ | ||
58 | |||
59 | msg = "WARNING: Use devm_platform_ioremap_resource for %s" % (e1) | ||
60 | coccilib.report.print_report(j0[0], msg) | ||
diff --git a/scripts/export_report.pl b/scripts/export_report.pl index 0f604f62f067..7d3030d03a25 100755 --- a/scripts/export_report.pl +++ b/scripts/export_report.pl | |||
@@ -52,13 +52,12 @@ sub usage { | |||
52 | 52 | ||
53 | sub collectcfiles { | 53 | sub collectcfiles { |
54 | my @file; | 54 | my @file; |
55 | while (<.tmp_versions/*.mod>) { | 55 | open my $fh, '< modules.order' or die "cannot open modules.order: $!\n"; |
56 | open my $fh, '<', $_ or die "cannot open $_: $!\n"; | 56 | while (<$fh>) { |
57 | push (@file, | 57 | s/\.ko$/.mod.c/; |
58 | grep s/\.ko/.mod.c/, # change the suffix | 58 | push (@file, $_) |
59 | grep m/.+\.ko/, # find the .ko path | ||
60 | <$fh>); # lines in opened file | ||
61 | } | 59 | } |
60 | close($fh); | ||
62 | chomp @file; | 61 | chomp @file; |
63 | return @file; | 62 | return @file; |
64 | } | 63 | } |
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index ab30fe724c43..7656e1137b6b 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -94,7 +94,7 @@ configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/c | |||
94 | %.config: $(obj)/conf | 94 | %.config: $(obj)/conf |
95 | $(if $(call configfiles),, $(error No configuration exists for this target on this architecture)) | 95 | $(if $(call configfiles),, $(error No configuration exists for this target on this architecture)) |
96 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles) | 96 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles) |
97 | +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig | 97 | $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig |
98 | 98 | ||
99 | PHONY += kvmconfig | 99 | PHONY += kvmconfig |
100 | kvmconfig: kvm_guest.config | 100 | kvmconfig: kvm_guest.config |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 501fdcc5e999..1134892599da 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -895,7 +895,8 @@ int conf_write(const char *name) | |||
895 | "# %s\n" | 895 | "# %s\n" |
896 | "#\n", str); | 896 | "#\n", str); |
897 | need_newline = false; | 897 | need_newline = false; |
898 | } else if (!(sym->flags & SYMBOL_CHOICE)) { | 898 | } else if (!(sym->flags & SYMBOL_CHOICE) && |
899 | !(sym->flags & SYMBOL_WRITTEN)) { | ||
899 | sym_calc_value(sym); | 900 | sym_calc_value(sym); |
900 | if (!(sym->flags & SYMBOL_WRITE)) | 901 | if (!(sym->flags & SYMBOL_WRITE)) |
901 | goto next; | 902 | goto next; |
@@ -903,7 +904,7 @@ int conf_write(const char *name) | |||
903 | fprintf(out, "\n"); | 904 | fprintf(out, "\n"); |
904 | need_newline = false; | 905 | need_newline = false; |
905 | } | 906 | } |
906 | sym->flags &= ~SYMBOL_WRITE; | 907 | sym->flags |= SYMBOL_WRITTEN; |
907 | conf_write_symbol(out, sym, &kconfig_printer_cb, NULL); | 908 | conf_write_symbol(out, sym, &kconfig_printer_cb, NULL); |
908 | } | 909 | } |
909 | 910 | ||
@@ -1063,8 +1064,6 @@ int conf_write_autoconf(int overwrite) | |||
1063 | if (!overwrite && is_present(autoconf_name)) | 1064 | if (!overwrite && is_present(autoconf_name)) |
1064 | return 0; | 1065 | return 0; |
1065 | 1066 | ||
1066 | sym_clear_all_valid(); | ||
1067 | |||
1068 | conf_write_dep("include/config/auto.conf.cmd"); | 1067 | conf_write_dep("include/config/auto.conf.cmd"); |
1069 | 1068 | ||
1070 | if (conf_touch_deps()) | 1069 | if (conf_touch_deps()) |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 8dde65bc3165..017843c9a4f4 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
@@ -141,6 +141,7 @@ struct symbol { | |||
141 | #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ | 141 | #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ |
142 | #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ | 142 | #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ |
143 | #define SYMBOL_CHANGED 0x0400 /* ? */ | 143 | #define SYMBOL_CHANGED 0x0400 /* ? */ |
144 | #define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */ | ||
144 | #define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */ | 145 | #define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */ |
145 | #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ | 146 | #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ |
146 | #define SYMBOL_WARNED 0x8000 /* warning has been issued */ | 147 | #define SYMBOL_WARNED 0x8000 /* warning has been issued */ |
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index 0f6dcb4011a8..63062024ce0e 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c | |||
@@ -396,34 +396,19 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) | |||
396 | unsigned long len; | 396 | unsigned long len; |
397 | struct md4_ctx md; | 397 | struct md4_ctx md; |
398 | char *sources, *end, *fname; | 398 | char *sources, *end, *fname; |
399 | const char *basename; | ||
400 | char filelist[PATH_MAX + 1]; | 399 | char filelist[PATH_MAX + 1]; |
401 | char *modverdir = getenv("MODVERDIR"); | ||
402 | 400 | ||
403 | if (!modverdir) | 401 | /* objects for a module are listed in the first line of *.mod file. */ |
404 | modverdir = "."; | 402 | snprintf(filelist, sizeof(filelist), "%.*smod", |
405 | 403 | (int)strlen(modname) - 1, modname); | |
406 | /* Source files for module are in .tmp_versions/modname.mod, | ||
407 | after the first line. */ | ||
408 | if (strrchr(modname, '/')) | ||
409 | basename = strrchr(modname, '/') + 1; | ||
410 | else | ||
411 | basename = modname; | ||
412 | snprintf(filelist, sizeof(filelist), "%s/%.*s.mod", modverdir, | ||
413 | (int) strlen(basename) - 2, basename); | ||
414 | 404 | ||
415 | file = grab_file(filelist, &len); | 405 | file = grab_file(filelist, &len); |
416 | if (!file) | 406 | if (!file) |
417 | /* not a module or .mod file missing - ignore */ | 407 | /* not a module or .mod file missing - ignore */ |
418 | return; | 408 | return; |
419 | 409 | ||
420 | sources = strchr(file, '\n'); | 410 | sources = file; |
421 | if (!sources) { | ||
422 | warn("malformed versions file for %s\n", modname); | ||
423 | goto release; | ||
424 | } | ||
425 | 411 | ||
426 | sources++; | ||
427 | end = strchr(sources, '\n'); | 412 | end = strchr(sources, '\n'); |
428 | if (!end) { | 413 | if (!end) { |
429 | warn("bad ending versions file for %s\n", modname); | 414 | warn("bad ending versions file for %s\n", modname); |
diff --git a/scripts/modules-check.sh b/scripts/modules-check.sh index 39e8cb36ba19..f51f446707b8 100755 --- a/scripts/modules-check.sh +++ b/scripts/modules-check.sh | |||
@@ -9,7 +9,7 @@ check_same_name_modules() | |||
9 | for m in $(sed 's:.*/::' modules.order | sort | uniq -d) | 9 | for m in $(sed 's:.*/::' modules.order | sort | uniq -d) |
10 | do | 10 | do |
11 | echo "warning: same module names found:" >&2 | 11 | echo "warning: same module names found:" >&2 |
12 | sed -n "/\/$m/s:^kernel/: :p" modules.order >&2 | 12 | sed -n "/\/$m/s:^: :p" modules.order >&2 |
13 | done | 13 | done |
14 | } | 14 | } |
15 | 15 | ||
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index e8ca6dc97e96..c4c580f547ef 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -132,6 +132,11 @@ fi | |||
132 | if [ "$ARCH" != "um" ]; then | 132 | if [ "$ARCH" != "um" ]; then |
133 | $MAKE -f $srctree/Makefile headers | 133 | $MAKE -f $srctree/Makefile headers |
134 | $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" | 134 | $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" |
135 | # move asm headers to /usr/include/<libc-machine>/asm to match the structure | ||
136 | # used by Debian-based distros (to support multi-arch) | ||
137 | host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH) | ||
138 | mkdir $libc_headers_dir/usr/include/$host_arch | ||
139 | mv $libc_headers_dir/usr/include/asm $libc_headers_dir/usr/include/$host_arch/ | ||
135 | fi | 140 | fi |
136 | 141 | ||
137 | # Install the maintainer scripts | 142 | # Install the maintainer scripts |
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index 8351584cb24e..e0750b70453f 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian | |||
@@ -197,6 +197,7 @@ Architecture: $debarch | |||
197 | Description: Linux support headers for userspace development | 197 | Description: Linux support headers for userspace development |
198 | This package provides userspaces headers from the Linux kernel. These headers | 198 | This package provides userspaces headers from the Linux kernel. These headers |
199 | are used by the installed headers for GNU glibc and other system libraries. | 199 | are used by the installed headers for GNU glibc and other system libraries. |
200 | Multi-Arch: same | ||
200 | 201 | ||
201 | Package: $dbg_packagename | 202 | Package: $dbg_packagename |
202 | Section: debug | 203 | Section: debug |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 2d29df4a0a53..8640c278f1aa 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -29,7 +29,7 @@ fi | |||
29 | 29 | ||
30 | PROVIDES="$PROVIDES kernel-$KERNELRELEASE" | 30 | PROVIDES="$PROVIDES kernel-$KERNELRELEASE" |
31 | __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g") | 31 | __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g") |
32 | EXCLUDES="$RCS_TAR_IGNORE --exclude=.tmp_versions --exclude=*vmlinux* \ | 32 | EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ |
33 | --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ | 33 | --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ |
34 | --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" | 34 | --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" |
35 | 35 | ||
diff --git a/tools/power/cpupower/debug/kernel/Makefile b/tools/power/cpupower/debug/kernel/Makefile index c23e5a6ceb7e..7b5c43684be1 100644 --- a/tools/power/cpupower/debug/kernel/Makefile +++ b/tools/power/cpupower/debug/kernel/Makefile | |||
@@ -12,8 +12,8 @@ default: | |||
12 | $(MAKE) -C $(KDIR) M=$(CURDIR) | 12 | $(MAKE) -C $(KDIR) M=$(CURDIR) |
13 | 13 | ||
14 | clean: | 14 | clean: |
15 | - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c | 15 | - rm -rf *.o *.ko .*.cmd .*.mod.* *.mod.c |
16 | - rm -rf .tmp_versions* Module.symvers modules.order | 16 | - rm -rf Module.symvers modules.order |
17 | 17 | ||
18 | install: default | 18 | install: default |
19 | install -d $(KMISC) | 19 | install -d $(KMISC) |
diff --git a/usr/include/Makefile b/usr/include/Makefile index cd8daa20d487..aa316d99e035 100644 --- a/usr/include/Makefile +++ b/usr/include/Makefile | |||
@@ -30,8 +30,6 @@ header-test-$(CONFIG_CPU_BIG_ENDIAN) += linux/byteorder/big_endian.h | |||
30 | header-test-$(CONFIG_CPU_LITTLE_ENDIAN) += linux/byteorder/little_endian.h | 30 | header-test-$(CONFIG_CPU_LITTLE_ENDIAN) += linux/byteorder/little_endian.h |
31 | header-test- += linux/coda.h | 31 | header-test- += linux/coda.h |
32 | header-test- += linux/coda_psdev.h | 32 | header-test- += linux/coda_psdev.h |
33 | header-test- += linux/dvb/audio.h | ||
34 | header-test- += linux/dvb/osd.h | ||
35 | header-test- += linux/elfcore.h | 33 | header-test- += linux/elfcore.h |
36 | header-test- += linux/errqueue.h | 34 | header-test- += linux/errqueue.h |
37 | header-test- += linux/fsmap.h | 35 | header-test- += linux/fsmap.h |
@@ -44,7 +42,6 @@ header-test- += linux/netfilter_bridge/ebtables.h | |||
44 | header-test- += linux/netfilter_ipv4/ipt_LOG.h | 42 | header-test- += linux/netfilter_ipv4/ipt_LOG.h |
45 | header-test- += linux/netfilter_ipv6/ip6t_LOG.h | 43 | header-test- += linux/netfilter_ipv6/ip6t_LOG.h |
46 | header-test- += linux/nfc.h | 44 | header-test- += linux/nfc.h |
47 | header-test- += linux/nilfs2_ondisk.h | ||
48 | header-test- += linux/omap3isp.h | 45 | header-test- += linux/omap3isp.h |
49 | header-test- += linux/omapfb.h | 46 | header-test- += linux/omapfb.h |
50 | header-test- += linux/patchkey.h | 47 | header-test- += linux/patchkey.h |
@@ -59,9 +56,6 @@ header-test- += linux/v4l2-mediabus.h | |||
59 | header-test- += linux/v4l2-subdev.h | 56 | header-test- += linux/v4l2-subdev.h |
60 | header-test- += linux/videodev2.h | 57 | header-test- += linux/videodev2.h |
61 | header-test- += linux/vm_sockets.h | 58 | header-test- += linux/vm_sockets.h |
62 | header-test- += misc/ocxl.h | ||
63 | header-test- += mtd/mtd-abi.h | ||
64 | header-test- += mtd/mtd-user.h | ||
65 | header-test- += scsi/scsi_bsg_fc.h | 59 | header-test- += scsi/scsi_bsg_fc.h |
66 | header-test- += scsi/scsi_netlink.h | 60 | header-test- += scsi/scsi_netlink.h |
67 | header-test- += scsi/scsi_netlink_fc.h | 61 | header-test- += scsi/scsi_netlink_fc.h |
@@ -108,7 +102,6 @@ header-test- += linux/bpf_perf_event.h | |||
108 | endif | 102 | endif |
109 | 103 | ||
110 | ifeq ($(SRCARCH),s390) | 104 | ifeq ($(SRCARCH),s390) |
111 | header-test- += asm/runtime_instr.h | ||
112 | header-test- += asm/zcrypt.h | 105 | header-test- += asm/zcrypt.h |
113 | endif | 106 | endif |
114 | 107 | ||
@@ -116,7 +109,6 @@ ifeq ($(SRCARCH),sparc) | |||
116 | header-test- += asm/stat.h | 109 | header-test- += asm/stat.h |
117 | header-test- += asm/uctx.h | 110 | header-test- += asm/uctx.h |
118 | header-test- += asm/fbio.h | 111 | header-test- += asm/fbio.h |
119 | header-test- += asm/openpromio.h | ||
120 | endif | 112 | endif |
121 | 113 | ||
122 | # asm-generic/*.h is used by asm/*.h, and should not be included directly | 114 | # asm-generic/*.h is used by asm/*.h, and should not be included directly |