Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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
...

+178 -173
+1
.gitignore
··· 30 30 *.lz4 31 31 *.lzma 32 32 *.lzo 33 + *.mod 33 34 *.mod.c 34 35 *.o 35 36 *.o.*
+1
Documentation/dontdiff
··· 30 30 *.lzo 31 31 *.mo 32 32 *.moc 33 + *.mod 33 34 *.mod.c 34 35 *.o 35 36 *.o.*
+2 -3
Documentation/kbuild/kbuild.rst
··· 38 38 39 39 AFLAGS_MODULE 40 40 ------------- 41 - Additional module specific options to use for $(AS). 41 + Additional assembler options for modules. 42 42 43 43 AFLAGS_KERNEL 44 44 ------------- 45 - Additional options for $(AS) when used for assembler 46 - code for code that is compiled as built-in. 45 + Additional assembler options for built-in. 47 46 48 47 KCFLAGS 49 48 -------
+6 -6
Documentation/kbuild/makefiles.rst
··· 328 328 variable $(KBUILD_CFLAGS) and uses it for compilation flags for the 329 329 entire tree. 330 330 331 - asflags-y specifies options for assembling with $(AS). 331 + asflags-y specifies assembler options. 332 332 333 333 Example:: 334 334 ··· 490 490 as-instr checks if the assembler reports a specific instruction 491 491 and then outputs either option1 or option2 492 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 495 cc-option 496 496 cc-option is used to check if $(CC) supports a given option, and if ··· 906 906 vmlinux. The usage of $(call if_changed,xxx) will be described later. 907 907 908 908 KBUILD_AFLAGS 909 - $(AS) assembler flags 909 + Assembler flags 910 910 911 911 Default value - see top level Makefile 912 912 Append or modify as required per architecture. ··· 949 949 to 'y' when selected. 950 950 951 951 KBUILD_AFLAGS_KERNEL 952 - $(AS) options specific for built-in 952 + Assembler options specific for built-in 953 953 954 954 $(KBUILD_AFLAGS_KERNEL) contains extra C compiler flags used to compile 955 955 resident kernel code. 956 956 957 957 KBUILD_AFLAGS_MODULE 958 - Options for $(AS) when building modules 958 + Assembler options specific for modules 959 959 960 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 963 From commandline AFLAGS_MODULE shall be used (see kbuild.txt). 964 964
+28 -33
Makefile
··· 486 486 export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL 487 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 489 # Files to ignore in find ... statements 495 490 496 491 export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ ··· 882 887 # change __FILE__ to the relative path from the srctree 883 888 KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) 884 889 890 + # ensure -fcf-protection is disabled when using retpoline as it is 891 + # incompatible with -mindirect-branch=thunk-extern 892 + ifdef CONFIG_RETPOLINE 893 + KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) 894 + endif 895 + 885 896 # use the deterministic mode of AR if available 886 897 KBUILD_ARFLAGS := $(call ar-option,D) 887 898 ··· 901 900 KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS) 902 901 KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS) 903 902 904 - # Use --build-id when available. 905 - LDFLAGS_BUILD_ID := $(call ld-option, --build-id) 906 - KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) 907 - LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) 903 + KBUILD_LDFLAGS_MODULE += --build-id 904 + LDFLAGS_vmlinux += --build-id 908 905 909 906 ifeq ($(CONFIG_STRIP_ASM_SYMS),y) 910 907 LDFLAGS_vmlinux += $(call ld-option, -X,) ··· 1030 1031 1031 1032 # Recurse until adjust_autoksyms.sh is satisfied 1032 1033 PHONY += autoksyms_recursive 1033 - autoksyms_recursive: $(vmlinux-deps) 1034 1034 ifdef CONFIG_TRIM_UNUSED_KSYMS 1035 + autoksyms_recursive: $(vmlinux-deps) modules.order 1035 1036 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ 1036 1037 "$(MAKE) -f $(srctree)/Makefile vmlinux" 1037 1038 endif ··· 1073 1074 1074 1075 PHONY += $(vmlinux-dirs) 1075 1076 $(vmlinux-dirs): prepare 1076 - $(Q)$(MAKE) $(build)=$@ need-builtin=1 1077 + $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 1077 1078 1078 1079 filechk_kernel.release = \ 1079 1080 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" ··· 1095 1096 # archprepare is used in arch Makefiles and when processed asm symlink, 1096 1097 # version.h and scripts_basic is processed / created. 1097 1098 1098 - PHONY += prepare archprepare prepare1 prepare3 1099 + PHONY += prepare archprepare prepare3 1099 1100 1100 1101 # prepare3 is used to check if we are building in a separate output directory, 1101 1102 # and if so do: ··· 1112 1113 fi; 1113 1114 endif 1114 1115 1115 - prepare1: prepare3 outputmakefile asm-generic $(version_h) $(autoksyms_h) \ 1116 - include/generated/utsrelease.h 1117 - $(cmd_crmodverdir) 1118 - 1119 - archprepare: archheaders archscripts prepare1 scripts 1116 + archprepare: archheaders archscripts scripts prepare3 outputmakefile \ 1117 + asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h 1120 1118 1121 1119 prepare0: archprepare 1122 1120 $(Q)$(MAKE) $(build)=scripts/mod ··· 1327 1331 rm -f $(MODLIB)/build ; \ 1328 1332 ln -s $(CURDIR) $(MODLIB)/build ; \ 1329 1333 fi 1330 - @cp -f $(objtree)/modules.order $(MODLIB)/ 1331 - @cp -f $(objtree)/modules.builtin $(MODLIB)/ 1334 + @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order 1335 + @sed 's:^:kernel/:' modules.builtin > $(MODLIB)/modules.builtin 1332 1336 @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ 1333 1337 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1334 1338 ··· 1369 1373 # make distclean Remove editor backup files, patch leftover files and the like 1370 1374 1371 1375 # Directories & files removed with 'make clean' 1372 - CLEAN_DIRS += $(MODVERDIR) include/ksym 1376 + CLEAN_DIRS += include/ksym 1373 1377 CLEAN_FILES += modules.builtin.modinfo 1374 1378 1375 1379 # Directories & files removed with 'make mrproper' 1376 1380 MRPROPER_DIRS += include/config include/generated \ 1377 1381 arch/$(SRCARCH)/include/generated .tmp_objdiff 1378 1382 MRPROPER_FILES += .config .config.old .version \ 1379 - Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ 1383 + Module.symvers \ 1380 1384 signing_key.pem signing_key.priv signing_key.x509 \ 1381 1385 x509.genkey extra_certificates signing_key.x509.keyid \ 1382 1386 signing_key.x509.signer vmlinux-gdb.py 1387 + 1388 + # Directories & files removed with 'make distclean' 1389 + DISTCLEAN_DIRS += 1390 + DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS 1383 1391 1384 1392 # clean - Delete most, but leave enough to build external modules 1385 1393 # ··· 1417 1417 1418 1418 # distclean 1419 1419 # 1420 + distclean: rm-dirs := $(wildcard $(DISTCLEAN_DIRS)) 1421 + distclean: rm-files := $(wildcard $(DISTCLEAN_FILES)) 1422 + 1420 1423 PHONY += distclean 1421 1424 1422 1425 distclean: mrproper 1426 + $(call cmd,rmdirs) 1427 + $(call cmd,rmfiles) 1423 1428 @find $(srctree) $(RCS_FIND_IGNORE) \ 1424 1429 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ 1425 1430 -o -name '*.bak' -o -name '#*#' -o -name '*%' \ ··· 1614 1609 module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) 1615 1610 PHONY += $(module-dirs) modules 1616 1611 $(module-dirs): prepare $(objtree)/Module.symvers 1617 - $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) 1612 + $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) need-modorder=1 1618 1613 1619 1614 modules: $(module-dirs) 1620 1615 @$(kecho) ' Building modules, stage 2.'; ··· 1639 1634 $(clean-dirs): 1640 1635 $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) 1641 1636 1642 - clean: rm-dirs := $(MODVERDIR) 1643 1637 clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers 1644 1638 1645 1639 PHONY += help ··· 1652 1648 @echo '' 1653 1649 1654 1650 PHONY += prepare 1655 - prepare: 1656 - $(cmd_crmodverdir) 1657 1651 endif # KBUILD_EXTMOD 1658 1652 1659 1653 clean: $(clean-dirs) ··· 1662 1660 -o -name '*.ko.*' \ 1663 1661 -o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ 1664 1662 -o -name '*.dwo' -o -name '*.lst' \ 1665 - -o -name '*.su' \ 1663 + -o -name '*.su' -o -name '*.mod' \ 1666 1664 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1667 1665 -o -name '*.lex.c' -o -name '*.tab.[ch]' \ 1668 1666 -o -name '*.asn1.[ch]' \ ··· 1767 1765 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) 1768 1766 %.symtypes: prepare FORCE 1769 1767 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) 1770 - %.ko: %.o 1771 - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1772 1768 1773 1769 # Modules 1774 1770 PHONY += / ··· 1788 1788 quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) 1789 1789 cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ 1790 1790 $(KERNELRELEASE) 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 1791 1797 1792 # read saved command lines for existing targets 1798 1793 existing-targets := $(wildcard $(sort $(targets)))
+1 -2
arch/arm/vdso/Makefile
··· 13 13 ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8 14 14 ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ 15 15 -z max-page-size=4096 -nostdlib -shared $(ldflags-y) \ 16 - $(call ld-option, --hash-style=sysv) \ 17 - $(call ld-option, --build-id) \ 16 + --hash-style=sysv --build-id \ 18 17 -T 19 18 20 19 obj-$(CONFIG_VDSO) += vdso.o
+2 -2
arch/arm64/kernel/vdso32/Makefile
··· 96 96 VDSO_LDFLAGS += -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 97 97 VDSO_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 98 98 VDSO_LDFLAGS += -nostdlib -shared -mfloat-abi=soft 99 - VDSO_LDFLAGS += $(call cc32-ldoption,-Wl$(comma)--hash-style=sysv) 100 - VDSO_LDFLAGS += $(call cc32-ldoption,-Wl$(comma)--build-id) 99 + VDSO_LDFLAGS += -Wl,--hash-style=sysv 100 + VDSO_LDFLAGS += -Wl,--build-id 101 101 VDSO_LDFLAGS += $(call cc32-ldoption,-fuse-ld=bfd) 102 102 103 103
-2
arch/riscv/Makefile
··· 34 34 KBUILD_LDFLAGS += -melf32lriscv 35 35 endif 36 36 37 - KBUILD_CFLAGS += -Wall 38 - 39 37 # ISA string setting 40 38 riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima 41 39 riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima
+1 -2
arch/sparc/vdso/Makefile
··· 115 115 -T $(filter %.lds,$^) $(filter %.o,$^) && \ 116 116 sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@' 117 117 118 - VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \ 119 - $(call ld-option, --build-id) -Bsymbolic 118 + VDSO_LDFLAGS = -shared --hash-style=both --build-id -Bsymbolic 120 119 GCOV_PROFILE := n 121 120 122 121 #
+2 -3
arch/x86/entry/vdso/Makefile
··· 176 176 -T $(filter %.lds,$^) $(filter %.o,$^) && \ 177 177 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' 178 178 179 - VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \ 180 - $(call ld-option, --build-id) $(call ld-option, --eh-frame-hdr) \ 181 - -Bsymbolic 179 + VDSO_LDFLAGS = -shared --hash-style=both --build-id \ 180 + $(call ld-option, --eh-frame-hdr) -Bsymbolic 182 181 GCOV_PROFILE := n 183 182 184 183 quiet_cmd_vdso_and_check = VDSO $@
+1
drivers/memory/.gitignore
··· 1 + ti-emif-asm-offsets.h
+3 -2
drivers/memory/Makefile
··· 29 29 30 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 35 $(call filechk,offsets,__TI_EMIF_ASM_OFFSETS_H__) 36 36 37 37 targets += emif-asm-offsets.s 38 + clean-files += ti-emif-asm-offsets.h
+1 -1
drivers/memory/ti-emif-sram-pm.S
··· 14 14 * GNU General Public License for more details. 15 15 */ 16 16 17 - #include <generated/ti-emif-asm-offsets.h> 18 17 #include <linux/linkage.h> 19 18 #include <asm/assembler.h> 20 19 #include <asm/memory.h> 21 20 22 21 #include "emif.h" 22 + #include "ti-emif-asm-offsets.h" 23 23 24 24 #define EMIF_POWER_MGMT_WAIT_SELF_REFRESH_8192_CYCLES 0x00a0 25 25 #define EMIF_POWER_MGMT_SR_TIMER_MASK 0x00f0
+1 -1
drivers/scsi/Makefile
··· 185 185 # Files generated that shall be removed upon make clean 186 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 190 $(obj)/scsi_sysfs.o: $(obj)/scsi_devinfo_tbl.c 191 191
+6 -8
include/Kbuild
··· 31 31 header-test- += acpi/platform/aclinux.h 32 32 header-test- += acpi/platform/aclinuxex.h 33 33 header-test- += acpi/processor.h 34 - header-test- += clocksource/hyperv_timer.h 34 + header-test-$(CONFIG_X86) += clocksource/hyperv_timer.h 35 35 header-test- += clocksource/timer-sp804.h 36 36 header-test- += crypto/cast_common.h 37 37 header-test- += crypto/internal/cryptouser.h ··· 246 246 header-test- += linux/intel-svm.h 247 247 header-test- += linux/interconnect-provider.h 248 248 header-test- += linux/ioc3.h 249 + header-test-$(CONFIG_BLOCK) += linux/iomap.h 249 250 header-test- += linux/ipack.h 250 251 header-test- += linux/irq_cpustat.h 251 252 header-test- += linux/irq_poll.h ··· 455 454 header-test- += linux/phy/tegra/xusb.h 456 455 header-test- += linux/phy/ulpi_phy.h 457 456 header-test- += linux/phy_fixed.h 458 - header-test- += linux/pinctrl/pinconf-generic.h 459 - header-test- += linux/pinctrl/pinconf.h 460 - header-test- += linux/pinctrl/pinctrl.h 461 457 header-test- += linux/pipe_fs_i.h 462 458 header-test- += linux/pktcdvd.h 463 459 header-test- += linux/pl320-ipc.h ··· 903 905 header-test- += net/netfilter/nf_queue.h 904 906 header-test- += net/netfilter/nf_reject.h 905 907 header-test- += net/netfilter/nf_synproxy.h 906 - header-test- += net/netfilter/nf_tables.h 907 - header-test- += net/netfilter/nf_tables_core.h 908 - header-test- += net/netfilter/nf_tables_ipv4.h 908 + header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables.h 909 + header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables_core.h 910 + header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables_ipv4.h 909 911 header-test- += net/netfilter/nf_tables_ipv6.h 912 + header-test-$(CONFIG_NF_TABLES) += net/netfilter/nf_tables_offload.h 910 913 header-test- += net/netfilter/nft_fib.h 911 914 header-test- += net/netfilter/nft_meta.h 912 915 header-test- += net/netfilter/nft_reject.h ··· 948 949 header-test- += rdma/ib.h 949 950 header-test- += rdma/iw_portmap.h 950 951 header-test- += rdma/opa_port_info.h 951 - header-test- += rdma/rdma_counter.h 952 952 header-test- += rdma/rdmavt_cq.h 953 953 header-test- += rdma/restrack.h 954 954 header-test- += rdma/signature.h
+1 -11
lib/Kconfig.debug
··· 353 353 which results in the code/data being placed in specific sections. 354 354 The section mismatch analysis is always performed after a full 355 355 kernel build, and enabling this option causes the following 356 - additional steps to occur: 356 + additional step to occur: 357 357 - Add the option -fno-inline-functions-called-once to gcc commands. 358 358 When inlining a function annotated with __init in a non-init 359 359 function, we would lose the section information and thus 360 360 the analysis would not catch the illegal reference. 361 361 This option tells gcc to inline less (but it does result in 362 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 364 config SECTION_MISMATCH_WARN_ONLY 375 365 bool "Make section mismatch errors non-fatal"
-5
scripts/Kbuild.include
··· 125 125 cc-option = $(call __cc-option, $(CC),\ 126 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 128 # cc-option-yn 134 129 # Usage: flag := $(call cc-option-yn,-march=winchip-c6) 135 130 cc-option-yn = $(call try-run,\
+17 -25
scripts/Makefile.build
··· 63 63 builtin-target := $(obj)/built-in.a 64 64 endif 65 65 66 - ifdef CONFIG_MODULES 66 + ifeq ($(CONFIG_MODULES)$(need-modorder),y1) 67 67 modorder-target := $(obj)/modules.order 68 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 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 74 $(subdir-ym) $(always) 75 75 @: 76 76 ··· 85 85 86 86 ifneq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) 87 87 cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< 88 - endif 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 88 endif 94 89 95 90 # Compile C sources (.c) ··· 263 268 264 269 # List module undefined symbols (or empty line if not enabled) 265 270 ifdef CONFIG_TRIM_UNUSED_KSYMS 266 - cmd_undef_syms = $(NM) $@ | sed -n 's/^ *U //p' | xargs echo 271 + cmd_undef_syms = $(NM) $< | sed -n 's/^ *U //p' | xargs echo 267 272 else 268 273 cmd_undef_syms = echo 269 274 endif ··· 273 278 $(call cmd,force_checksrc) 274 279 $(call if_changed_rule,cc_o_c) 275 280 276 - # Single-part modules are special since we need to mark them in $(MODVERDIR) 281 + cmd_mod = { \ 282 + echo $(if $($*-objs)$($*-y)$($*-m), $(addprefix $(obj)/, $($*-objs) $($*-y) $($*-m)), $(@:.mod=.o)); \ 283 + $(cmd_undef_syms); \ 284 + } > $@ 277 285 278 - $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE 279 - $(call cmd,force_checksrc) 280 - $(call if_changed_rule,cc_o_c) 281 - @{ echo $(@:.o=.ko); echo $@; \ 282 - $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) 286 + $(obj)/%.mod: $(obj)/%.o FORCE 287 + $(call if_changed,mod) 288 + 289 + targets += $(mod-targets) 283 290 284 291 quiet_cmd_cc_lst_c = MKLST $@ 285 292 cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ ··· 291 294 $(obj)/%.lst: $(src)/%.c FORCE 292 295 $(call if_changed_dep,cc_lst_c) 293 296 294 - # header test (header-test-y target) 297 + # header test (header-test-y, header-test-m target) 295 298 # --------------------------------------------------------------------------- 296 299 297 300 quiet_cmd_cc_s_h = CC $@ ··· 420 423 # 421 424 # Create commands to either record .ko file or cat modules.order from 422 425 # a subdirectory 423 - modorder-cmds = \ 424 - $(foreach m, $(modorder), \ 425 - $(if $(filter %/modules.order, $m), \ 426 - cat $m;, echo kernel/$m;)) 427 - 428 426 $(modorder-target): $(subdir-ym) FORCE 429 - $(Q)(cat /dev/null; $(modorder-cmds)) > $@ 427 + $(Q){ $(foreach m, $(modorder), \ 428 + $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \ 429 + | $(AWK) '!x[$$0]++' - > $@ 430 430 431 431 # 432 432 # Rule to compile a set of .o files into one .a file (with symbol table) ··· 458 464 # module is turned into a multi object module, $^ will contain header file 459 465 # dependencies recorded in the .*.cmd file. 460 466 quiet_cmd_link_multi-m = LD [M] $@ 461 - cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis) 467 + cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) 462 468 463 469 $(multi-used-m): FORCE 464 470 $(call if_changed,link_multi-m) 465 - @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \ 466 - $(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod) 467 471 $(call multi_depend, $(multi-used-m), .o, -objs -y -m) 468 472 469 473 targets += $(multi-used-m)
+1 -1
scripts/Makefile.lib
··· 78 78 $(wildcard $(addprefix $(srctree)/$(src)/, \ 79 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 83 # Add subdir path 84 84
+1 -1
scripts/Makefile.modbuiltin
··· 40 40 @: 41 41 42 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 44 cat /dev/null $(modbuiltin-subdirs)) > $@ 45 45 46 46 PHONY += FORCE
+1 -4
scripts/Makefile.modinst
··· 8 8 9 9 include scripts/Kbuild.include 10 10 11 - # 12 - 13 - __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 14 - modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) 11 + modules := $(sort $(shell cat $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order)) 15 12 16 13 PHONY += $(modules) 17 14 __modinst: $(modules)
+11 -8
scripts/Makefile.modpost
··· 6 6 # Stage one of module building created the following: 7 7 # a) The individual .o files used for the module 8 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 10 - # the preliminary <module>.o file, plus all .o files 9 + # c) A <module>.mod file, listing the name of the preliminary <module>.o file, 10 + # plus all .o files 11 + # d) modules.order, which lists all the modules 11 12 12 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 15 # 2) modpost is then used to 15 16 # 3) create one <module>.mod.c file pr. module 16 17 # 4) create one Module.symvers file with CRC for all exported symbols ··· 61 60 kernelsymfile := $(objtree)/Module.symvers 62 61 modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers 63 62 64 - # Step 1), find all modules listed in $(MODVERDIR)/ 65 - MODLISTCMD := find $(MODVERDIR) -name '*.mod' | xargs -r grep -h '\.ko$$' | sort -u 66 - __modules := $(shell $(MODLISTCMD)) 67 - modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) 63 + modorder := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order 64 + 65 + # Step 1), find all modules listed in modules.order 66 + ifdef CONFIG_MODULES 67 + modules := $(sort $(shell cat $(modorder))) 68 + endif 68 69 69 70 # Stop after building .o files if NOFINAL is set. Makes compile tests quicker 70 71 _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) ··· 87 84 88 85 # We can go over command line length here, so be careful. 89 86 quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules 90 - cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) $(MODPOST_OPT) -s -T - 87 + cmd_modpost = sed 's/ko$$/o/' $(modorder) | $(modpost) $(MODPOST_OPT) -s -T - 91 88 92 89 PHONY += __modpost 93 90 __modpost: $(modules:.ko=.o) FORCE
+1 -2
scripts/Makefile.modsign
··· 8 8 9 9 include scripts/Kbuild.include 10 10 11 - __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 12 - modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) 11 + modules := $(sort $(shell cat modules.order)) 13 12 14 13 PHONY += $(modules) 15 14 __modsign: $(modules)
+5 -9
scripts/adjust_autoksyms.sh
··· 8 8 # 9 9 10 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 12 - # .tmp_versions/*.mod files. 11 + # of all module's needed symbols as recorded on the second line of *.mod files. 13 12 # 14 13 # For each symbol being added or removed, the corresponding dependency 15 14 # file's timestamp is updated to force a rebuild of the affected source ··· 46 47 */ 47 48 48 49 EOT 49 - [ "$(ls -A "$MODVERDIR")" ] && 50 - for mod in "$MODVERDIR"/*.mod; do 51 - sed -n -e '3{s/ /\n/g;/^$/!p;}' "$mod" 52 - done | sort -u | 53 - while read sym; do 54 - echo "#define __KSYM_${sym} 1" 55 - done >> "$new_ksyms_file" 50 + sed 's/ko$/mod/' modules.order | 51 + xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | 52 + sort -u | 53 + sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file" 56 54 57 55 # Special case for modversions (see modpost.c) 58 56 if [ -n "$CONFIG_MODVERSIONS" ]; then
+60
scripts/coccinelle/api/devm_platform_ioremap_resource.cocci
··· 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)
+5 -6
scripts/export_report.pl
··· 52 52 53 53 sub collectcfiles { 54 54 my @file; 55 - while (<.tmp_versions/*.mod>) { 56 - open my $fh, '<', $_ or die "cannot open $_: $!\n"; 57 - push (@file, 58 - grep s/\.ko/.mod.c/, # change the suffix 59 - grep m/.+\.ko/, # find the .ko path 60 - <$fh>); # lines in opened file 55 + open my $fh, '< modules.order' or die "cannot open modules.order: $!\n"; 56 + while (<$fh>) { 57 + s/\.ko$/.mod.c/; 58 + push (@file, $_) 61 59 } 60 + close($fh); 62 61 chomp @file; 63 62 return @file; 64 63 }
+1 -1
scripts/kconfig/Makefile
··· 94 94 %.config: $(obj)/conf 95 95 $(if $(call configfiles),, $(error No configuration exists for this target on this architecture)) 96 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 99 PHONY += kvmconfig 100 100 kvmconfig: kvm_guest.config
+3 -4
scripts/kconfig/confdata.c
··· 895 895 "# %s\n" 896 896 "#\n", str); 897 897 need_newline = false; 898 - } else if (!(sym->flags & SYMBOL_CHOICE)) { 898 + } else if (!(sym->flags & SYMBOL_CHOICE) && 899 + !(sym->flags & SYMBOL_WRITTEN)) { 899 900 sym_calc_value(sym); 900 901 if (!(sym->flags & SYMBOL_WRITE)) 901 902 goto next; ··· 904 903 fprintf(out, "\n"); 905 904 need_newline = false; 906 905 } 907 - sym->flags &= ~SYMBOL_WRITE; 906 + sym->flags |= SYMBOL_WRITTEN; 908 907 conf_write_symbol(out, sym, &kconfig_printer_cb, NULL); 909 908 } 910 909 ··· 1063 1062 1064 1063 if (!overwrite && is_present(autoconf_name)) 1065 1064 return 0; 1066 - 1067 - sym_clear_all_valid(); 1068 1065 1069 1066 conf_write_dep("include/config/auto.conf.cmd"); 1070 1067
+1
scripts/kconfig/expr.h
··· 141 141 #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ 142 142 #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ 143 143 #define SYMBOL_CHANGED 0x0400 /* ? */ 144 + #define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */ 144 145 #define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */ 145 146 #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ 146 147 #define SYMBOL_WARNED 0x8000 /* warning has been issued */
+4 -19
scripts/mod/sumversion.c
··· 396 396 unsigned long len; 397 397 struct md4_ctx md; 398 398 char *sources, *end, *fname; 399 - const char *basename; 400 399 char filelist[PATH_MAX + 1]; 401 - char *modverdir = getenv("MODVERDIR"); 402 400 403 - if (!modverdir) 404 - modverdir = "."; 405 - 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); 401 + /* objects for a module are listed in the first line of *.mod file. */ 402 + snprintf(filelist, sizeof(filelist), "%.*smod", 403 + (int)strlen(modname) - 1, modname); 414 404 415 405 file = grab_file(filelist, &len); 416 406 if (!file) 417 407 /* not a module or .mod file missing - ignore */ 418 408 return; 419 409 420 - sources = strchr(file, '\n'); 421 - if (!sources) { 422 - warn("malformed versions file for %s\n", modname); 423 - goto release; 424 - } 410 + sources = file; 425 411 426 - sources++; 427 412 end = strchr(sources, '\n'); 428 413 if (!end) { 429 414 warn("bad ending versions file for %s\n", modname);
+1 -1
scripts/modules-check.sh
··· 9 9 for m in $(sed 's:.*/::' modules.order | sort | uniq -d) 10 10 do 11 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 13 done 14 14 } 15 15
+5
scripts/package/builddeb
··· 132 132 if [ "$ARCH" != "um" ]; then 133 133 $MAKE -f $srctree/Makefile headers 134 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 140 fi 136 141 137 142 # Install the maintainer scripts
+1
scripts/package/mkdebian
··· 197 197 Description: Linux support headers for userspace development 198 198 This package provides userspaces headers from the Linux kernel. These headers 199 199 are used by the installed headers for GNU glibc and other system libraries. 200 + Multi-Arch: same 200 201 201 202 Package: $dbg_packagename 202 203 Section: debug
+1 -1
scripts/package/mkspec
··· 29 29 30 30 PROVIDES="$PROVIDES kernel-$KERNELRELEASE" 31 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 33 --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ 34 34 --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" 35 35
+2 -2
tools/power/cpupower/debug/kernel/Makefile
··· 12 12 $(MAKE) -C $(KDIR) M=$(CURDIR) 13 13 14 14 clean: 15 - - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c 16 - - rm -rf .tmp_versions* Module.symvers modules.order 15 + - rm -rf *.o *.ko .*.cmd .*.mod.* *.mod.c 16 + - rm -rf Module.symvers modules.order 17 17 18 18 install: default 19 19 install -d $(KMISC)
-8
usr/include/Makefile
··· 30 30 header-test-$(CONFIG_CPU_LITTLE_ENDIAN) += linux/byteorder/little_endian.h 31 31 header-test- += linux/coda.h 32 32 header-test- += linux/coda_psdev.h 33 - header-test- += linux/dvb/audio.h 34 - header-test- += linux/dvb/osd.h 35 33 header-test- += linux/elfcore.h 36 34 header-test- += linux/errqueue.h 37 35 header-test- += linux/fsmap.h ··· 42 44 header-test- += linux/netfilter_ipv4/ipt_LOG.h 43 45 header-test- += linux/netfilter_ipv6/ip6t_LOG.h 44 46 header-test- += linux/nfc.h 45 - header-test- += linux/nilfs2_ondisk.h 46 47 header-test- += linux/omap3isp.h 47 48 header-test- += linux/omapfb.h 48 49 header-test- += linux/patchkey.h ··· 56 59 header-test- += linux/v4l2-subdev.h 57 60 header-test- += linux/videodev2.h 58 61 header-test- += linux/vm_sockets.h 59 - header-test- += misc/ocxl.h 60 - header-test- += mtd/mtd-abi.h 61 - header-test- += mtd/mtd-user.h 62 62 header-test- += scsi/scsi_bsg_fc.h 63 63 header-test- += scsi/scsi_netlink.h 64 64 header-test- += scsi/scsi_netlink_fc.h ··· 102 108 endif 103 109 104 110 ifeq ($(SRCARCH),s390) 105 - header-test- += asm/runtime_instr.h 106 111 header-test- += asm/zcrypt.h 107 112 endif 108 113 ··· 109 116 header-test- += asm/stat.h 110 117 header-test- += asm/uctx.h 111 118 header-test- += asm/fbio.h 112 - header-test- += asm/openpromio.h 113 119 endif 114 120 115 121 # asm-generic/*.h is used by asm/*.h, and should not be included directly