History

Merge tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada: - add modpost warn exported symbols marked as 'static' because 'static' and EXPORT_SYMBOL is an odd combination - break the build early if gold linker is used - optimize the Bison rule to produce .c and .h files by a single pattern rule - handle PREEMPT_RT in the module vermagic and UTS_VERSION - warn CONFIG options leaked to the user-space except existing ones - make single targets work properly - rebuild modules when module linker scripts are updated - split the module final link stage into scripts/Makefile.modfinal - fix the missed error code in merge_config.sh - improve the error message displayed on the attempt of the O= build in unclean source tree - remove 'clean-dirs' syntax - disable -Wimplicit-fallthrough warning for Clang - add CONFIG_CC_OPTIMIZE_FOR_SIZE_O3 for ARC - remove ARCH_{CPP,A,C}FLAGS variables - add $(BASH) to run bash scripts - change *CFLAGS_<basetarget>.o to take the relative path to $(obj) instead of the basename - stop suppressing Clang's -Wunused-function warnings when W=1 - fix linux/export.h to avoid genksyms calculating CRC of trimmed exported symbols - misc cleanups * tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (63 commits) genksyms: convert to SPDX License Identifier for lex.l and parse.y modpost: use __section in the output to *.mod.c modpost: use MODULE_INFO() for __module_depends export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols export.h: remove defined(__KERNEL__), which is no longer needed kbuild: allow Clang to find unused static inline functions for W=1 build kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN kbuild: refactor scripts/Makefile.extrawarn merge_config.sh: ignore unwanted grep errors kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) modpost: add NOFAIL to strndup modpost: add guid_t type definition kbuild: add $(BASH) to run scripts with bash-extension kbuild: remove ARCH_{CPP,A,C}FLAGS kbuild,arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC kbuild: Do not enable -Wimplicit-fallthrough for clang for now kbuild: clean up subdir-ymn calculation in Makefile.clean kbuild: remove unneeded '+' marker from cmd_clean kbuild: remove clean-dirs syntax kbuild: check clean srctree even earlier ...

Linus Torvalds committed 7 years ago

Commit d7b08272 parents 574cc45 77564a496 files · +763 −686Browse files

Unified · Split

96 files
  1. .gitignore +1 −1
  2. Documentation/kbuild/kbuild.rst +9 −19
  3. Documentation/kbuild/makefiles.rst +25 −42
  4. Kbuild +0 −7
  5. Makefile +151 −145
  6. arch/Kconfig +7 −0
  7. arch/alpha/Kconfig +1 −0
  8. arch/arc/Makefile +0 −8
  9. arch/arc/configs/axs101_defconfig +1 −0
  10. arch/arc/configs/axs103_defconfig +1 −0
  11. arch/arc/configs/axs103_smp_defconfig +1 −0
  12. arch/arc/configs/haps_hs_defconfig +1 −0
  13. arch/arc/configs/haps_hs_smp_defconfig +1 −0
  14. arch/arc/configs/hsdk_defconfig +1 −0
  15. arch/arc/configs/nps_defconfig +1 −0
  16. arch/arc/configs/nsim_700_defconfig +1 −0
  17. arch/arc/configs/nsim_hs_defconfig +1 −0
  18. arch/arc/configs/nsim_hs_smp_defconfig +1 −0
  19. arch/arc/configs/nsimosci_defconfig +1 −0
  20. arch/arc/configs/nsimosci_hs_defconfig +1 −0
  21. arch/arc/configs/nsimosci_hs_smp_defconfig +1 −0
  22. arch/arc/configs/tb10x_defconfig +1 −0
  23. arch/arc/configs/vdk_hs38_defconfig +1 −0
  24. arch/arc/configs/vdk_hs38_smp_defconfig +1 −0
  25. arch/arm/Makefile +1 −1
  26. arch/arm/kvm/Makefile +3 −2
  27. arch/arm64/Kconfig +1 −0
  28. arch/arm64/Makefile +1 −1
  29. arch/ia64/Kconfig +1 −0
  30. arch/ia64/Makefile +1 −1
  31. arch/m68k/Kconfig +1 −0
  32. arch/m68k/Makefile +1 −1
  33. arch/mips/Kconfig +1 −0
  34. arch/mips/boot/Makefile +1 −1
  35. arch/parisc/Makefile +1 −1
  36. arch/powerpc/Kconfig +1 −0
  37. arch/powerpc/Makefile +1 −1
  38. arch/powerpc/Makefile.postlink +1 −1
  39. arch/powerpc/kernel/prom_init_check.sh +1 −1
  40. arch/riscv/Kconfig +1 −0
  41. arch/riscv/Makefile +1 −1
  42. arch/s390/Kconfig +1 −0
  43. arch/sparc/Kconfig +1 −0
  44. arch/um/Kconfig +1 −0
  45. arch/x86/Kconfig +1 −0
  46. arch/x86/entry/vdso/Makefile +2 −1
  47. drivers/gpu/drm/amd/display/dc/calcs/Makefile +3 −3
  48. drivers/gpu/drm/amd/display/dc/dcn20/Makefile +2 −2
  49. drivers/gpu/drm/amd/display/dc/dcn21/Makefile +1 −1
  50. drivers/gpu/drm/amd/display/dc/dml/Makefile +11 −14
  51. drivers/gpu/drm/amd/display/dc/dsc/Makefile +3 −4
  52. drivers/gpu/drm/i915/Makefile +1 −1
  53. drivers/net/ethernet/aquantia/atlantic/hw_atl/Makefile +0 −2
  54. drivers/net/ethernet/mellanox/mlx5/core/accel/Makefile +0 −2
  55. drivers/net/ethernet/mellanox/mlx5/core/diag/Makefile +0 −2
  56. drivers/net/ethernet/mellanox/mlx5/core/en/Makefile +0 −2
  57. drivers/net/ethernet/mellanox/mlx5/core/en/xsk/Makefile +0 −1
  58. drivers/net/ethernet/mellanox/mlx5/core/en_accel/Makefile +0 −2
  59. drivers/net/ethernet/mellanox/mlx5/core/fpga/Makefile +0 −2
  60. drivers/net/ethernet/mellanox/mlx5/core/ipoib/Makefile +0 −2
  61. drivers/net/ethernet/mellanox/mlx5/core/lib/Makefile +0 −2
  62. drivers/net/ethernet/netronome/nfp/bpf/Makefile +0 −2
  63. drivers/net/ethernet/netronome/nfp/flower/Makefile +0 −2
  64. drivers/net/ethernet/netronome/nfp/nfpcore/Makefile +0 −2
  65. drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000/Makefile +0 −2
  66. drivers/net/ethernet/netronome/nfp/nic/Makefile +0 −2
  67. include/linux/compiler_types.h +14 −6
  68. include/linux/export.h +16 −26
  69. include/linux/vermagic.h +2 −0
  70. init/Kconfig +20 −6
  71. init/Makefile +3 −2
  72. kernel/Makefile +1 −1
  73. scripts/Kconfig.include +3 −0
  74. scripts/Makefile +1 −1
  75. scripts/Makefile.build +43 −30
  76. scripts/Makefile.clean +5 −26
  77. scripts/Makefile.extrawarn +69 −52
  78. scripts/Makefile.host +28 −11
  79. scripts/Makefile.lib +28 −35
  80. scripts/Makefile.modfinal +60 −0
  81. scripts/Makefile.modpost +12 −68
  82. scripts/Makefile.package +24 −19
  83. scripts/basic/Makefile +2 −12
  84. scripts/genksyms/Makefile +2 −9
  85. scripts/genksyms/keywords.c +1 −5
  86. scripts/genksyms/lex.l +10 −22
  87. scripts/genksyms/parse.y +10 −22
  88. scripts/headers_install.sh +72 −0
  89. scripts/kconfig/Makefile +5 −5
  90. scripts/kconfig/merge_config.sh +6 −6
  91. scripts/link-vmlinux.sh +21 −19
  92. scripts/mkcompile_h +3 −1
  93. scripts/mkmakefile +2 −2
  94. scripts/mod/file2alias.c +5 −0
  95. scripts/mod/modpost.c +38 −10
  96. usr/include/Makefile +1 −3
.gitignore+1−1
@@ -34,7 +34,6 @@ · 33 unmodified lines
34*.mod.c34*.mod.c
35*.o35*.o
36*.o.*36*.o.*
37*.order
38*.patch37*.patch
39*.s38*.s
40*.so39*.so
@@ -46,6 +45,7 @@ · 5 unmodified lines
46*.xz45*.xz
47Module.symvers46Module.symvers
48modules.builtin47modules.builtin
48modules.order
49 49
50#50#
51# Top-level generic files51# Top-level generic files
Documentation/kbuild/kbuild.rst+9−19
@@ -105,6 +105,15 @@ The output directory can also be specified using "O=...". · 104 unmodified lines
105 105
106Setting "O=..." takes precedence over KBUILD_OUTPUT.106Setting "O=..." takes precedence over KBUILD_OUTPUT.
107 107
108KBUILD_EXTRA_WARN
109-----------------
110Specify the extra build checks. The same value can be assigned by passing
111W=... from the command line.
112
113See `make help` for the list of the supported values.
114
115Setting "W=..." takes precedence over KBUILD_EXTRA_WARN.
116
108KBUILD_DEBARCH117KBUILD_DEBARCH
109--------------118--------------
110For the deb-pkg target, allows overriding the normal heuristics deployed by119For the deb-pkg target, allows overriding the normal heuristics deployed by
@@ -241,11 +250,6 @@ To get all available archs you can also specify all. E.g.:: · 130 unmodified lines
241 250
242 $ make ALLSOURCE_ARCHS=all tags251 $ make ALLSOURCE_ARCHS=all tags
243 252
244KBUILD_ENABLE_EXTRA_GCC_CHECKS
245------------------------------
246If enabled over the make command line with "W=1", it turns on additional
247gcc -W... options for more extensive build-time checking.
248
249KBUILD_BUILD_TIMESTAMP253KBUILD_BUILD_TIMESTAMP
250----------------------254----------------------
251Setting this to a date string overrides the timestamp used in the255Setting this to a date string overrides the timestamp used in the
@@ -258,17 +262,3 @@ KBUILD_BUILD_USER, KBUILD_BUILD_HOST · 6 unmodified lines
258These two variables allow to override the user@host string displayed during262These two variables allow to override the user@host string displayed during
259boot and in /proc/version. The default value is the output of the commands263boot and in /proc/version. The default value is the output of the commands
260whoami and host, respectively.264whoami and host, respectively.
261
262KBUILD_LDS
263----------
264The linker script with full path. Assigned by the top-level Makefile.
265
266KBUILD_VMLINUX_OBJS
267-------------------
268All object files for vmlinux. They are linked to vmlinux in the same
269order as listed in KBUILD_VMLINUX_OBJS.
270
271KBUILD_VMLINUX_LIBS
272-------------------
273All .a "lib" files for vmlinux. KBUILD_VMLINUX_OBJS and KBUILD_VMLINUX_LIBS
274together specify all the object files used to link vmlinux.
Documentation/kbuild/makefiles.rst+25−42
@@ -471,21 +471,6 @@ more details, with real examples. · 470 unmodified lines
471 The second argument is optional, and if supplied will be used471 The second argument is optional, and if supplied will be used
472 if first argument is not supported.472 if first argument is not supported.
473 473
474 cc-ldoption
475 cc-ldoption is used to check if $(CC) when used to link object files
476 supports the given option. An optional second option may be
477 specified if first option are not supported.
478
479 Example::
480
481 #arch/x86/kernel/Makefile
482 vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
483
484 In the above example, vsyscall-flags will be assigned the option
485 -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
486 The second argument is optional, and if supplied will be used
487 if first argument is not supported.
488
489 as-instr474 as-instr
490 as-instr checks if the assembler reports a specific instruction475 as-instr checks if the assembler reports a specific instruction
491 and then outputs either option1 or option2476 and then outputs either option1 or option2
@@ -765,7 +750,8 @@ Files matching the patterns "*.[oas]", "*.ko", plus some additional files · 273 unmodified lines
765generated by kbuild are deleted all over the kernel src tree when750generated by kbuild are deleted all over the kernel src tree when
766"make clean" is executed.751"make clean" is executed.
767 752
768Additional files can be specified in kbuild makefiles by use of $(clean-files).753Additional files or directories can be specified in kbuild makefiles by use of
754$(clean-files).
769 755
770 Example::756 Example::
771 757
@@ -776,23 +762,8 @@ When executing "make clean", the file "crc32table.h" will be deleted. · 4 unmodified lines
776Kbuild will assume files to be in the same relative directory as the762Kbuild will assume files to be in the same relative directory as the
777Makefile, except if prefixed with $(objtree).763Makefile, except if prefixed with $(objtree).
778 764
779To delete a directory hierarchy use:765To exclude certain files or directories from make clean, use the
780 766$(no-clean-files) variable.
781 Example::
782
783 #scripts/package/Makefile
784 clean-dirs := $(objtree)/debian/
785
786This will delete the directory debian in the toplevel directory, including all
787subdirectories.
788
789To exclude certain files from make clean, use the $(no-clean-files) variable.
790This is only a special case used in the top level Kbuild file:
791
792 Example::
793
794 #Kbuild
795 no-clean-files := $(bounds-file) $(offsets-file)
796 767
797Usually kbuild descends down in subdirectories due to "obj-* := dir/",768Usually kbuild descends down in subdirectories due to "obj-* := dir/",
798but in the architecture makefiles where the kbuild infrastructure769but in the architecture makefiles where the kbuild infrastructure
@@ -988,13 +959,25 @@ When kbuild executes, the following steps are followed (roughly): · 189 unmodified lines
988 $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic959 $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
989 mode) if this option is supported by $(AR).960 mode) if this option is supported by $(AR).
990 961
991 ARCH_CPPFLAGS, ARCH_AFLAGS, ARCH_CFLAGS Overrides the kbuild defaults962 KBUILD_LDS
963
964 The linker script with full path. Assigned by the top-level Makefile.
965
966 KBUILD_LDS_MODULE
967
968 The module linker script with full path. Assigned by the top-level
969 Makefile and additionally by the arch Makefile.
970
971 KBUILD_VMLINUX_OBJS
972
973 All object files for vmlinux. They are linked to vmlinux in the same
974 order as listed in KBUILD_VMLINUX_OBJS.
992 975
993 These variables are appended to the KBUILD_CPPFLAGS,976 KBUILD_VMLINUX_LIBS
994 KBUILD_AFLAGS, and KBUILD_CFLAGS, respectively, after the
995 top-level Makefile has set any other flags. This provides a
996 means for an architecture to override the defaults.
997 977
978 All .a "lib" files for vmlinux. KBUILD_VMLINUX_OBJS and
979 KBUILD_VMLINUX_LIBS together specify all the object files used to
980 link vmlinux.
998 981
9996.2 Add prerequisites to archheaders9826.2 Add prerequisites to archheaders
1000------------------------------------983------------------------------------
@@ -1139,7 +1122,7 @@ When kbuild executes, the following steps are followed (roughly): · 138 unmodified lines
1139 1122
1140 header-test-y1123 header-test-y
1141 1124
1142 header-test-y specifies headers (*.h) in the current directory that1125 header-test-y specifies headers (`*.h`) in the current directory that
1143 should be compile tested to ensure they are self-contained,1126 should be compile tested to ensure they are self-contained,
1144 i.e. compilable as standalone units. If CONFIG_HEADER_TEST is enabled,1127 i.e. compilable as standalone units. If CONFIG_HEADER_TEST is enabled,
1145 this builds them as part of extra-y.1128 this builds them as part of extra-y.
@@ -1147,11 +1130,11 @@ When kbuild executes, the following steps are followed (roughly): · 1 unmodified line
1147 header-test-pattern-y1130 header-test-pattern-y
1148 1131
1149 This works as a weaker version of header-test-y, and accepts wildcard1132 This works as a weaker version of header-test-y, and accepts wildcard
1150 patterns. The typical usage is:1133 patterns. The typical usage is::
1151 1134
1152 header-test-pattern-y += *.h1135 header-test-pattern-y += *.h
1153 1136
1154 This specifies all the files that matches to '*.h' in the current1137 This specifies all the files that matches to `*.h` in the current
1155 directory, but the files in 'header-test-' are excluded.1138 directory, but the files in 'header-test-' are excluded.
1156 1139
11576.7 Commands useful for building a boot image11406.7 Commands useful for building a boot image
Kbuild+0−7
@@ -18,8 +18,6 @@ $(bounds-file): kernel/bounds.s FORCE · 17 unmodified lines
18 18
19timeconst-file := include/generated/timeconst.h19timeconst-file := include/generated/timeconst.h
20 20
21targets += $(timeconst-file)
22
23filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<21filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
24 22
25$(timeconst-file): kernel/time/timeconst.bc FORCE23$(timeconst-file): kernel/time/timeconst.bc FORCE
@@ -42,7 +40,6 @@ $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE · 16 unmodified lines
42# Check for missing system calls40# Check for missing system calls
43 41
44always += missing-syscalls42always += missing-syscalls
45targets += missing-syscalls
46 43
47quiet_cmd_syscalls = CALL $<44quiet_cmd_syscalls = CALL $<
48 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)45 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
@@ -54,13 +51,9 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE · 5 unmodified lines
54# Check atomic headers are up-to-date51# Check atomic headers are up-to-date
55 52
56always += old-atomics53always += old-atomics
57targets += old-atomics
58 54
59quiet_cmd_atomics = CALL $<55quiet_cmd_atomics = CALL $<
60 cmd_atomics = $(CONFIG_SHELL) $<56 cmd_atomics = $(CONFIG_SHELL) $<
61 57
62old-atomics: scripts/atomic/check-atomics.sh FORCE58old-atomics: scripts/atomic/check-atomics.sh FORCE
63 $(call cmd,atomics)59 $(call cmd,atomics)
64
65# Keep these three files during make clean
66no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)
Makefile+151−145
@@ -230,6 +230,8 @@ endif · 229 unmodified lines
230 230
231export KBUILD_CHECKSRC KBUILD_EXTMOD231export KBUILD_CHECKSRC KBUILD_EXTMOD
232 232
233extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
234
233ifeq ($(abs_srctree),$(abs_objtree))235ifeq ($(abs_srctree),$(abs_objtree))
234 # building in the source tree236 # building in the source tree
235 srctree := .237 srctree := .
@@ -271,52 +273,62 @@ no-dot-config-targets := $(clean-targets) \ · 35 unmodified lines
271 %asm-generic kernelversion %src-pkg273 %asm-generic kernelversion %src-pkg
272no-sync-config-targets := $(no-dot-config-targets) install %install \274no-sync-config-targets := $(no-dot-config-targets) install %install \
273 kernelrelease275 kernelrelease
276single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
274 277
275config-targets := 0278config-build :=
276mixed-targets := 0279mixed-build :=
277dot-config := 1280need-config := 1
278may-sync-config := 1281may-sync-config := 1
282single-build :=
279 283
280ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)284ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
281 ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)285 ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
282 dot-config := 0286 need-config :=
283 endif287 endif
284endif288endif
285 289
286ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)290ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
287 ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)291 ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
288 may-sync-config := 0292 may-sync-config :=
289 endif293 endif
290endif294endif
291 295
292ifneq ($(KBUILD_EXTMOD),)296ifneq ($(KBUILD_EXTMOD),)
293 may-sync-config := 0297 may-sync-config :=
294endif298endif
295 299
296ifeq ($(KBUILD_EXTMOD),)300ifeq ($(KBUILD_EXTMOD),)
297 ifneq ($(filter config %config,$(MAKECMDGOALS)),)301 ifneq ($(filter config %config,$(MAKECMDGOALS)),)
298 config-targets := 1302 config-build := 1
299 ifneq ($(words $(MAKECMDGOALS)),1)303 ifneq ($(words $(MAKECMDGOALS)),1)
300 mixed-targets := 1304 mixed-build := 1
301 endif305 endif
302 endif306 endif
303endif307endif
304 308
309# We cannot build single targets and the others at the same time
310ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),)
311 single-build := 1
312 ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
313 mixed-build := 1
314 endif
315endif
316
305# For "make -j clean all", "make -j mrproper defconfig all", etc.317# For "make -j clean all", "make -j mrproper defconfig all", etc.
306ifneq ($(filter $(clean-targets),$(MAKECMDGOALS)),)318ifneq ($(filter $(clean-targets),$(MAKECMDGOALS)),)
307 ifneq ($(filter-out $(clean-targets),$(MAKECMDGOALS)),)319 ifneq ($(filter-out $(clean-targets),$(MAKECMDGOALS)),)
308 mixed-targets := 1320 mixed-build := 1
309 endif321 endif
310endif322endif
311 323
312# install and modules_install need also be processed one by one324# install and modules_install need also be processed one by one
313ifneq ($(filter install,$(MAKECMDGOALS)),)325ifneq ($(filter install,$(MAKECMDGOALS)),)
314 ifneq ($(filter modules_install,$(MAKECMDGOALS)),)326 ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
315 mixed-targets := 1327 mixed-build := 1
316 endif328 endif
317endif329endif
318 330
319ifeq ($(mixed-targets),1)331ifdef mixed-build
320# ===========================================================================332# ===========================================================================
321# We're called with mixed targets (*config and build targets).333# We're called with mixed targets (*config and build targets).
322# Handle them one by one.334# Handle them one by one.
@@ -332,7 +344,7 @@ __build_one_by_one: · 9 unmodified lines
332 $(MAKE) -f $(srctree)/Makefile $$i; \344 $(MAKE) -f $(srctree)/Makefile $$i; \
333 done345 done
334 346
335else347else # !mixed-build
336 348
337include scripts/Kbuild.include349include scripts/Kbuild.include
338 350
@@ -392,9 +404,7 @@ KCONFIG_CONFIG ?= .config · 53 unmodified lines
392export KCONFIG_CONFIG404export KCONFIG_CONFIG
393 405
394# SHELL used by kbuild406# SHELL used by kbuild
395CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \407CONFIG_SHELL := sh
396 else if [ -x /bin/bash ]; then echo /bin/bash; \
397 else echo sh; fi ; fi)
398 408
399HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)409HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
400HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)410HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
@@ -431,6 +441,7 @@ PYTHON = python · 30 unmodified lines
431PYTHON2 = python2441PYTHON2 = python2
432PYTHON3 = python3442PYTHON3 = python3
433CHECK = sparse443CHECK = sparse
444BASH = bash
434 445
435CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \446CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
436 -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)447 -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
@@ -470,12 +481,13 @@ KBUILD_AFLAGS_KERNEL := · 33 unmodified lines
470KBUILD_CFLAGS_KERNEL :=481KBUILD_CFLAGS_KERNEL :=
471KBUILD_AFLAGS_MODULE := -DMODULE482KBUILD_AFLAGS_MODULE := -DMODULE
472KBUILD_CFLAGS_MODULE := -DMODULE483KBUILD_CFLAGS_MODULE := -DMODULE
473KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds484KBUILD_LDFLAGS_MODULE :=
485export KBUILD_LDS_MODULE := $(srctree)/scripts/module-common.lds
474KBUILD_LDFLAGS :=486KBUILD_LDFLAGS :=
475GCC_PLUGINS_CFLAGS :=487GCC_PLUGINS_CFLAGS :=
476CLANG_FLAGS :=488CLANG_FLAGS :=
477 489
478export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC490export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
479export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK INSTALLKERNEL491export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK INSTALLKERNEL
480export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX492export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
481export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE493export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
@@ -506,6 +518,7 @@ scripts_basic: · 24 unmodified lines
506 $(Q)rm -f .tmp_quiet_recordmcount518 $(Q)rm -f .tmp_quiet_recordmcount
507 519
508PHONY += outputmakefile520PHONY += outputmakefile
521# Before starting out-of-tree build, make sure the source tree is clean.
509# outputmakefile generates a Makefile in the output directory, if using a522# outputmakefile generates a Makefile in the output directory, if using a
510# separate output directory. This allows convenient use of make in the523# separate output directory. This allows convenient use of make in the
511# output directory.524# output directory.
@@ -513,6 +526,15 @@ PHONY += outputmakefile · 1 unmodified line
513# ignore whole output directory526# ignore whole output directory
514outputmakefile:527outputmakefile:
515ifdef building_out_of_srctree528ifdef building_out_of_srctree
529 $(Q)if [ -f $(srctree)/.config -o \
530 -d $(srctree)/include/config -o \
531 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
532 echo >&2 "***"; \
533 echo >&2 "*** The source tree is not clean, please run 'make$(if $(findstring command line, $(origin ARCH)), ARCH=$(ARCH)) mrproper'"; \
534 echo >&2 "*** in $(abs_srctree)";\
535 echo >&2 "***"; \
536 false; \
537 fi
516 $(Q)ln -fsn $(srctree) source538 $(Q)ln -fsn $(srctree) source
517 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)539 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
518 $(Q)test -e .gitignore || \540 $(Q)test -e .gitignore || \
@@ -544,7 +566,7 @@ endif · 25 unmodified lines
544# and from include/config/auto.conf.cmd to detect the compiler upgrade.566# and from include/config/auto.conf.cmd to detect the compiler upgrade.
545CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)567CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
546 568
547ifeq ($(config-targets),1)569ifdef config-build
548# ===========================================================================570# ===========================================================================
549# *config targets only - make sure prerequisites are updated, and descend571# *config targets only - make sure prerequisites are updated, and descend
550# in scripts/kconfig to make the *config target572# in scripts/kconfig to make the *config target
@@ -555,13 +577,13 @@ ifeq ($(config-targets),1) · 4 unmodified lines
555include arch/$(SRCARCH)/Makefile577include arch/$(SRCARCH)/Makefile
556export KBUILD_DEFCONFIG KBUILD_KCONFIG CC_VERSION_TEXT578export KBUILD_DEFCONFIG KBUILD_KCONFIG CC_VERSION_TEXT
557 579
558config: scripts_basic outputmakefile FORCE580config: outputmakefile scripts_basic FORCE
559 $(Q)$(MAKE) $(build)=scripts/kconfig $@581 $(Q)$(MAKE) $(build)=scripts/kconfig $@
560 582
561%config: scripts_basic outputmakefile FORCE583%config: outputmakefile scripts_basic FORCE
562 $(Q)$(MAKE) $(build)=scripts/kconfig $@584 $(Q)$(MAKE) $(build)=scripts/kconfig $@
563 585
564else586else #!config-build
565# ===========================================================================587# ===========================================================================
566# Build targets only - this includes vmlinux, arch specific targets, clean588# Build targets only - this includes vmlinux, arch specific targets, clean
567# targets and others. In general all targets except *config targets.589# targets and others. In general all targets except *config targets.
@@ -604,7 +626,7 @@ endif · 36 unmodified lines
604 626
605export KBUILD_MODULES KBUILD_BUILTIN627export KBUILD_MODULES KBUILD_BUILTIN
606 628
607ifeq ($(dot-config),1)629ifdef need-config
608include include/config/auto.conf630include include/config/auto.conf
609endif631endif
610 632
@@ -645,15 +667,10 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc · 34 unmodified lines
645export RETPOLINE_CFLAGS667export RETPOLINE_CFLAGS
646export RETPOLINE_VDSO_CFLAGS668export RETPOLINE_VDSO_CFLAGS
647 669
648# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
649# values of the respective KBUILD_* variables
650ARCH_CPPFLAGS :=
651ARCH_AFLAGS :=
652ARCH_CFLAGS :=
653include arch/$(SRCARCH)/Makefile670include arch/$(SRCARCH)/Makefile
654 671
655ifeq ($(dot-config),1)672ifdef need-config
656ifeq ($(may-sync-config),1)673ifdef may-sync-config
657# Read in dependencies to all Kconfig* files, make sure to run syncconfig if674# Read in dependencies to all Kconfig* files, make sure to run syncconfig if
658# changes are detected. This should be included after arch/$(SRCARCH)/Makefile675# changes are detected. This should be included after arch/$(SRCARCH)/Makefile
659# because some architectures define CROSS_COMPILE there.676# because some architectures define CROSS_COMPILE there.
@@ -676,7 +693,7 @@ $(KCONFIG_CONFIG): · 16 unmodified lines
676# The syncconfig should be executed only once to make all the targets.693# The syncconfig should be executed only once to make all the targets.
677%/auto.conf %/auto.conf.cmd %/tristate.conf: $(KCONFIG_CONFIG)694%/auto.conf %/auto.conf.cmd %/tristate.conf: $(KCONFIG_CONFIG)
678 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig695 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
679else696else # !may-sync-config
680# External modules and some install targets need include/generated/autoconf.h697# External modules and some install targets need include/generated/autoconf.h
681# and include/config/auto.conf but do not care if they are up-to-date.698# and include/config/auto.conf but do not care if they are up-to-date.
682# Use auto.conf to trigger the test699# Use auto.conf to trigger the test
@@ -692,7 +709,7 @@ include/config/auto.conf: · 9 unmodified lines
692 /bin/false)709 /bin/false)
693 710
694endif # may-sync-config711endif # may-sync-config
695endif # $(dot-config)712endif # need-config
696 713
697KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)714KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
698KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)715KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
@@ -700,10 +717,12 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) · 1 unmodified line
700KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)717KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
701KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)718KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
702 719
703ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE720ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
704KBUILD_CFLAGS += -Os721KBUILD_CFLAGS += -O2
705else722else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
706KBUILD_CFLAGS += -O2723KBUILD_CFLAGS += -O3
724else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
725KBUILD_CFLAGS += -Os
707endif726endif
708 727
709ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED728ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
@@ -751,6 +770,11 @@ else · 41 unmodified lines
751# These warnings generated too much noise in a regular build.770# These warnings generated too much noise in a regular build.
752# Use make W=1 to enable them (see scripts/Makefile.extrawarn)771# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
753KBUILD_CFLAGS += -Wno-unused-but-set-variable772KBUILD_CFLAGS += -Wno-unused-but-set-variable
773
774# Warn about unmarked fall-throughs in switch statement.
775# Disabled for clang while comment to attribute conversion happens and
776# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
777KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
754endif778endif
755 779
756KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)780KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
@@ -845,9 +869,6 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) · 88 unmodified lines
845# warn about C99 declaration after statement869# warn about C99 declaration after statement
846KBUILD_CFLAGS += -Wdeclaration-after-statement870KBUILD_CFLAGS += -Wdeclaration-after-statement
847 871
848# Warn about unmarked fall-throughs in switch statement.
849KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
850
851# Variable Length Arrays (VLAs) should not be used anywhere in the kernel872# Variable Length Arrays (VLAs) should not be used anywhere in the kernel
852KBUILD_CFLAGS += -Wvla873KBUILD_CFLAGS += -Wvla
853 874
@@ -900,11 +921,10 @@ include scripts/Makefile.kasan · 46 unmodified lines
900include scripts/Makefile.extrawarn921include scripts/Makefile.extrawarn
901include scripts/Makefile.ubsan922include scripts/Makefile.ubsan
902 923
903# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the924# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
904# last assignments925KBUILD_CPPFLAGS += $(KCPPFLAGS)
905KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)926KBUILD_AFLAGS += $(KAFLAGS)
906KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)927KBUILD_CFLAGS += $(KCFLAGS)
907KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
908 928
909KBUILD_LDFLAGS_MODULE += --build-id929KBUILD_LDFLAGS_MODULE += --build-id
910LDFLAGS_vmlinux += --build-id930LDFLAGS_vmlinux += --build-id
@@ -1007,7 +1027,7 @@ endif · 96 unmodified lines
1007 1027
1008PHONY += prepare01028PHONY += prepare0
1009 1029
1010export MODORDER := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order1030export MODORDER := $(extmod-prefix)modules.order
1011 1031
1012ifeq ($(KBUILD_EXTMOD),)1032ifeq ($(KBUILD_EXTMOD),)
1013core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/1033core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
@@ -1020,6 +1040,9 @@ vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \ · 6 unmodified lines
1020 $(patsubst %/,%,$(filter %/, $(init-) $(core-) \1040 $(patsubst %/,%,$(filter %/, $(init-) $(core-) \
1021 $(drivers-) $(net-) $(libs-) $(virt-))))1041 $(drivers-) $(net-) $(libs-) $(virt-))))
1022 1042
1043build-dirs := $(vmlinux-dirs)
1044clean-dirs := $(vmlinux-alldirs)
1045
1023init-y := $(patsubst %/, %/built-in.a, $(init-y))1046init-y := $(patsubst %/, %/built-in.a, $(init-y))
1024core-y := $(patsubst %/, %/built-in.a, $(core-y))1047core-y := $(patsubst %/, %/built-in.a, $(core-y))
1025drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y))1048drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y))
@@ -1042,7 +1065,7 @@ vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) · 16 unmodified lines
1042# Recurse until adjust_autoksyms.sh is satisfied1065# Recurse until adjust_autoksyms.sh is satisfied
1043PHONY += autoksyms_recursive1066PHONY += autoksyms_recursive
1044ifdef CONFIG_TRIM_UNUSED_KSYMS1067ifdef CONFIG_TRIM_UNUSED_KSYMS
1045autoksyms_recursive: $(vmlinux-deps) modules.order1068autoksyms_recursive: descend modules.order
1046 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \1069 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
1047 "$(MAKE) -f $(srctree)/Makefile vmlinux"1070 "$(MAKE) -f $(srctree)/Makefile vmlinux"
1048endif1071endif
@@ -1074,17 +1097,7 @@ targets := vmlinux · 25 unmodified lines
1074 1097
1075# The actual objects are generated when descending,1098# The actual objects are generated when descending,
1076# make sure no implicit rule kicks in1099# make sure no implicit rule kicks in
1077$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;1100$(sort $(vmlinux-deps)): descend ;
1078
1079# Handle descending into subdirectories listed in $(vmlinux-dirs)
1080# Preset locale variables to speed up the build process. Limit locale
1081# tweaks to this spot to avoid wrong language settings when running
1082# make menuconfig etc.
1083# Error messages still appears in the original language
1084
1085PHONY += $(vmlinux-dirs)
1086$(vmlinux-dirs): prepare
1087 $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1
1088 1101
1089filechk_kernel.release = \1102filechk_kernel.release = \
1090 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"1103 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
@@ -1106,24 +1119,9 @@ scripts: scripts_basic scripts_dtc · 15 unmodified lines
1106# archprepare is used in arch Makefiles and when processed asm symlink,1119# archprepare is used in arch Makefiles and when processed asm symlink,
1107# version.h and scripts_basic is processed / created.1120# version.h and scripts_basic is processed / created.
1108 1121
1109PHONY += prepare archprepare prepare31122PHONY += prepare archprepare
1110 1123
1111# prepare3 is used to check if we are building in a separate output directory,1124archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
1112# and if so do:
1113# 1) Check that make has not been executed in the kernel src $(srctree)
1114prepare3: include/config/kernel.release
1115ifdef building_out_of_srctree
1116 @$(kecho) ' Using $(srctree) as source for kernel'
1117 $(Q)if [ -f $(srctree)/.config -o \
1118 -d $(srctree)/include/config -o \
1119 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
1120 echo >&2 " $(srctree) is not clean, please run 'make ARCH=$(ARCH) mrproper'"; \
1121 echo >&2 " in the '$(srctree)' directory.";\
1122 /bin/false; \
1123 fi;
1124endif
1125
1126archprepare: archheaders archscripts scripts prepare3 outputmakefile \
1127 asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h1125 asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h
1128 1126
1129prepare0: archprepare1127prepare0: archprepare
@@ -1248,7 +1246,7 @@ kselftest-merge: · 118 unmodified lines
1248 $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))1246 $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
1249 $(Q)find $(srctree)/tools/testing/selftests -name config | \1247 $(Q)find $(srctree)/tools/testing/selftests -name config | \
1250 xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config1248 xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
1251 +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig1249 $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
1252 1250
1253# ---------------------------------------------------------------------------1251# ---------------------------------------------------------------------------
1254# Devicetree files1252# Devicetree files
@@ -1259,11 +1257,11 @@ endif · 4 unmodified lines
1259 1257
1260ifneq ($(dtstree),)1258ifneq ($(dtstree),)
1261 1259
1262%.dtb: prepare3 scripts_dtc1260%.dtb: include/config/kernel.release scripts_dtc
1263 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@1261 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
1264 1262
1265PHONY += dtbs dtbs_install dt_binding_check1263PHONY += dtbs dtbs_install dt_binding_check
1266dtbs dtbs_check: prepare3 scripts_dtc1264dtbs dtbs_check: include/config/kernel.release scripts_dtc
1267 $(Q)$(MAKE) $(build)=$(dtstree)1265 $(Q)$(MAKE) $(build)=$(dtstree)
1268 1266
1269dtbs_check: export CHECK_DTBS=11267dtbs_check: export CHECK_DTBS=1
@@ -1302,17 +1300,16 @@ all: modules · 32 unmodified lines
1302 1300
1303PHONY += modules1301PHONY += modules
1304modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin1302modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin
1305 @$(kecho) ' Building modules, stage 2.';
1306 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost1303 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1307 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh1304 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh
1308 1305
1309modules.order: $(vmlinux-dirs)1306modules.order: descend
1310 $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@1307 $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
1311 1308
1312modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs))1309modbuiltin-dirs := $(addprefix _modbuiltin_, $(build-dirs))
1313 1310
1314modules.builtin: $(modbuiltin-dirs)1311modules.builtin: $(modbuiltin-dirs)
1315 $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@1312 $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
1316 1313
1317PHONY += $(modbuiltin-dirs)1314PHONY += $(modbuiltin-dirs)
1318# tristate.conf is not included from this Makefile. Add it as a prerequisite1315# tristate.conf is not included from this Makefile. Add it as a prerequisite
@@ -1385,12 +1382,14 @@ CLEAN_FILES += modules.builtin.modinfo · 66 unmodified lines
1385 1382
1386# Directories & files removed with 'make mrproper'1383# Directories & files removed with 'make mrproper'
1387MRPROPER_DIRS += include/config include/generated \1384MRPROPER_DIRS += include/config include/generated \
1388 arch/$(SRCARCH)/include/generated .tmp_objdiff1385 arch/$(SRCARCH)/include/generated .tmp_objdiff \
1386 debian/ snap/ tar-install/
1389MRPROPER_FILES += .config .config.old .version \1387MRPROPER_FILES += .config .config.old .version \
1390 Module.symvers \1388 Module.symvers \
1391 signing_key.pem signing_key.priv signing_key.x509 \1389 signing_key.pem signing_key.priv signing_key.x509 \
1392 x509.genkey extra_certificates signing_key.x509.keyid \1390 x509.genkey extra_certificates signing_key.x509.keyid \
1393 signing_key.x509.signer vmlinux-gdb.py1391 signing_key.x509.signer vmlinux-gdb.py \
1392 *.spec
1394 1393
1395# Directories & files removed with 'make distclean'1394# Directories & files removed with 'make distclean'
1396DISTCLEAN_DIRS +=1395DISTCLEAN_DIRS +=
@@ -1400,11 +1399,8 @@ DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS · 3 unmodified lines
1400#1399#
1401clean: rm-dirs := $(CLEAN_DIRS)1400clean: rm-dirs := $(CLEAN_DIRS)
1402clean: rm-files := $(CLEAN_FILES)1401clean: rm-files := $(CLEAN_FILES)
1403clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs))
1404 1402
1405PHONY += $(clean-dirs) clean archclean vmlinuxclean1403PHONY += archclean vmlinuxclean
1406$(clean-dirs):
1407 $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
1408 1404
1409vmlinuxclean:1405vmlinuxclean:
1410 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean1406 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
@@ -1445,13 +1441,11 @@ distclean: mrproper · 34 unmodified lines
1445 1441
1446# Packaging of the kernel to various formats1442# Packaging of the kernel to various formats
1447# ---------------------------------------------------------------------------1443# ---------------------------------------------------------------------------
1448package-dir := scripts/package
1449 1444
1450%src-pkg: FORCE1445%src-pkg: FORCE
1451 $(Q)$(MAKE) $(build)=$(package-dir) $@1446 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
1452%pkg: include/config/kernel.release FORCE1447%pkg: include/config/kernel.release FORCE
1453 $(Q)$(MAKE) $(build)=$(package-dir) $@1448 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
1454
1455 1449
1456# Brief documentation of the typical targets used1450# Brief documentation of the typical targets used
1457# ---------------------------------------------------------------------------1451# ---------------------------------------------------------------------------
@@ -1525,7 +1519,7 @@ help: · 67 unmodified lines
1525 @echo ' or "cd tools; make help"'1519 @echo ' or "cd tools; make help"'
1526 @echo ''1520 @echo ''
1527 @echo 'Kernel packaging:'1521 @echo 'Kernel packaging:'
1528 @$(MAKE) $(build)=$(package-dir) help1522 @$(MAKE) -f $(srctree)/scripts/Makefile.package help
1529 @echo ''1523 @echo ''
1530 @echo 'Documentation targets:'1524 @echo 'Documentation targets:'
1531 @$(MAKE) -f $(srctree)/Documentation/Makefile dochelp1525 @$(MAKE) -f $(srctree)/Documentation/Makefile dochelp
@@ -1550,7 +1544,7 @@ help: · 18 unmodified lines
1550 @echo ' make C=1 [targets] Check re-compiled c source with $$CHECK (sparse by default)'1544 @echo ' make C=1 [targets] Check re-compiled c source with $$CHECK (sparse by default)'
1551 @echo ' make C=2 [targets] Force check of all c source with $$CHECK'1545 @echo ' make C=2 [targets] Force check of all c source with $$CHECK'
1552 @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'1546 @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
1553 @echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where'1547 @echo ' make W=n [targets] Enable extra build checks, n=1,2,3 where'
1554 @echo ' 1: warnings which may be relevant and do not occur too often'1548 @echo ' 1: warnings which may be relevant and do not occur too often'
1555 @echo ' 2: warnings which occur quite often but may still be relevant'1549 @echo ' 2: warnings which occur quite often but may still be relevant'
1556 @echo ' 3: more obscure warnings, can most likely be ignored'1550 @echo ' 3: more obscure warnings, can most likely be ignored'
@@ -1579,7 +1573,7 @@ $(help-board-dirs): help-%: · 22 unmodified lines
1579DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \1573DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
1580 linkcheckdocs dochelp refcheckdocs1574 linkcheckdocs dochelp refcheckdocs
1581PHONY += $(DOC_TARGETS)1575PHONY += $(DOC_TARGETS)
1582$(DOC_TARGETS): scripts_basic FORCE1576$(DOC_TARGETS):
1583 $(Q)$(MAKE) $(build)=Documentation $@1577 $(Q)$(MAKE) $(build)=Documentation $@
1584 1578
1585# Misc1579# Misc
@@ -1624,13 +1618,9 @@ $(objtree)/Module.symvers: · 38 unmodified lines
1624 echo " is missing; modules will have no dependencies and modversions."; \1618 echo " is missing; modules will have no dependencies and modversions."; \
1625 echo )1619 echo )
1626 1620
1627module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))1621build-dirs := $(KBUILD_EXTMOD)
1628PHONY += $(module-dirs) modules1622PHONY += modules
1629$(module-dirs): prepare $(objtree)/Module.symvers1623modules: descend $(objtree)/Module.symvers
1630 $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) need-modorder=1
1631
1632modules: $(module-dirs)
1633 @$(kecho) ' Building modules, stage 2.';
1634 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost1624 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1635 1625
1636PHONY += modules_install1626PHONY += modules_install
@@ -1646,14 +1636,13 @@ PHONY += _emodinst_post · 9 unmodified lines
1646_emodinst_post: _emodinst_1636_emodinst_post: _emodinst_
1647 $(call cmd,depmod)1637 $(call cmd,depmod)
1648 1638
1649clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD))1639clean-dirs := $(KBUILD_EXTMOD)
1650
1651PHONY += $(clean-dirs) clean
1652$(clean-dirs):
1653 $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
1654
1655clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers1640clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers
1656 1641
1642PHONY += /
1643/:
1644 @echo >&2 '"$(MAKE) /" is no longer supported. Please use "$(MAKE) ./" instead.'
1645
1657PHONY += help1646PHONY += help
1658help:1647help:
1659 @echo ' Building external modules.'1648 @echo ' Building external modules.'
@@ -1667,6 +1656,21 @@ help: · 7 unmodified lines
1667PHONY += prepare1656PHONY += prepare
1668endif # KBUILD_EXTMOD1657endif # KBUILD_EXTMOD
1669 1658
1659# Handle descending into subdirectories listed in $(build-dirs)
1660# Preset locale variables to speed up the build process. Limit locale
1661# tweaks to this spot to avoid wrong language settings when running
1662# make menuconfig etc.
1663# Error messages still appears in the original language
1664PHONY += descend $(build-dirs)
1665descend: $(build-dirs)
1666$(build-dirs): prepare
1667 $(Q)$(MAKE) $(build)=$@ single-build=$(single-build) need-builtin=1 need-modorder=1
1668
1669clean-dirs := $(addprefix _clean_, $(clean-dirs))
1670PHONY += $(clean-dirs) clean
1671$(clean-dirs):
1672 $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
1673
1670clean: $(clean-dirs)1674clean: $(clean-dirs)
1671 $(call cmd,rmdirs)1675 $(call cmd,rmdirs)
1672 $(call cmd,rmfiles)1676 $(call cmd,rmfiles)
@@ -1688,7 +1692,7 @@ clean: $(clean-dirs) · 15 unmodified lines
1688# Generate tags for editors1692# Generate tags for editors
1689# ---------------------------------------------------------------------------1693# ---------------------------------------------------------------------------
1690quiet_cmd_tags = GEN $@1694quiet_cmd_tags = GEN $@
1691 cmd_tags = $(CONFIG_SHELL) $(srctree)/scripts/tags.sh $@1695 cmd_tags = $(BASH) $(srctree)/scripts/tags.sh $@
1692 1696
1693tags TAGS cscope gtags: FORCE1697tags TAGS cscope gtags: FORCE
1694 $(call cmd,tags)1698 $(call cmd,tags)
@@ -1709,7 +1713,7 @@ versioncheck: · 14 unmodified lines
1709 | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl1713 | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl
1710 1714
1711coccicheck:1715coccicheck:
1712 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/$@1716 $(Q)$(BASH) $(srctree)/scripts/$@
1713 1717
1714namespacecheck:1718namespacecheck:
1715 $(PERL) $(srctree)/scripts/namespace.pl1719 $(PERL) $(srctree)/scripts/namespace.pl
@@ -1757,45 +1761,47 @@ tools/%: FORCE · 41 unmodified lines
1757 1761
1758# Single targets1762# Single targets
1759# ---------------------------------------------------------------------------1763# ---------------------------------------------------------------------------
1760# Single targets are compatible with:1764# To build individual files in subdirectories, you can do like this:
1761# - build with mixed source and output1765#
1762# - build with separate output dir 'make O=...'1766# make foo/bar/baz.s
1763# - external modules
1764#1767#
1765# target-dir => where to store outputfile1768# The supported suffixes for single-target are listed in 'single-targets'
1766# build-dir => directory in kernel source tree to use1769#
1767 1770# To build only under specific subdirectories, you can do like this:
1768build-target = $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD)/)$@1771#
1769build-dir = $(patsubst %/,%,$(dir $(build-target)))1772# make foo/bar/baz/
1770 1773
1771%.i: prepare FORCE1774ifdef single-build
1772 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1775
1773%.ll: prepare FORCE1776single-all := $(filter $(single-targets), $(MAKECMDGOALS))
1774 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1777
1775%.lst: prepare FORCE1778# .ko is special because modpost is needed
1776 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1779single-ko := $(sort $(filter %.ko, $(single-all)))
1777%.o: prepare FORCE1780single-no-ko := $(sort $(patsubst %.ko,%.mod, $(single-all)))
1778 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1781
1779%.s: prepare FORCE1782$(single-ko): single_modpost
1780 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1783 @:
1781%.symtypes: prepare FORCE1784$(single-no-ko): descend
1782 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1785 @:
1786
1783ifeq ($(KBUILD_EXTMOD),)1787ifeq ($(KBUILD_EXTMOD),)
1784# For the single build of an in-tree module, use a temporary file to avoid1788# For the single build of in-tree modules, use a temporary file to avoid
1785# the situation of modules_install installing an invalid modules.order.1789# the situation of modules_install installing an invalid modules.order.
1786%.ko: MODORDER := .modules.tmp1790MODORDER := .modules.tmp
1787endif1791endif
1788%.ko: prepare FORCE1792
1789 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target:.ko=.mod)1793PHONY += single_modpost
1790 $(Q)echo $(build-target) > $(MODORDER)1794single_modpost: $(single-no-ko)
1795 $(Q){ $(foreach m, $(single-ko), echo $(extmod-prefix)$m;) } > $(MODORDER)
1791 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost1796 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1792 1797
1793# Modules1798KBUILD_MODULES := 1
1794PHONY += /
1795/: ./
1796 1799
1797%/: prepare FORCE1800export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod-prefix), $(single-no-ko))
1798 $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) need-modorder=11801
1802single-build = $(if $(filter-out $@/, $(single-no-ko)),1)
1803
1804endif
1799 1805
1800# FIXME Should go into a make.lib or something1806# FIXME Should go into a make.lib or something
1801# ===========================================================================1807# ===========================================================================
@@ -1816,9 +1822,9 @@ existing-targets := $(wildcard $(sort $(targets))) · 14 unmodified lines
1816 1822
1817-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)1823-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
1818 1824
1819endif # ifeq ($(config-targets),1)1825endif # config-targets
1820endif # ifeq ($(mixed-targets),1)1826endif # mixed-build
1821endif # need-sub-make1827endif # need-sub-make
1822 1828
1823PHONY += FORCE1829PHONY += FORCE
1824FORCE:1830FORCE:
arch/Kconfig+7−0
@@ -292,6 +292,13 @@ config ARCH_32BIT_OFF_T · 291 unmodified lines
292 still support 32-bit off_t. This option is enabled for all such292 still support 32-bit off_t. This option is enabled for all such
293 architectures explicitly.293 architectures explicitly.
294 294
295config HAVE_ASM_MODVERSIONS
296 bool
297 help
298 This symbol should be selected by an architecure if it provides
299 <asm/asm-prototypes.h> to support the module versioning for symbols
300 exported from assembly code.
301
295config HAVE_REGS_AND_STACK_ACCESS_API302config HAVE_REGS_AND_STACK_ACCESS_API
296 bool303 bool
297 help304 help
arch/alpha/Kconfig+1−0
@@ -11,6 +11,7 @@ config ALPHA · 10 unmodified lines
11 select PCI_DOMAINS if PCI11 select PCI_DOMAINS if PCI
12 select PCI_SYSCALL if PCI12 select PCI_SYSCALL if PCI
13 select HAVE_AOUT13 select HAVE_AOUT
14 select HAVE_ASM_MODVERSIONS
14 select HAVE_IDE15 select HAVE_IDE
15 select HAVE_OPROFILE16 select HAVE_OPROFILE
16 select HAVE_PCSPKR_PLATFORM17 select HAVE_PCSPKR_PLATFORM
arch/arc/Makefile+0−8
@@ -48,14 +48,6 @@ endif · 47 unmodified lines
48cfi := $(call as-instr,.cfi_startproc\n.cfi_endproc,-DARC_DW2_UNWIND_AS_CFI)48cfi := $(call as-instr,.cfi_startproc\n.cfi_endproc,-DARC_DW2_UNWIND_AS_CFI)
49cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables $(cfi)49cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables $(cfi)
50 50
51ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
52# Generic build system uses -O2, we want -O3
53# Note: No need to add to cflags-y as that happens anyways
54#
55# Disable the false maybe-uninitialized warings gcc spits out at -O3
56ARCH_CFLAGS += -O3 $(call cc-disable-warning,maybe-uninitialized,)
57endif
58
59# small data is default for elf32 tool-chain. If not usable, disable it51# small data is default for elf32 tool-chain. If not usable, disable it
60# This also allows repurposing GP as scratch reg to gcc reg allocator52# This also allows repurposing GP as scratch reg to gcc reg allocator
61disable_small_data := y53disable_small_data := y
arch/arc/configs/axs101_defconfig+1−0
@@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y · 8 unmodified lines
9# CONFIG_UTS_NS is not set9# CONFIG_UTS_NS is not set
10# CONFIG_PID_NS is not set10# CONFIG_PID_NS is not set
11CONFIG_BLK_DEV_INITRD=y11CONFIG_BLK_DEV_INITRD=y
12CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
12CONFIG_EMBEDDED=y13CONFIG_EMBEDDED=y
13CONFIG_PERF_EVENTS=y14CONFIG_PERF_EVENTS=y
14# CONFIG_VM_EVENT_COUNTERS is not set15# CONFIG_VM_EVENT_COUNTERS is not set
arch/arc/configs/axs103_defconfig+1−0
@@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y · 8 unmodified lines
9# CONFIG_UTS_NS is not set9# CONFIG_UTS_NS is not set
10# CONFIG_PID_NS is not set10# CONFIG_PID_NS is not set
11CONFIG_BLK_DEV_INITRD=y11CONFIG_BLK_DEV_INITRD=y
12CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
12CONFIG_EMBEDDED=y13CONFIG_EMBEDDED=y
13CONFIG_PERF_EVENTS=y14CONFIG_PERF_EVENTS=y
14# CONFIG_VM_EVENT_COUNTERS is not set15# CONFIG_VM_EVENT_COUNTERS is not set
arch/arc/configs/axs103_smp_defconfig+1−0
@@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y · 8 unmodified lines
9# CONFIG_UTS_NS is not set9# CONFIG_UTS_NS is not set
10# CONFIG_PID_NS is not set10# CONFIG_PID_NS is not set
11CONFIG_BLK_DEV_INITRD=y11CONFIG_BLK_DEV_INITRD=y
12CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
12CONFIG_EMBEDDED=y13CONFIG_EMBEDDED=y
13CONFIG_PERF_EVENTS=y14CONFIG_PERF_EVENTS=y
14# CONFIG_VM_EVENT_COUNTERS is not set15# CONFIG_VM_EVENT_COUNTERS is not set
arch/arc/configs/haps_hs_defconfig+1−0
@@ -10,6 +10,7 @@ CONFIG_NAMESPACES=y · 9 unmodified lines
10# CONFIG_UTS_NS is not set10# CONFIG_UTS_NS is not set
11# CONFIG_PID_NS is not set11# CONFIG_PID_NS is not set
12CONFIG_BLK_DEV_INITRD=y12CONFIG_BLK_DEV_INITRD=y
13CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
13CONFIG_EXPERT=y14CONFIG_EXPERT=y
14CONFIG_PERF_EVENTS=y15CONFIG_PERF_EVENTS=y
15# CONFIG_COMPAT_BRK is not set16# CONFIG_COMPAT_BRK is not set
arch/arc/configs/haps_hs_smp_defconfig+1−0
@@ -10,6 +10,7 @@ CONFIG_NAMESPACES=y · 9 unmodified lines
10# CONFIG_UTS_NS is not set10# CONFIG_UTS_NS is not set
11# CONFIG_PID_NS is not set11# CONFIG_PID_NS is not set
12CONFIG_BLK_DEV_INITRD=y12CONFIG_BLK_DEV_INITRD=y
13CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
13CONFIG_EMBEDDED=y14CONFIG_EMBEDDED=y
14CONFIG_PERF_EVENTS=y15CONFIG_PERF_EVENTS=y
15# CONFIG_VM_EVENT_COUNTERS is not set16# CONFIG_VM_EVENT_COUNTERS is not set
arch/arc/configs/hsdk_defconfig+1−0
@@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y · 8 unmodified lines
9# CONFIG_PID_NS is not set9# CONFIG_PID_NS is not set
10CONFIG_BLK_DEV_INITRD=y10CONFIG_BLK_DEV_INITRD=y
11CONFIG_BLK_DEV_RAM=y11CONFIG_BLK_DEV_RAM=y
12CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
12CONFIG_EMBEDDED=y13CONFIG_EMBEDDED=y
13CONFIG_PERF_EVENTS=y14CONFIG_PERF_EVENTS=y
14# CONFIG_VM_EVENT_COUNTERS is not set15# CONFIG_VM_EVENT_COUNTERS is not set
arch/arc/configs/nps_defconfig+1−0
@@ -6,6 +6,7 @@ CONFIG_HIGH_RES_TIMERS=y · 5 unmodified lines
6CONFIG_IKCONFIG=y6CONFIG_IKCONFIG=y
7CONFIG_IKCONFIG_PROC=y7CONFIG_IKCONFIG_PROC=y
8CONFIG_BLK_DEV_INITRD=y8CONFIG_BLK_DEV_INITRD=y
9CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
9CONFIG_SYSCTL_SYSCALL=y10CONFIG_SYSCTL_SYSCALL=y
10# CONFIG_EPOLL is not set11# CONFIG_EPOLL is not set
11# CONFIG_SIGNALFD is not set12# CONFIG_SIGNALFD is not set
arch/arc/configs/nsim_700_defconfig+1−0
@@ -10,6 +10,7 @@ CONFIG_NAMESPACES=y · 9 unmodified lines
10# CONFIG_UTS_NS is not set10# CONFIG_UTS_NS is not set
11# CONFIG_PID_NS is not set11# CONFIG_PID_NS is not set
12CONFIG_BLK_DEV_INITRD=y12CONFIG_BLK_DEV_INITRD=y
13CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
13CONFIG_KALLSYMS_ALL=y14CONFIG_KALLSYMS_ALL=y
14CONFIG_EMBEDDED=y15CONFIG_EMBEDDED=y
15CONFIG_PERF_EVENTS=y16CONFIG_PERF_EVENTS=y
arch/arc/configs/nsim_hs_defconfig+1−0
@@ -10,6 +10,7 @@ CONFIG_NAMESPACES=y · 9 unmodified lines
10# CONFIG_UTS_NS is not set10# CONFIG_UTS_NS is not set
11# CONFIG_PID_NS is not set11# CONFIG_PID_NS is not set
12CONFIG_BLK_DEV_INITRD=y12CONFIG_BLK_DEV_INITRD=y
13CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
13CONFIG_KALLSYMS_ALL=y14CONFIG_KALLSYMS_ALL=y
14CONFIG_EMBEDDED=y15CONFIG_EMBEDDED=y
15CONFIG_PERF_EVENTS=y16CONFIG_PERF_EVENTS=y
arch/arc/configs/nsim_hs_smp_defconfig+1−0
@@ -8,6 +8,7 @@ CONFIG_NAMESPACES=y · 7 unmodified lines
8# CONFIG_UTS_NS is not set8# CONFIG_UTS_NS is not set
9# CONFIG_PID_NS is not set9# CONFIG_PID_NS is not set
10CONFIG_BLK_DEV_INITRD=y10CONFIG_BLK_DEV_INITRD=y
11CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
11CONFIG_KALLSYMS_ALL=y12CONFIG_KALLSYMS_ALL=y
12CONFIG_EMBEDDED=y13CONFIG_EMBEDDED=y
13CONFIG_PERF_EVENTS=y14CONFIG_PERF_EVENTS=y
arch/arc/configs/nsimosci_defconfig+1−0
@@ -10,6 +10,7 @@ CONFIG_NAMESPACES=y · 9 unmodified lines
10# CONFIG_UTS_NS is not set10# CONFIG_UTS_NS is not set
11# CONFIG_PID_NS is not set11# CONFIG_PID_NS is not set
12CONFIG_BLK_DEV_INITRD=y12CONFIG_BLK_DEV_INITRD=y
13CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
13CONFIG_KALLSYMS_ALL=y14CONFIG_KALLSYMS_ALL=y
14CONFIG_EMBEDDED=y15CONFIG_EMBEDDED=y
15CONFIG_PERF_EVENTS=y16CONFIG_PERF_EVENTS=y
arch/arc/configs/nsimosci_hs_defconfig+1−0
@@ -10,6 +10,7 @@ CONFIG_NAMESPACES=y · 9 unmodified lines
10# CONFIG_UTS_NS is not set10# CONFIG_UTS_NS is not set
11# CONFIG_PID_NS is not set11# CONFIG_PID_NS is not set
12CONFIG_BLK_DEV_INITRD=y12CONFIG_BLK_DEV_INITRD=y
13CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
13CONFIG_KALLSYMS_ALL=y14CONFIG_KALLSYMS_ALL=y
14CONFIG_EMBEDDED=y15CONFIG_EMBEDDED=y
15CONFIG_PERF_EVENTS=y16CONFIG_PERF_EVENTS=y
arch/arc/configs/nsimosci_hs_smp_defconfig+1−0
@@ -8,6 +8,7 @@ CONFIG_IKCONFIG_PROC=y · 7 unmodified lines
8# CONFIG_UTS_NS is not set8# CONFIG_UTS_NS is not set
9# CONFIG_PID_NS is not set9# CONFIG_PID_NS is not set
10CONFIG_BLK_DEV_INITRD=y10CONFIG_BLK_DEV_INITRD=y
11CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
11CONFIG_PERF_EVENTS=y12CONFIG_PERF_EVENTS=y
12# CONFIG_COMPAT_BRK is not set13# CONFIG_COMPAT_BRK is not set
13CONFIG_KPROBES=y14CONFIG_KPROBES=y
arch/arc/configs/tb10x_defconfig+1−0
@@ -14,6 +14,7 @@ CONFIG_INITRAMFS_SOURCE="../tb10x-rootfs.cpio" · 13 unmodified lines
14CONFIG_INITRAMFS_ROOT_UID=210014CONFIG_INITRAMFS_ROOT_UID=2100
15CONFIG_INITRAMFS_ROOT_GID=50115CONFIG_INITRAMFS_ROOT_GID=501
16# CONFIG_RD_GZIP is not set16# CONFIG_RD_GZIP is not set
17CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
17CONFIG_SYSCTL_SYSCALL=y18CONFIG_SYSCTL_SYSCALL=y
18CONFIG_KALLSYMS_ALL=y19CONFIG_KALLSYMS_ALL=y
19# CONFIG_AIO is not set20# CONFIG_AIO is not set
arch/arc/configs/vdk_hs38_defconfig+1−0
@@ -4,6 +4,7 @@ CONFIG_HIGH_RES_TIMERS=y · 3 unmodified lines
4CONFIG_IKCONFIG=y4CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y5CONFIG_IKCONFIG_PROC=y
6CONFIG_BLK_DEV_INITRD=y6CONFIG_BLK_DEV_INITRD=y
7CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
7CONFIG_EMBEDDED=y8CONFIG_EMBEDDED=y
8CONFIG_PERF_EVENTS=y9CONFIG_PERF_EVENTS=y
9# CONFIG_VM_EVENT_COUNTERS is not set10# CONFIG_VM_EVENT_COUNTERS is not set
arch/arc/configs/vdk_hs38_smp_defconfig+1−0
@@ -4,6 +4,7 @@ CONFIG_HIGH_RES_TIMERS=y · 3 unmodified lines
4CONFIG_IKCONFIG=y4CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y5CONFIG_IKCONFIG_PROC=y
6CONFIG_BLK_DEV_INITRD=y6CONFIG_BLK_DEV_INITRD=y
7CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
7CONFIG_EMBEDDED=y8CONFIG_EMBEDDED=y
8CONFIG_PERF_EVENTS=y9CONFIG_PERF_EVENTS=y
9# CONFIG_VM_EVENT_COUNTERS is not set10# CONFIG_VM_EVENT_COUNTERS is not set
arch/arm/Makefile+1−1
@@ -17,7 +17,7 @@ KBUILD_LDFLAGS_MODULE += --be8 · 16 unmodified lines
17endif17endif
18 18
19ifeq ($(CONFIG_ARM_MODULE_PLTS),y)19ifeq ($(CONFIG_ARM_MODULE_PLTS),y)
20KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds20KBUILD_LDS_MODULE += $(srctree)/arch/arm/kernel/module.lds
21endif21endif
22 22
23GZFLAGS :=-923GZFLAGS :=-9
arch/arm/kvm/Makefile+3−2
@@ -8,13 +8,14 @@ ifeq ($(plus_virt),+virt) · 7 unmodified lines
8 plus_virt_def := -DREQUIRES_VIRT=18 plus_virt_def := -DREQUIRES_VIRT=1
9endif9endif
10 10
11KVM := ../../../virt/kvm
12
11ccflags-y += -I $(srctree)/$(src) -I $(srctree)/virt/kvm/arm/vgic13ccflags-y += -I $(srctree)/$(src) -I $(srctree)/virt/kvm/arm/vgic
12CFLAGS_arm.o := $(plus_virt_def)14CFLAGS_$(KVM)/arm/arm.o := $(plus_virt_def)
13 15
14AFLAGS_init.o := -Wa,-march=armv7-a$(plus_virt)16AFLAGS_init.o := -Wa,-march=armv7-a$(plus_virt)
15AFLAGS_interrupts.o := -Wa,-march=armv7-a$(plus_virt)17AFLAGS_interrupts.o := -Wa,-march=armv7-a$(plus_virt)
16 18
17KVM := ../../../virt/kvm
18kvm-arm-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o $(KVM)/vfio.o19kvm-arm-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o $(KVM)/vfio.o
19 20
20obj-$(CONFIG_KVM_ARM_HOST) += hyp/21obj-$(CONFIG_KVM_ARM_HOST) += hyp/
arch/arm64/Kconfig+1−0
@@ -134,6 +134,7 @@ config ARM64 · 133 unmodified lines
134 select HAVE_ARCH_TRANSPARENT_HUGEPAGE134 select HAVE_ARCH_TRANSPARENT_HUGEPAGE
135 select HAVE_ARCH_VMAP_STACK135 select HAVE_ARCH_VMAP_STACK
136 select HAVE_ARM_SMCCC136 select HAVE_ARM_SMCCC
137 select HAVE_ASM_MODVERSIONS
137 select HAVE_EBPF_JIT138 select HAVE_EBPF_JIT
138 select HAVE_C_RECORDMCOUNT139 select HAVE_C_RECORDMCOUNT
139 select HAVE_CMPXCHG_DOUBLE140 select HAVE_CMPXCHG_DOUBLE
arch/arm64/Makefile+1−1
@@ -108,7 +108,7 @@ endif · 107 unmodified lines
108CHECKFLAGS += -D__aarch64__108CHECKFLAGS += -D__aarch64__
109 109
110ifeq ($(CONFIG_ARM64_MODULE_PLTS),y)110ifeq ($(CONFIG_ARM64_MODULE_PLTS),y)
111KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm64/kernel/module.lds111KBUILD_LDS_MODULE += $(srctree)/arch/arm64/kernel/module.lds
112endif112endif
113 113
114# Default value114# Default value
arch/ia64/Kconfig+1−0
@@ -19,6 +19,7 @@ config IA64 · 18 unmodified lines
19 select PCI_DOMAINS if PCI19 select PCI_DOMAINS if PCI
20 select PCI_MSI20 select PCI_MSI
21 select PCI_SYSCALL if PCI21 select PCI_SYSCALL if PCI
22 select HAVE_ASM_MODVERSIONS
22 select HAVE_UNSTABLE_SCHED_CLOCK23 select HAVE_UNSTABLE_SCHED_CLOCK
23 select HAVE_EXIT_THREAD24 select HAVE_EXIT_THREAD
24 select HAVE_IDE25 select HAVE_IDE
arch/ia64/Makefile+1−1
@@ -20,7 +20,7 @@ CHECKFLAGS += -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__ · 19 unmodified lines
20 20
21OBJCOPYFLAGS := --strip-all21OBJCOPYFLAGS := --strip-all
22LDFLAGS_vmlinux := -static22LDFLAGS_vmlinux := -static
23KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds23KBUILD_LDS_MODULE += $(srctree)/arch/ia64/module.lds
24KBUILD_AFLAGS_KERNEL := -mconstant-gp24KBUILD_AFLAGS_KERNEL := -mconstant-gp
25EXTRA :=25EXTRA :=
26 26
arch/m68k/Kconfig+1−0
@@ -12,6 +12,7 @@ config M68K · 11 unmodified lines
12 select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE12 select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE
13 select HAVE_IDE13 select HAVE_IDE
14 select HAVE_AOUT if MMU14 select HAVE_AOUT if MMU
15 select HAVE_ASM_MODVERSIONS
15 select HAVE_DEBUG_BUGVERBOSE16 select HAVE_DEBUG_BUGVERBOSE
16 select GENERIC_IRQ_SHOW17 select GENERIC_IRQ_SHOW
17 select GENERIC_ATOMIC6418 select GENERIC_ATOMIC64
arch/m68k/Makefile+1−1
@@ -73,7 +73,7 @@ KBUILD_AFLAGS += -D__uClinux__ · 72 unmodified lines
73endif73endif
74 74
75KBUILD_LDFLAGS := -m m68kelf75KBUILD_LDFLAGS := -m m68kelf
76KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds76KBUILD_LDS_MODULE += $(srctree)/arch/m68k/kernel/module.lds
77 77
78ifdef CONFIG_SUN378ifdef CONFIG_SUN3
79LDFLAGS_vmlinux = -N79LDFLAGS_vmlinux = -N
arch/mips/Kconfig+1−0
@@ -44,6 +44,7 @@ config MIPS · 43 unmodified lines
44 select HAVE_ARCH_SECCOMP_FILTER44 select HAVE_ARCH_SECCOMP_FILTER
45 select HAVE_ARCH_TRACEHOOK45 select HAVE_ARCH_TRACEHOOK
46 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT46 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
47 select HAVE_ASM_MODVERSIONS
47 select HAVE_EBPF_JIT if (!CPU_MICROMIPS)48 select HAVE_EBPF_JIT if (!CPU_MICROMIPS)
48 select HAVE_CONTEXT_TRACKING49 select HAVE_CONTEXT_TRACKING
49 select HAVE_COPY_THREAD_TLS50 select HAVE_COPY_THREAD_TLS
arch/mips/boot/Makefile+1−1
@@ -160,7 +160,7 @@ targets += vmlinux.lzo.itb · 159 unmodified lines
160quiet_cmd_itb-image = ITB $@160quiet_cmd_itb-image = ITB $@
161 cmd_itb-image = \161 cmd_itb-image = \
162 env PATH="$(objtree)/scripts/dtc:$(PATH)" \162 env PATH="$(objtree)/scripts/dtc:$(PATH)" \
163 $(CONFIG_SHELL) $(MKIMAGE) \163 $(BASH) $(MKIMAGE) \
164 -D "-I dts -O dtb -p 500 \164 -D "-I dts -O dtb -p 500 \
165 --include $(objtree)/arch/mips \165 --include $(objtree)/arch/mips \
166 --warning no-unit_address_vs_reg" \166 --warning no-unit_address_vs_reg" \
arch/parisc/Makefile+1−1
@@ -60,7 +60,7 @@ KBUILD_CFLAGS += -DCC_USING_PATCHABLE_FUNCTION_ENTRY=1 \ · 59 unmodified lines
60 -DFTRACE_PATCHABLE_FUNCTION_SIZE=$(NOP_COUNT)60 -DFTRACE_PATCHABLE_FUNCTION_SIZE=$(NOP_COUNT)
61 61
62CC_FLAGS_FTRACE := -fpatchable-function-entry=$(NOP_COUNT),$(shell echo $$(($(NOP_COUNT)-1)))62CC_FLAGS_FTRACE := -fpatchable-function-entry=$(NOP_COUNT),$(shell echo $$(($(NOP_COUNT)-1)))
63KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/parisc/kernel/module.lds63KBUILD_LDS_MODULE += $(srctree)/arch/parisc/kernel/module.lds
64endif64endif
65 65
66OBJCOPY_FLAGS =-O binary -R .note -R .comment -S66OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
arch/powerpc/Kconfig+1−0
@@ -177,6 +177,7 @@ config PPC · 176 unmodified lines
177 select HAVE_ARCH_NVRAM_OPS177 select HAVE_ARCH_NVRAM_OPS
178 select HAVE_ARCH_SECCOMP_FILTER178 select HAVE_ARCH_SECCOMP_FILTER
179 select HAVE_ARCH_TRACEHOOK179 select HAVE_ARCH_TRACEHOOK
180 select HAVE_ASM_MODVERSIONS
180 select HAVE_C_RECORDMCOUNT181 select HAVE_C_RECORDMCOUNT
181 select HAVE_CBPF_JIT if !PPC64182 select HAVE_CBPF_JIT if !PPC64
182 select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13)183 select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13)
arch/powerpc/Makefile+1−1
@@ -65,7 +65,7 @@ UTS_MACHINE := $(subst $(space),,$(machine-y)) · 64 unmodified lines
65ifdef CONFIG_PPC3265ifdef CONFIG_PPC32
66KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o66KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
67else67else
68KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/powerpc/kernel/module.lds68KBUILD_LDS_MODULE += $(srctree)/arch/powerpc/kernel/module.lds
69ifeq ($(call ld-ifversion, -ge, 225000000, y),y)69ifeq ($(call ld-ifversion, -ge, 225000000, y),y)
70# Have the linker provide sfpr if possible.70# Have the linker provide sfpr if possible.
71# There is a corresponding test in arch/powerpc/lib/Makefile71# There is a corresponding test in arch/powerpc/lib/Makefile
arch/powerpc/Makefile.postlink+1−1
@@ -18,7 +18,7 @@ quiet_cmd_relocs_check = CHKREL $@ · 17 unmodified lines
18ifdef CONFIG_PPC_BOOK3S_6418ifdef CONFIG_PPC_BOOK3S_64
19 cmd_relocs_check = \19 cmd_relocs_check = \
20 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$@" ; \20 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$@" ; \
21 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/unrel_branch_check.sh "$(OBJDUMP)" "$@"21 $(BASH) $(srctree)/arch/powerpc/tools/unrel_branch_check.sh "$(OBJDUMP)" "$@"
22else22else
23 cmd_relocs_check = \23 cmd_relocs_check = \
24 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$@"24 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$@"
arch/powerpc/kernel/prom_init_check.sh+1−1
@@ -33,7 +33,7 @@ OBJ="$2" · 32 unmodified lines
33 33
34ERROR=034ERROR=0
35 35
36function check_section()36check_section()
37{37{
38 file=$138 file=$1
39 section=$239 section=$2
arch/riscv/Kconfig+1−0
@@ -31,6 +31,7 @@ config RISCV · 30 unmodified lines
31 select GENERIC_SMP_IDLE_THREAD31 select GENERIC_SMP_IDLE_THREAD
32 select GENERIC_ATOMIC64 if !64BIT32 select GENERIC_ATOMIC64 if !64BIT
33 select HAVE_ARCH_AUDITSYSCALL33 select HAVE_ARCH_AUDITSYSCALL
34 select HAVE_ASM_MODVERSIONS
34 select HAVE_MEMBLOCK_NODE_MAP35 select HAVE_MEMBLOCK_NODE_MAP
35 select HAVE_DMA_CONTIGUOUS36 select HAVE_DMA_CONTIGUOUS
36 select HAVE_FUTEX_CMPXCHG if FUTEX37 select HAVE_FUTEX_CMPXCHG if FUTEX
arch/riscv/Makefile+1−1
@@ -52,7 +52,7 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y) · 51 unmodified lines
52 KBUILD_CFLAGS += -mcmodel=medany52 KBUILD_CFLAGS += -mcmodel=medany
53endif53endif
54ifeq ($(CONFIG_MODULE_SECTIONS),y)54ifeq ($(CONFIG_MODULE_SECTIONS),y)
55 KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/riscv/kernel/module.lds55 KBUILD_LDS_MODULE += $(srctree)/arch/riscv/kernel/module.lds
56endif56endif
57ifeq ($(CONFIG_PERF_EVENTS),y)57ifeq ($(CONFIG_PERF_EVENTS),y)
58 KBUILD_CFLAGS += -fno-omit-frame-pointer58 KBUILD_CFLAGS += -fno-omit-frame-pointer
arch/s390/Kconfig+1−0
@@ -132,6 +132,7 @@ config S390 · 131 unmodified lines
132 select HAVE_ARCH_TRACEHOOK132 select HAVE_ARCH_TRACEHOOK
133 select HAVE_ARCH_TRANSPARENT_HUGEPAGE133 select HAVE_ARCH_TRANSPARENT_HUGEPAGE
134 select HAVE_ARCH_VMAP_STACK134 select HAVE_ARCH_VMAP_STACK
135 select HAVE_ASM_MODVERSIONS
135 select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES136 select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
136 select HAVE_CMPXCHG_DOUBLE137 select HAVE_CMPXCHG_DOUBLE
137 select HAVE_CMPXCHG_LOCAL138 select HAVE_CMPXCHG_LOCAL
arch/sparc/Kconfig+1−0
@@ -17,6 +17,7 @@ config SPARC · 16 unmodified lines
17 select ARCH_MIGHT_HAVE_PC_SERIO17 select ARCH_MIGHT_HAVE_PC_SERIO
18 select OF18 select OF
19 select OF_PROMTREE19 select OF_PROMTREE
20 select HAVE_ASM_MODVERSIONS
20 select HAVE_IDE21 select HAVE_IDE
21 select HAVE_OPROFILE22 select HAVE_OPROFILE
22 select HAVE_ARCH_KGDB if !SMP || SPARC6423 select HAVE_ARCH_KGDB if !SMP || SPARC64
arch/um/Kconfig+1−0
@@ -9,6 +9,7 @@ config UML · 8 unmodified lines
9 select ARCH_NO_PREEMPT9 select ARCH_NO_PREEMPT
10 select HAVE_ARCH_AUDITSYSCALL10 select HAVE_ARCH_AUDITSYSCALL
11 select HAVE_ARCH_SECCOMP_FILTER11 select HAVE_ARCH_SECCOMP_FILTER
12 select HAVE_ASM_MODVERSIONS
12 select HAVE_UID1613 select HAVE_UID16
13 select HAVE_FUTEX_CMPXCHG if FUTEX14 select HAVE_FUTEX_CMPXCHG if FUTEX
14 select HAVE_DEBUG_KMEMLEAK15 select HAVE_DEBUG_KMEMLEAK
arch/x86/Kconfig+1−0
@@ -147,6 +147,7 @@ config X86 · 146 unmodified lines
147 select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64147 select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64
148 select HAVE_ARCH_VMAP_STACK if X86_64148 select HAVE_ARCH_VMAP_STACK if X86_64
149 select HAVE_ARCH_WITHIN_STACK_FRAMES149 select HAVE_ARCH_WITHIN_STACK_FRAMES
150 select HAVE_ASM_MODVERSIONS
150 select HAVE_CMPXCHG_DOUBLE151 select HAVE_CMPXCHG_DOUBLE
151 select HAVE_CMPXCHG_LOCAL152 select HAVE_CMPXCHG_LOCAL
152 select HAVE_CONTEXT_TRACKING if X86_64153 select HAVE_CONTEXT_TRACKING if X86_64
arch/x86/entry/vdso/Makefile+2−1
@@ -89,6 +89,7 @@ $(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS · 88 unmodified lines
89#89#
90CFLAGS_REMOVE_vdso-note.o = -pg90CFLAGS_REMOVE_vdso-note.o = -pg
91CFLAGS_REMOVE_vclock_gettime.o = -pg91CFLAGS_REMOVE_vclock_gettime.o = -pg
92CFLAGS_REMOVE_vdso32/vclock_gettime.o = -pg
92CFLAGS_REMOVE_vgetcpu.o = -pg93CFLAGS_REMOVE_vgetcpu.o = -pg
93CFLAGS_REMOVE_vvar.o = -pg94CFLAGS_REMOVE_vvar.o = -pg
94 95
@@ -128,7 +129,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE · 33 unmodified lines
128$(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE129$(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE
129 $(call if_changed,vdso_and_check)130 $(call if_changed,vdso_and_check)
130 131
131CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)132CPPFLAGS_vdso32/vdso32.lds = $(CPPFLAGS_vdso.lds)
132VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1133VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1
133 134
134targets += vdso32/vdso32.lds135targets += vdso32/vdso32.lds
drivers/gpu/drm/amd/display/dc/calcs/Makefile+3−3
@@ -36,9 +36,9 @@ ifdef CONFIG_CC_IS_CLANG · 35 unmodified lines
36calcs_ccflags += -msse236calcs_ccflags += -msse2
37endif37endif
38 38
39CFLAGS_dcn_calcs.o := $(calcs_ccflags)39CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calcs.o := $(calcs_ccflags)
40CFLAGS_dcn_calc_auto.o := $(calcs_ccflags)40CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calc_auto.o := $(calcs_ccflags)
41CFLAGS_dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare41CFLAGS_$(AMDDALPATH)/dc/calcs/dcn_calc_math.o := $(calcs_ccflags) -Wno-tautological-compare
42 42
43BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o43BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o
44 44
drivers/gpu/drm/amd/display/dc/dcn20/Makefile+2−2
@@ -16,10 +16,10 @@ else ifneq ($(call cc-option, -mstack-alignment=16),) · 15 unmodified lines
16 cc_stack_align := -mstack-alignment=1616 cc_stack_align := -mstack-alignment=16
17endif17endif
18 18
19CFLAGS_dcn20_resource.o := -mhard-float -msse $(cc_stack_align)19CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mhard-float -msse $(cc_stack_align)
20 20
21ifdef CONFIG_CC_IS_CLANG21ifdef CONFIG_CC_IS_CLANG
22CFLAGS_dcn20_resource.o += -msse222CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o += -msse2
23endif23endif
24 24
25AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20))25AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20))
drivers/gpu/drm/amd/display/dc/dcn21/Makefile+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
3 3
4DCN21 = dcn21_hubp.o dcn21_hubbub.o dcn21_resource.o4DCN21 = dcn21_hubp.o dcn21_hubbub.o dcn21_resource.o
5 5
6CFLAGS_dcn21_resource.o := -mhard-float -msse -mpreferred-stack-boundary=46CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mhard-float -msse -mpreferred-stack-boundary=4
7 7
8AMD_DAL_DCN21 = $(addprefix $(AMDDALPATH)/dc/dcn21/,$(DCN21))8AMD_DAL_DCN21 = $(addprefix $(AMDDALPATH)/dc/dcn21/,$(DCN21))
9 9
drivers/gpu/drm/amd/display/dc/dml/Makefile+11−14
@@ -36,25 +36,22 @@ ifdef CONFIG_CC_IS_CLANG · 35 unmodified lines
36dml_ccflags += -msse236dml_ccflags += -msse2
37endif37endif
38 38
39CFLAGS_display_mode_lib.o := $(dml_ccflags)39CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags)
40 40
41ifdef CONFIG_DRM_AMD_DC_DCN2_041ifdef CONFIG_DRM_AMD_DC_DCN2_0
42CFLAGS_display_mode_vba.o := $(dml_ccflags)42CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_ccflags)
43CFLAGS_display_mode_vba_20.o := $(dml_ccflags)43CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags)
44CFLAGS_display_rq_dlg_calc_20.o := $(dml_ccflags)44CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_ccflags)
45CFLAGS_display_mode_vba_20v2.o := $(dml_ccflags)45CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags)
46CFLAGS_display_rq_dlg_calc_20v2.o := $(dml_ccflags)46CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_ccflags)
47endif47endif
48ifdef CONFIG_DRM_AMD_DC_DCN2_148ifdef CONFIG_DRM_AMD_DC_DCN2_1
49CFLAGS_display_mode_vba_21.o := $(dml_ccflags)49CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_ccflags)
50CFLAGS_display_rq_dlg_calc_21.o := $(dml_ccflags)50CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_ccflags)
51endif51endif
52ifdef CONFIG_DRM_AMD_DCN3AG52CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags)
53CFLAGS_display_mode_vba_3ag.o := $(dml_ccflags)53CFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags)
54endif54CFLAGS_$(AMDDALPATH)/dc/dml/dml_common_defs.o := $(dml_ccflags)
55CFLAGS_dml1_display_rq_dlg_calc.o := $(dml_ccflags)
56CFLAGS_display_rq_dlg_helpers.o := $(dml_ccflags)
57CFLAGS_dml_common_defs.o := $(dml_ccflags)
58 55
59DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \56DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
60 dml_common_defs.o57 dml_common_defs.o
drivers/gpu/drm/amd/display/dc/dsc/Makefile+3−4
@@ -13,10 +13,9 @@ ifdef CONFIG_CC_IS_CLANG · 12 unmodified lines
13dsc_ccflags += -msse213dsc_ccflags += -msse2
14endif14endif
15 15
16CFLAGS_rc_calc.o := $(dsc_ccflags)16CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc.o := $(dsc_ccflags)
17CFLAGS_rc_calc_dpi.o := $(dsc_ccflags)17CFLAGS_$(AMDDALPATH)/dc/dsc/rc_calc_dpi.o := $(dsc_ccflags)
18CFLAGS_codec_main_amd.o := $(dsc_ccflags)18CFLAGS_$(AMDDALPATH)/dc/dsc/dc_dsc.o := $(dsc_ccflags)
19CFLAGS_dc_dsc.o := $(dsc_ccflags)
20 19
21DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o20DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o
22 21
drivers/gpu/drm/i915/Makefile+1−1
@@ -26,7 +26,7 @@ subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror · 25 unmodified lines
26 26
27# Fine grained warnings disable27# Fine grained warnings disable
28CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)28CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
29CFLAGS_intel_fbdev.o = $(call cc-disable-warning, override-init)29CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
30 30
31subdir-ccflags-y += \31subdir-ccflags-y += \
32 $(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)32 $(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
drivers/net/ethernet/aquantia/atlantic/hw_atl/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# kbuild requires Makefile in a directory to build individual objects
drivers/net/ethernet/mellanox/mlx5/core/accel/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2subdir-ccflags-y += -I$(src)/..
drivers/net/ethernet/mellanox/mlx5/core/diag/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2subdir-ccflags-y += -I$(src)/..
drivers/net/ethernet/mellanox/mlx5/core/en/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2subdir-ccflags-y += -I$(src)/..
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/Makefile+0−1
@@ -1 +0,0 @@
1subdir-ccflags-y += -I$(src)/../..
drivers/net/ethernet/mellanox/mlx5/core/en_accel/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2subdir-ccflags-y += -I$(src)/..
drivers/net/ethernet/mellanox/mlx5/core/fpga/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2subdir-ccflags-y += -I$(src)/..
drivers/net/ethernet/mellanox/mlx5/core/ipoib/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2subdir-ccflags-y += -I$(src)/..
drivers/net/ethernet/mellanox/mlx5/core/lib/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2subdir-ccflags-y += -I$(src)/..
drivers/net/ethernet/netronome/nfp/bpf/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# kbuild requires Makefile in a directory to build individual objects
drivers/net/ethernet/netronome/nfp/flower/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# kbuild requires Makefile in a directory to build individual objects
drivers/net/ethernet/netronome/nfp/nfpcore/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# kbuild requires Makefile in a directory to build individual objects
drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# kbuild requires Makefile in a directory to build individual objects
drivers/net/ethernet/netronome/nfp/nic/Makefile+0−2
@@ -1,2 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# kbuild requires Makefile in a directory to build individual objects
include/linux/compiler_types.h+14−6
@@ -130,10 +130,6 @@ struct ftrace_likely_data { · 129 unmodified lines
130 130
131/*131/*
132 * Force always-inline if the user requests it so via the .config.132 * Force always-inline if the user requests it so via the .config.
133 * GCC does not warn about unused static inline functions for
134 * -Wunused-function. This turns out to avoid the need for complex #ifdef
135 * directives. Suppress the warning in clang as well by using "unused"
136 * function attribute, which is redundant but not harmful for gcc.
137 * Prefer gnu_inline, so that extern inline functions do not emit an133 * Prefer gnu_inline, so that extern inline functions do not emit an
138 * externally visible function. This makes extern inline behave as per gnu89134 * externally visible function. This makes extern inline behave as per gnu89
139 * semantics rather than c99. This prevents multiple symbol definition errors135 * semantics rather than c99. This prevents multiple symbol definition errors
@@ -144,15 +140,27 @@ struct ftrace_likely_data { · 4 unmodified lines
144 */140 */
145#if !defined(CONFIG_OPTIMIZE_INLINING)141#if !defined(CONFIG_OPTIMIZE_INLINING)
146#define inline inline __attribute__((__always_inline__)) __gnu_inline \142#define inline inline __attribute__((__always_inline__)) __gnu_inline \
147 __maybe_unused notrace143 __inline_maybe_unused notrace
148#else144#else
149#define inline inline __gnu_inline \145#define inline inline __gnu_inline \
150 __maybe_unused notrace146 __inline_maybe_unused notrace
151#endif147#endif
152 148
153#define __inline__ inline149#define __inline__ inline
154#define __inline inline150#define __inline inline
155 151
152/*
153 * GCC does not warn about unused static inline functions for -Wunused-function.
154 * Suppress the warning in clang as well by using __maybe_unused, but enable it
155 * for W=1 build. This will allow clang to find unused functions. Remove the
156 * __inline_maybe_unused entirely after fixing most of -Wunused-function warnings.
157 */
158#ifdef KBUILD_EXTRA_WARN1
159#define __inline_maybe_unused
160#else
161#define __inline_maybe_unused __maybe_unused
162#endif
163
156/*164/*
157 * Rather then using noinline to prevent stack consumption, use165 * Rather then using noinline to prevent stack consumption, use
158 * noinline_for_stack instead. For documentation reasons.166 * noinline_for_stack instead. For documentation reasons.
include/linux/export.h+16−26
@@ -18,9 +18,6 @@ extern struct module __this_module; · 17 unmodified lines
18#define THIS_MODULE ((struct module *)0)18#define THIS_MODULE ((struct module *)0)
19#endif19#endif
20 20
21#ifdef CONFIG_MODULES
22
23#if defined(__KERNEL__) && !defined(__GENKSYMS__)
24#ifdef CONFIG_MODVERSIONS21#ifdef CONFIG_MODVERSIONS
25/* Mark the CRC weak since genksyms apparently decides not to22/* Mark the CRC weak since genksyms apparently decides not to
26 * generate a checksums for some symbols */23 * generate a checksums for some symbols */
@@ -74,6 +71,12 @@ struct kernel_symbol { · 47 unmodified lines
74};71};
75#endif72#endif
76 73
74#ifdef __GENKSYMS__
75
76#define ___EXPORT_SYMBOL(sym, sec) __GENKSYMS_EXPORT_SYMBOL(sym)
77
78#else
79
77/* For every exported symbol, place a struct in the __ksymtab section */80/* For every exported symbol, place a struct in the __ksymtab section */
78#define ___EXPORT_SYMBOL(sym, sec) \81#define ___EXPORT_SYMBOL(sym, sec) \
79 extern typeof(sym) sym; \82 extern typeof(sym) sym; \
@@ -83,7 +86,9 @@ struct kernel_symbol { · 3 unmodified lines
83 = #sym; \86 = #sym; \
84 __KSYMTAB_ENTRY(sym, sec)87 __KSYMTAB_ENTRY(sym, sec)
85 88
86#if defined(__DISABLE_EXPORTS)89#endif
90
91#if !defined(CONFIG_MODULES) || defined(__DISABLE_EXPORTS)
87 92
88/*93/*
89 * Allow symbol exports to be disabled completely so that C code may94 * Allow symbol exports to be disabled completely so that C code may
@@ -117,37 +122,22 @@ struct kernel_symbol { · 27 unmodified lines
117#define __cond_export_sym_0(sym, sec) /* nothing */122#define __cond_export_sym_0(sym, sec) /* nothing */
118 123
119#else124#else
120#define __EXPORT_SYMBOL ___EXPORT_SYMBOL
121#endif
122 125
123#define EXPORT_SYMBOL(sym) \126#define __EXPORT_SYMBOL(sym, sec) ___EXPORT_SYMBOL(sym, sec)
124 __EXPORT_SYMBOL(sym, "")
125 127
126#define EXPORT_SYMBOL_GPL(sym) \128#endif /* CONFIG_MODULES */
127 __EXPORT_SYMBOL(sym, "_gpl")
128
129#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
130 __EXPORT_SYMBOL(sym, "_gpl_future")
131 129
130#define EXPORT_SYMBOL(sym) __EXPORT_SYMBOL(sym, "")
131#define EXPORT_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_gpl")
132#define EXPORT_SYMBOL_GPL_FUTURE(sym) __EXPORT_SYMBOL(sym, "_gpl_future")
132#ifdef CONFIG_UNUSED_SYMBOLS133#ifdef CONFIG_UNUSED_SYMBOLS
133#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")134#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
134#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")135#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
135#else136#else
136#define EXPORT_UNUSED_SYMBOL(sym)137#define EXPORT_UNUSED_SYMBOL(sym)
137#define EXPORT_UNUSED_SYMBOL_GPL(sym)138#define EXPORT_UNUSED_SYMBOL_GPL(sym)
138#endif139#endif
139 140
140#endif /* __GENKSYMS__ */
141
142#else /* !CONFIG_MODULES... */
143
144#define EXPORT_SYMBOL(sym)
145#define EXPORT_SYMBOL_GPL(sym)
146#define EXPORT_SYMBOL_GPL_FUTURE(sym)
147#define EXPORT_UNUSED_SYMBOL(sym)
148#define EXPORT_UNUSED_SYMBOL_GPL(sym)
149
150#endif /* CONFIG_MODULES */
151#endif /* !__ASSEMBLY__ */141#endif /* !__ASSEMBLY__ */
152 142
153#endif /* _LINUX_EXPORT_H */143#endif /* _LINUX_EXPORT_H */
include/linux/vermagic.h+2−0
@@ -9,6 +9,8 @@ · 8 unmodified lines
9#endif9#endif
10#ifdef CONFIG_PREEMPT10#ifdef CONFIG_PREEMPT
11#define MODULE_VERMAGIC_PREEMPT "preempt "11#define MODULE_VERMAGIC_PREEMPT "preempt "
12#elif defined(CONFIG_PREEMPT_RT)
13#define MODULE_VERMAGIC_PREEMPT "preempt_rt "
12#else14#else
13#define MODULE_VERMAGIC_PREEMPT ""15#define MODULE_VERMAGIC_PREEMPT ""
14#endif16#endif
init/Kconfig+20−6
@@ -1234,20 +1234,26 @@ choice · 1233 unmodified lines
1234 default CC_OPTIMIZE_FOR_PERFORMANCE1234 default CC_OPTIMIZE_FOR_PERFORMANCE
1235 1235
1236config CC_OPTIMIZE_FOR_PERFORMANCE1236config CC_OPTIMIZE_FOR_PERFORMANCE
1237 bool "Optimize for performance"1237 bool "Optimize for performance (-O2)"
1238 help1238 help
1239 This is the default optimization level for the kernel, building1239 This is the default optimization level for the kernel, building
1240 with the "-O2" compiler flag for best performance and most1240 with the "-O2" compiler flag for best performance and most
1241 helpful compile-time warnings.1241 helpful compile-time warnings.
1242 1242
1243config CC_OPTIMIZE_FOR_SIZE1243config CC_OPTIMIZE_FOR_PERFORMANCE_O3
1244 bool "Optimize for size"1244 bool "Optimize more for performance (-O3)"
1245 depends on ARC
1245 imply CC_DISABLE_WARN_MAYBE_UNINITIALIZED # avoid false positives1246 imply CC_DISABLE_WARN_MAYBE_UNINITIALIZED # avoid false positives
1246 help1247 help
1247 Enabling this option will pass "-Os" instead of "-O2" to1248 Choosing this option will pass "-O3" to your compiler to optimize
1248 your compiler resulting in a smaller kernel.1249 the kernel yet more for performance.
1249 1250
1250 If unsure, say N.1251config CC_OPTIMIZE_FOR_SIZE
1252 bool "Optimize for size (-Os)"
1253 imply CC_DISABLE_WARN_MAYBE_UNINITIALIZED # avoid false positives
1254 help
1255 Choosing this option will pass "-Os" to your compiler resulting
1256 in a smaller kernel.
1251 1257
1252endchoice1258endchoice
1253 1259
@@ -2014,6 +2020,14 @@ config MODVERSIONS · 760 unmodified lines
2014 make them incompatible with the kernel you are running. If2020 make them incompatible with the kernel you are running. If
2015 unsure, say N.2021 unsure, say N.
2016 2022
2023config ASM_MODVERSIONS
2024 bool
2025 default HAVE_ASM_MODVERSIONS && MODVERSIONS
2026 help
2027 This enables module versioning for exported symbols also from
2028 assembly. This can be enabled only when the target architecture
2029 supports it.
2030
2017config MODULE_REL_CRCS2031config MODULE_REL_CRCS
2018 bool2032 bool
2019 depends on MODVERSIONS2033 depends on MODVERSIONS
init/Makefile+3−2
@@ -33,5 +33,6 @@ $(obj)/version.o: include/generated/compile.h · 32 unmodified lines
33silent_chk_compile.h = :33silent_chk_compile.h = :
34include/generated/compile.h: FORCE34include/generated/compile.h: FORCE
35 @$($(quiet)chk_compile.h)35 @$($(quiet)chk_compile.h)
36 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \36 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
37 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"37 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \
38 "$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)"
kernel/Makefile+1−1
@@ -127,7 +127,7 @@ $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE · 126 unmodified lines
127$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz127$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz
128 128
129quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz129quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz
130cmd_genikh = $(CONFIG_SHELL) $(srctree)/kernel/gen_kheaders.sh $@130 cmd_genikh = $(BASH) $(srctree)/kernel/gen_kheaders.sh $@
131$(obj)/kheaders_data.tar.xz: FORCE131$(obj)/kheaders_data.tar.xz: FORCE
132 $(call cmd,genikh)132 $(call cmd,genikh)
133 133
scripts/Kconfig.include+3−0
@@ -35,5 +35,8 @@ ld-option = $(success,$(LD) -v $(1)) · 34 unmodified lines
35$(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)35$(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)
36$(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)36$(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)
37 37
38# Fail if the linker is gold as it's not capable of linking the kernel proper
39$(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supported)
40
38# gcc version including patch level41# gcc version including patch level
39gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))42gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))
scripts/Makefile+1−1
@@ -36,4 +36,4 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms · 35 unmodified lines
36subdir-$(CONFIG_SECURITY_SELINUX) += selinux36subdir-$(CONFIG_SECURITY_SELINUX) += selinux
37 37
38# Let clean descend into subdirs38# Let clean descend into subdirs
39subdir- += basic dtc gdb kconfig mod package39subdir- += basic dtc gdb kconfig mod
scripts/Makefile.build+43−30
@@ -52,7 +52,7 @@ ifndef obj · 51 unmodified lines
52$(warning kbuild: Makefile.build is included improperly)52$(warning kbuild: Makefile.build is included improperly)
53endif53endif
54 54
55ifeq ($(MAKECMDGOALS)$(need-modorder),)55ifeq ($(need-modorder),)
56ifneq ($(obj-m),)56ifneq ($(obj-m),)
57$(warning $(patsubst %.o,'%.ko',$(obj-m)) will not be built even though obj-m is specified.)57$(warning $(patsubst %.o,'%.ko',$(obj-m)) will not be built even though obj-m is specified.)
58$(warning You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.)58$(warning You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.)
@@ -76,11 +76,6 @@ endif · 17 unmodified lines
76 76
77mod-targets := $(patsubst %.o, %.mod, $(obj-m))77mod-targets := $(patsubst %.o, %.mod, $(obj-m))
78 78
79__build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
80 $(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \
81 $(subdir-ym) $(always)
82 @:
83
84# Linus' kernel sanity checking tool79# Linus' kernel sanity checking tool
85ifeq ($(KBUILD_CHECKSRC),1)80ifeq ($(KBUILD_CHECKSRC),1)
86 quiet_cmd_checksrc = CHECK $<81 quiet_cmd_checksrc = CHECK $<
@@ -90,23 +85,13 @@ else ifeq ($(KBUILD_CHECKSRC),2) · 3 unmodified lines
90 cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<85 cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
91endif86endif
92 87
93ifneq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),)88ifneq ($(KBUILD_EXTRA_WARN),)
94 cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $<89 cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $<
95endif90endif
96 91
97# Compile C sources (.c)92# Compile C sources (.c)
98# ---------------------------------------------------------------------------93# ---------------------------------------------------------------------------
99 94
100# Default is built-in, unless we know otherwise
101$(foreach x, i ll lst o s symtypes, $(patsubst %.o,%.$(x),$(real-obj-m))): \
102 part-of-module := y
103
104modkern_cflags = \
105 $(if $(part-of-module), \
106 $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
107 $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
108quiet_modtag = $(if $(part-of-module),[M], )
109
110quiet_cmd_cc_s_c = CC $(quiet_modtag) $@95quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
111 cmd_cc_s_c = $(CC) $(filter-out $(DEBUG_CFLAGS), $(c_flags)) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<96 cmd_cc_s_c = $(CC) $(filter-out $(DEBUG_CFLAGS), $(c_flags)) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
112 97
@@ -310,11 +295,6 @@ $(obj)/%.h.s: $(src)/%.h FORCE · 197 unmodified lines
310# Compile assembler sources (.S)295# Compile assembler sources (.S)
311# ---------------------------------------------------------------------------296# ---------------------------------------------------------------------------
312 297
313modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)
314
315$(real-obj-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
316$(real-obj-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
317
318# .S file exports must have their C prototypes defined in asm/asm-prototypes.h298# .S file exports must have their C prototypes defined in asm/asm-prototypes.h
319# or a file that it includes, in order to get versioned symbols. We build a299# or a file that it includes, in order to get versioned symbols. We build a
320# dummy C file that includes asm-prototypes and the EXPORT_SYMBOL lines from300# dummy C file that includes asm-prototypes and the EXPORT_SYMBOL lines from
@@ -356,11 +336,7 @@ $(obj)/%.s: $(src)/%.S FORCE · 35 unmodified lines
356quiet_cmd_as_o_S = AS $(quiet_modtag) $@336quiet_cmd_as_o_S = AS $(quiet_modtag) $@
357 cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<337 cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
358 338
359ifdef CONFIG_MODVERSIONS339ifdef CONFIG_ASM_MODVERSIONS
360
361ASM_PROTOTYPES := $(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/asm-prototypes.h)
362
363ifneq ($(ASM_PROTOTYPES),)
364 340
365# versioning matches the C process described above, with difference that341# versioning matches the C process described above, with difference that
366# we parse asm-prototypes.h C header to get function definitions.342# we parse asm-prototypes.h C header to get function definitions.
@@ -376,7 +352,6 @@ cmd_modversions_S = \ · 9 unmodified lines
376 rm -f $(@D)/.tmp_$(@F:.o=.ver); \352 rm -f $(@D)/.tmp_$(@F:.o=.ver); \
377 fi353 fi
378endif354endif
379endif
380 355
381$(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE356$(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE
382 $(call if_changed_rule,as_o_S)357 $(call if_changed_rule,as_o_S)
@@ -395,9 +370,9 @@ $(obj)/%.lds: $(src)/%.lds.S FORCE · 12 unmodified lines
395 370
396# ASN.1 grammar371# ASN.1 grammar
397# ---------------------------------------------------------------------------372# ---------------------------------------------------------------------------
398quiet_cmd_asn1_compiler = ASN.1 $@373quiet_cmd_asn1_compiler = ASN.1 $(basename $@).[ch]
399 cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \374 cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \
400 $(subst .h,.c,$@) $(subst .c,.h,$@)375 $(basename $@).c $(basename $@).h
401 376
402$(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler377$(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler
403 $(call cmd,asn1_compiler)378 $(call cmd,asn1_compiler)
@@ -489,12 +464,50 @@ targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \ · 85 unmodified lines
489 $(call intermediate_targets, .lex.o, .lex.c) \464 $(call intermediate_targets, .lex.o, .lex.c) \
490 $(call intermediate_targets, .tab.o, .tab.c .tab.h)465 $(call intermediate_targets, .tab.o, .tab.c .tab.h)
491 466
467# Build
468# ---------------------------------------------------------------------------
469
470ifdef single-build
471
472curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \
473 $(if $(filter $(x) $(basename $(x)).o, $(targets)), $(x))))
474
475# Handle single targets without any rule: show "Nothing to be done for ..." or
476# "No rule to make target ..." depending on whether the target exists.
477unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \
478 $(filter $(obj)/%, \
479 $(filter-out $(curdir-single), \
480 $(KBUILD_SINGLE_TARGETS))))
481
482__build: $(curdir-single) $(subdir-ym)
483ifneq ($(unknown-single),)
484 $(Q)$(MAKE) -f /dev/null $(unknown-single)
485endif
486 @:
487
488ifeq ($(curdir-single),)
489# Nothing to do in this directory. Do not include any .*.cmd file for speed-up
490targets :=
491else
492targets += $(curdir-single)
493endif
494
495else
496
497__build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
498 $(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \
499 $(subdir-ym) $(always)
500 @:
501
502endif
503
492# Descending504# Descending
493# ---------------------------------------------------------------------------505# ---------------------------------------------------------------------------
494 506
495PHONY += $(subdir-ym)507PHONY += $(subdir-ym)
496$(subdir-ym):508$(subdir-ym):
497 $(Q)$(MAKE) $(build)=$@ \509 $(Q)$(MAKE) $(build)=$@ \
510 $(if $(filter $@/, $(KBUILD_SINGLE_TARGETS)),single-build=) \
498 need-builtin=$(if $(filter $@/built-in.a, $(subdir-obj-y)),1) \511 need-builtin=$(if $(filter $@/built-in.a, $(subdir-obj-y)),1) \
499 need-modorder=$(if $(need-modorder),$(if $(filter $@/modules.order, $(modorder)),1))512 need-modorder=$(if $(need-modorder),$(if $(filter $@/modules.order, $(modorder)),1))
500 513
scripts/Makefile.clean+5−26
@@ -17,17 +17,8 @@ include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-di · 16 unmodified lines
17# Figure out what we need to build from the various variables17# Figure out what we need to build from the various variables
18# ==========================================================================18# ==========================================================================
19 19
20__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))20subdir-ymn := $(sort $(subdir-y) $(subdir-m) $(subdir-) \
21subdir-y += $(__subdir-y)21 $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-m) $(obj-))))
22__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
23subdir-m += $(__subdir-m)
24__subdir- := $(patsubst %/,%,$(filter %/, $(obj-)))
25subdir- += $(__subdir-)
26
27# Subdirectories we need to descend into
28
29subdir-ym := $(sort $(subdir-y) $(subdir-m))
30subdir-ymn := $(sort $(subdir-ym) $(subdir-))
31 22
32# Add subdir path23# Add subdir path
33 24
@@ -52,26 +43,14 @@ __clean-files := $(wildcard \ · 18 unmodified lines
52 $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \43 $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \
53 $(filter $(objtree)/%, $(__clean-files)))44 $(filter $(objtree)/%, $(__clean-files)))
54 45
55# same as clean-files
56
57__clean-dirs := $(wildcard \
58 $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(clean-dirs))) \
59 $(filter $(objtree)/%, $(clean-dirs)))
60
61# ==========================================================================46# ==========================================================================
62 47
63quiet_cmd_clean = CLEAN $(obj)48quiet_cmd_clean = CLEAN $(obj)
64 cmd_clean = rm -f $(__clean-files)49 cmd_clean = rm -rf $(__clean-files)
65quiet_cmd_cleandir = CLEAN $(__clean-dirs)
66 cmd_cleandir = rm -rf $(__clean-dirs)
67
68 50
69__clean: $(subdir-ymn)51__clean: $(subdir-ymn)
70ifneq ($(strip $(__clean-files)),)52ifneq ($(strip $(__clean-files)),)
71 +$(call cmd,clean)53 $(call cmd,clean)
72endif
73ifneq ($(strip $(__clean-dirs)),)
74 +$(call cmd,cleandir)
75endif54endif
76 @:55 @:
77 56
scripts/Makefile.extrawarn+69−52
@@ -1,74 +1,91 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2# ==========================================================================2# ==========================================================================
3#
4# make W=... settings3# make W=... settings
5#4#
6# W=1 - warnings that may be relevant and does not occur too often5# There are three warning groups enabled by W=1, W=2, W=3.
7# W=2 - warnings that occur quite often but may still be relevant6# They are independent, and can be combined like W=12 or W=123.
8# W=3 - the more obscure warnings, can most likely be ignored
9#
10# $(call cc-option, -W...) handles gcc -W.. options which
11# are not supported by all versions of the compiler
12# ==========================================================================7# ==========================================================================
13 8
14KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)9KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
15 10
11# backward compatibility
12KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)
13
16ifeq ("$(origin W)", "command line")14ifeq ("$(origin W)", "command line")
17 export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)15 KBUILD_EXTRA_WARN := $(W)
18endif16endif
19 17
20ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS18export KBUILD_EXTRA_WARN
21warning- := $(empty)19
22 20#
23warning-1 := -Wextra -Wunused -Wno-unused-parameter21# W=1 - warnings which may be relevant and do not occur too often
24warning-1 += -Wmissing-declarations22#
25warning-1 += -Wmissing-format-attribute23ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
26warning-1 += -Wmissing-prototypes24
27warning-1 += -Wold-style-definition25KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter
28warning-1 += -Wmissing-include-dirs26KBUILD_CFLAGS += -Wmissing-declarations
29warning-1 += $(call cc-option, -Wunused-but-set-variable)27KBUILD_CFLAGS += -Wmissing-format-attribute
30warning-1 += $(call cc-option, -Wunused-const-variable)28KBUILD_CFLAGS += -Wmissing-prototypes
31warning-1 += $(call cc-option, -Wpacked-not-aligned)29KBUILD_CFLAGS += -Wold-style-definition
32warning-1 += $(call cc-option, -Wstringop-truncation)30KBUILD_CFLAGS += -Wmissing-include-dirs
31KBUILD_CFLAGS += $(call cc-option, -Wunused-but-set-variable)
32KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable)
33KBUILD_CFLAGS += $(call cc-option, -Wpacked-not-aligned)
34KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
33# The following turn off the warnings enabled by -Wextra35# The following turn off the warnings enabled by -Wextra
34warning-1 += -Wno-missing-field-initializers36KBUILD_CFLAGS += -Wno-missing-field-initializers
35warning-1 += -Wno-sign-compare37KBUILD_CFLAGS += -Wno-sign-compare
36 38
37warning-2 += -Wcast-align39KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1
38warning-2 += -Wdisabled-optimization
39warning-2 += -Wnested-externs
40warning-2 += -Wshadow
41warning-2 += $(call cc-option, -Wlogical-op)
42warning-2 += -Wmissing-field-initializers
43warning-2 += -Wsign-compare
44warning-2 += $(call cc-option, -Wmaybe-uninitialized)
45warning-2 += $(call cc-option, -Wunused-macros)
46
47warning-3 := -Wbad-function-cast
48warning-3 += -Wcast-qual
49warning-3 += -Wconversion
50warning-3 += -Wpacked
51warning-3 += -Wpadded
52warning-3 += -Wpointer-arith
53warning-3 += -Wredundant-decls
54warning-3 += -Wswitch-default
55warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
56
57warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
58warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
59warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
60
61ifeq ("$(strip $(warning))","")
62 $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
63endif
64 40
65KBUILD_CFLAGS += $(warning)
66else41else
67 42
43# Some diagnostics enabled by default are noisy.
44# Suppress them by using -Wno... except for W=1.
45
68ifdef CONFIG_CC_IS_CLANG46ifdef CONFIG_CC_IS_CLANG
69KBUILD_CFLAGS += -Wno-initializer-overrides47KBUILD_CFLAGS += -Wno-initializer-overrides
70KBUILD_CFLAGS += -Wno-format48KBUILD_CFLAGS += -Wno-format
71KBUILD_CFLAGS += -Wno-sign-compare49KBUILD_CFLAGS += -Wno-sign-compare
72KBUILD_CFLAGS += -Wno-format-zero-length50KBUILD_CFLAGS += -Wno-format-zero-length
73endif51endif
52
53endif
54
55#
56# W=2 - warnings which occur quite often but may still be relevant
57#
58ifneq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
59
60KBUILD_CFLAGS += -Wcast-align
61KBUILD_CFLAGS += -Wdisabled-optimization
62KBUILD_CFLAGS += -Wnested-externs
63KBUILD_CFLAGS += -Wshadow
64KBUILD_CFLAGS += $(call cc-option, -Wlogical-op)
65KBUILD_CFLAGS += -Wmissing-field-initializers
66KBUILD_CFLAGS += -Wsign-compare
67KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
68KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
69
70KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN2
71
72endif
73
74#
75# W=3 - more obscure warnings, can most likely be ignored
76#
77ifneq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
78
79KBUILD_CFLAGS += -Wbad-function-cast
80KBUILD_CFLAGS += -Wcast-qual
81KBUILD_CFLAGS += -Wconversion
82KBUILD_CFLAGS += -Wpacked
83KBUILD_CFLAGS += -Wpadded
84KBUILD_CFLAGS += -Wpointer-arith
85KBUILD_CFLAGS += -Wredundant-decls
86KBUILD_CFLAGS += -Wswitch-default
87KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)
88
89KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3
90
74endif91endif
scripts/Makefile.host+28−11
@@ -1,4 +1,21 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2
3# LEX
4# ---------------------------------------------------------------------------
5quiet_cmd_flex = LEX $@
6 cmd_flex = $(LEX) -o$@ -L $<
7
8$(obj)/%.lex.c: $(src)/%.l FORCE
9 $(call if_changed,flex)
10
11# YACC
12# ---------------------------------------------------------------------------
13quiet_cmd_bison = YACC $(basename $@).[ch]
14 cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $<
15
16$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE
17 $(call if_changed,bison)
18
2# ==========================================================================19# ==========================================================================
3# Building binaries on the host system20# Building binaries on the host system
4# Binaries are used during the compilation of the kernel, for example21# Binaries are used during the compilation of the kernel, for example
@@ -63,9 +80,9 @@ host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs)) · 58 unmodified lines
63# Handle options to gcc. Support building with separate output directory80# Handle options to gcc. Support building with separate output directory
64 81
65_hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \82_hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
66 $(HOSTCFLAGS_$(basetarget).o)83 $(HOSTCFLAGS_$(target-stem).o)
67_hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \84_hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
68 $(HOSTCXXFLAGS_$(basetarget).o)85 $(HOSTCXXFLAGS_$(target-stem).o)
69 86
70# $(objtree)/$(obj) for including generated headers from checkin source files87# $(objtree)/$(obj) for including generated headers from checkin source files
71ifeq ($(KBUILD_EXTMOD),)88ifeq ($(KBUILD_EXTMOD),)
@@ -85,7 +102,7 @@ hostcxx_flags = -Wp,-MD,$(depfile) $(_hostcxx_flags) · 13 unmodified lines
85# host-csingle -> Executable102# host-csingle -> Executable
86quiet_cmd_host-csingle = HOSTCC $@103quiet_cmd_host-csingle = HOSTCC $@
87 cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(KBUILD_HOSTLDFLAGS) -o $@ $< \104 cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(KBUILD_HOSTLDFLAGS) -o $@ $< \
88 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))105 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem))
89$(host-csingle): $(obj)/%: $(src)/%.c FORCE106$(host-csingle): $(obj)/%: $(src)/%.c FORCE
90 $(call if_changed_dep,host-csingle)107 $(call if_changed_dep,host-csingle)
91 108
@@ -93,8 +110,8 @@ $(host-csingle): $(obj)/%: $(src)/%.c FORCE · 1 unmodified line
93# host-cmulti -> executable110# host-cmulti -> executable
94quiet_cmd_host-cmulti = HOSTLD $@111quiet_cmd_host-cmulti = HOSTLD $@
95 cmd_host-cmulti = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ \112 cmd_host-cmulti = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ \
96 $(addprefix $(obj)/,$($(@F)-objs)) \113 $(addprefix $(obj)/, $($(target-stem)-objs)) \
97 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))114 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem))
98$(host-cmulti): FORCE115$(host-cmulti): FORCE
99 $(call if_changed,host-cmulti)116 $(call if_changed,host-cmulti)
100$(call multi_depend, $(host-cmulti), , -objs)117$(call multi_depend, $(host-cmulti), , -objs)
@@ -111,8 +128,8 @@ $(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE · 10 unmodified lines
111quiet_cmd_host-cxxmulti = HOSTLD $@128quiet_cmd_host-cxxmulti = HOSTLD $@
112 cmd_host-cxxmulti = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -o $@ \129 cmd_host-cxxmulti = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -o $@ \
113 $(foreach o,objs cxxobjs,\130 $(foreach o,objs cxxobjs,\
114 $(addprefix $(obj)/,$($(@F)-$(o)))) \131 $(addprefix $(obj)/, $($(target-stem)-$(o)))) \
115 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))132 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem))
116$(host-cxxmulti): FORCE133$(host-cxxmulti): FORCE
117 $(call if_changed,host-cxxmulti)134 $(call if_changed,host-cxxmulti)
118$(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs)135$(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs)
@@ -144,8 +161,8 @@ $(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE · 25 unmodified lines
144# *.o -> .so shared library (host-cshlib)161# *.o -> .so shared library (host-cshlib)
145quiet_cmd_host-cshlib = HOSTLLD -shared $@162quiet_cmd_host-cshlib = HOSTLLD -shared $@
146 cmd_host-cshlib = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \163 cmd_host-cshlib = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \
147 $(addprefix $(obj)/,$($(@F:.so=-objs))) \164 $(addprefix $(obj)/, $($(target-stem)-objs)) \
148 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))165 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem).so)
149$(host-cshlib): FORCE166$(host-cshlib): FORCE
150 $(call if_changed,host-cshlib)167 $(call if_changed,host-cshlib)
151$(call multi_depend, $(host-cshlib), .so, -objs)168$(call multi_depend, $(host-cshlib), .so, -objs)
@@ -154,8 +171,8 @@ $(call multi_depend, $(host-cshlib), .so, -objs) · 2 unmodified lines
154# *.o -> .so shared library (host-cxxshlib)171# *.o -> .so shared library (host-cxxshlib)
155quiet_cmd_host-cxxshlib = HOSTLLD -shared $@172quiet_cmd_host-cxxshlib = HOSTLLD -shared $@
156 cmd_host-cxxshlib = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \173 cmd_host-cxxshlib = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \
157 $(addprefix $(obj)/,$($(@F:.so=-objs))) \174 $(addprefix $(obj)/, $($(target-stem)-objs)) \
158 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))175 $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem).so)
159$(host-cxxshlib): FORCE176$(host-cxxshlib): FORCE
160 $(call if_changed,host-cxxshlib)177 $(call if_changed,host-cxxshlib)
161$(call multi_depend, $(host-cxxshlib), .so, -objs)178$(call multi_depend, $(host-cxxshlib), .so, -objs)
scripts/Makefile.lib+28−35
@@ -41,9 +41,9 @@ obj-m := $(filter-out %/, $(obj-m)) · 40 unmodified lines
41# Subdirectories we need to descend into41# Subdirectories we need to descend into
42subdir-ym := $(sort $(subdir-y) $(subdir-m))42subdir-ym := $(sort $(subdir-y) $(subdir-m))
43 43
44# if $(foo-objs), $(foo-y), or $(foo-m) exists, foo.o is a composite object44# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
45multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))45multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m))))
46multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))46multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m))))
47multi-used := $(multi-used-y) $(multi-used-m)47multi-used := $(multi-used-y) $(multi-used-m)
48 48
49# $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to49# $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to
@@ -52,8 +52,8 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y)) · 2 unmodified lines
52 52
53# Replace multi-part objects by their individual parts,53# Replace multi-part objects by their individual parts,
54# including built-in.a from subdirectories54# including built-in.a from subdirectories
55real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))55real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
56real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))56real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
57 57
58# DTB58# DTB
59# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built59# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
@@ -101,6 +101,9 @@ modname-multi = $(subst $(space),:,$(sort $(foreach m,$(multi-used),\ · 41 unmodified lines
101 101
102modname = $(if $(modname-multi),$(modname-multi),$(basetarget))102modname = $(if $(modname-multi),$(modname-multi),$(basetarget))
103 103
104# target with $(obj)/ and its suffix stripped
105target-stem = $(basename $(patsubst $(obj)/%,%,$@))
106
104# These flags are needed for modversions and compiling, so we define them here107# These flags are needed for modversions and compiling, so we define them here
105# $(modname_flags) defines KBUILD_MODNAME as the name of the module it will108# $(modname_flags) defines KBUILD_MODNAME as the name of the module it will
106# end up in (or would, if it gets compiled in)109# end up in (or would, if it gets compiled in)
@@ -109,12 +112,12 @@ basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget)) · 2 unmodified lines
109modname_flags = -DKBUILD_MODNAME=$(call name-fix,$(modname))112modname_flags = -DKBUILD_MODNAME=$(call name-fix,$(modname))
110 113
111orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \114orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
112 $(ccflags-y) $(CFLAGS_$(basetarget).o)115 $(ccflags-y) $(CFLAGS_$(target-stem).o)
113_c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))116_c_flags = $(filter-out $(CFLAGS_REMOVE_$(target-stem).o), $(orig_c_flags))
114orig_a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) \117orig_a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) \
115 $(asflags-y) $(AFLAGS_$(basetarget).o)118 $(asflags-y) $(AFLAGS_$(target-stem).o)
116_a_flags = $(filter-out $(AFLAGS_REMOVE_$(basetarget).o), $(orig_a_flags))119_a_flags = $(filter-out $(AFLAGS_REMOVE_$(target-stem).o), $(orig_a_flags))
117_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))120_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(target-stem).lds)
118 121
119#122#
120# Enable gcov profiling flags for a file, directory or for all files depending123# Enable gcov profiling flags for a file, directory or for all files depending
@@ -159,6 +162,18 @@ _cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) · 38 unmodified lines
159endif162endif
160endif163endif
161 164
165part-of-module = $(if $(filter $(basename $@).o, $(real-obj-m)),y)
166quiet_modtag = $(if $(part-of-module),[M], )
167
168modkern_cflags = \
169 $(if $(part-of-module), \
170 $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
171 $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
172
173modkern_aflags = $(if $(part-of-module), \
174 $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \
175 $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL))
176
162c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \177c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
163 -include $(srctree)/include/linux/compiler_types.h \178 -include $(srctree)/include/linux/compiler_types.h \
164 $(_c_flags) $(modkern_cflags) \179 $(_c_flags) $(modkern_cflags) \
@@ -187,28 +202,6 @@ $(foreach m, $(notdir $1), \ · 22 unmodified lines
187 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))202 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
188endef203endef
189 204
190# LEX
191# ---------------------------------------------------------------------------
192quiet_cmd_flex = LEX $@
193 cmd_flex = $(LEX) -o$@ -L $<
194
195$(obj)/%.lex.c: $(src)/%.l FORCE
196 $(call if_changed,flex)
197
198# YACC
199# ---------------------------------------------------------------------------
200quiet_cmd_bison = YACC $@
201 cmd_bison = $(YACC) -o$@ -t -l $<
202
203$(obj)/%.tab.c: $(src)/%.y FORCE
204 $(call if_changed,bison)
205
206quiet_cmd_bison_h = YACC $@
207 cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $<
208
209$(obj)/%.tab.h: $(src)/%.y FORCE
210 $(call if_changed,bison_h)
211
212# Shipped files205# Shipped files
213# ===========================================================================206# ===========================================================================
214 207
@@ -258,7 +251,7 @@ quiet_cmd_gzip = GZIP $@ · 43 unmodified lines
258DTC ?= $(objtree)/scripts/dtc/dtc251DTC ?= $(objtree)/scripts/dtc/dtc
259 252
260# Disable noisy checks by default253# Disable noisy checks by default
261ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)254ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
262DTC_FLAGS += -Wno-unit_address_vs_reg \255DTC_FLAGS += -Wno-unit_address_vs_reg \
263 -Wno-unit_address_format \256 -Wno-unit_address_format \
264 -Wno-avoid_unnecessary_addr_size \257 -Wno-avoid_unnecessary_addr_size \
@@ -269,7 +262,7 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ · 4 unmodified lines
269 -Wno-pci_device_reg262 -Wno-pci_device_reg
270endif263endif
271 264
272ifneq ($(findstring 2,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)265ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
273DTC_FLAGS += -Wnode_name_chars_strict \266DTC_FLAGS += -Wnode_name_chars_strict \
274 -Wproperty_name_chars_strict267 -Wproperty_name_chars_strict
275endif268endif
@@ -374,7 +367,7 @@ UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) · 98 unmodified lines
374UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'367UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'
375 368
376quiet_cmd_uimage = UIMAGE $@369quiet_cmd_uimage = UIMAGE $@
377 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \370 cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \
378 -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \371 -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \
379 -T $(UIMAGE_TYPE) \372 -T $(UIMAGE_TYPE) \
380 -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \373 -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \
scripts/Makefile.modfinal+60−0
@@ -0,0 +1,60 @@
1# SPDX-License-Identifier: GPL-2.0-only
2# ===========================================================================
3# Module final link
4# ===========================================================================
5
6PHONY := __modfinal
7__modfinal:
8
9include $(srctree)/scripts/Kbuild.include
10
11# for c_flags
12include $(srctree)/scripts/Makefile.lib
13
14# find all modules listed in modules.order
15modules := $(sort $(shell cat $(MODORDER)))
16
17__modfinal: $(modules)
18 @:
19
20# modname and part-of-module are set to make c_flags define proper module flags
21modname = $(notdir $(@:.mod.o=))
22part-of-module = y
23
24quiet_cmd_cc_o_c = CC [M] $@
25 cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
26
27%.mod.o: %.mod.c FORCE
28 $(call if_changed_dep,cc_o_c)
29
30ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
31
32quiet_cmd_ld_ko_o = LD [M] $@
33 cmd_ld_ko_o = \
34 $(LD) -r $(KBUILD_LDFLAGS) \
35 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
36 $(addprefix -T , $(KBUILD_LDS_MODULE)) \
37 -o $@ $(filter %.o, $^); \
38 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
39
40$(modules): %.ko: %.o %.mod.o $(KBUILD_LDS_MODULE) FORCE
41 +$(call if_changed,ld_ko_o)
42
43targets += $(modules) $(modules:.ko=.mod.o)
44
45# Add FORCE to the prequisites of a target to force it to be always rebuilt.
46# ---------------------------------------------------------------------------
47
48PHONY += FORCE
49FORCE:
50
51# Read all saved command lines and dependencies for the $(targets) we
52# may be building above, using $(if_changed{,_dep}). As an
53# optimization, we don't need to read them if the target does not
54# exist, we will rebuild anyway in that case.
55
56existing-targets := $(wildcard $(sort $(targets)))
57
58-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
59
60.PHONY: $(PHONY)
scripts/Makefile.modpost+12−68
@@ -15,15 +15,13 @@ · 14 unmodified lines
15# 2) modpost is then used to15# 2) modpost is then used to
16# 3) create one <module>.mod.c file pr. module16# 3) create one <module>.mod.c file pr. module
17# 4) create one Module.symvers file with CRC for all exported symbols17# 4) create one Module.symvers file with CRC for all exported symbols
18# 5) compile all <module>.mod.c files
19# 6) final link of the module to a <module.ko> file
20 18
21# Step 3 is used to place certain information in the module's ELF19# Step 3 is used to place certain information in the module's ELF
22# section, including information such as:20# section, including information such as:
23# Version magic (see include/linux/vermagic.h for full details)21# Version magic (see include/linux/vermagic.h for full details)
24# - Kernel release22# - Kernel release
25# - SMP is CONFIG_SMP23# - SMP is CONFIG_SMP
26# - PREEMPT is CONFIG_PREEMPT24# - PREEMPT is CONFIG_PREEMPT[_RT]
27# - GCC Version25# - GCC Version
28# Module info26# Module info
29# - Module version (MODULE_VERSION)27# - Module version (MODULE_VERSION)
@@ -60,13 +58,10 @@ MODPOST = scripts/mod/modpost \ · 30 unmodified lines
60 58
61ifdef MODPOST_VMLINUX59ifdef MODPOST_VMLINUX
62 60
63__modpost: vmlinux.o61quiet_cmd_modpost = MODPOST vmlinux.o
62 cmd_modpost = $(MODPOST) vmlinux.o
64 63
65quiet_cmd_modpost = MODPOST $@64__modpost:
66 cmd_modpost = $(MODPOST) $@
67
68PHONY += vmlinux.o
69vmlinux.o:
70 $(call cmd,modpost)65 $(call cmd,modpost)
71 66
72else67else
@@ -83,73 +78,22 @@ include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \ · 10 unmodified lines
83 $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)78 $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)
84endif79endif
85 80
86include scripts/Makefile.lib81MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - $(wildcard vmlinux)
87 82
88# find all modules listed in modules.order83# find all modules listed in modules.order
89modules := $(sort $(shell cat $(MODORDER)))84modules := $(sort $(shell cat $(MODORDER)))
90 85
91# Stop after building .o files if NOFINAL is set. Makes compile tests quicker86# Read out modules.order instead of expanding $(modules) to pass in modpost.
92__modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))87# Otherwise, allmodconfig would fail with "Argument list too long".
93 @:
94
95MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - $(wildcard vmlinux)
96
97# We can go over command line length here, so be careful.
98quiet_cmd_modpost = MODPOST $(words $(modules)) modules88quiet_cmd_modpost = MODPOST $(words $(modules)) modules
99 cmd_modpost = sed 's/ko$$/o/' $(MODORDER) | $(MODPOST)89 cmd_modpost = sed 's/ko$$/o/' $(MODORDER) | $(MODPOST)
100 90
101PHONY += modules-modpost91__modpost:
102modules-modpost:92 @$(kecho) ' Building modules, stage 2.'
103 $(call cmd,modpost)93 $(call cmd,modpost)
104 94ifneq ($(KBUILD_MODPOST_NOFINAL),1)
105# Declare generated files as targets for modpost95 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal
106$(modules:.ko=.mod.c): modules-modpost96endif
107
108# Step 5), compile all *.mod.c files
109
110# modname is set to make c_flags define KBUILD_MODNAME
111modname = $(notdir $(@:.mod.o=))
112
113quiet_cmd_cc_o_c = CC $@
114 cmd_cc_o_c = $(CC) $(c_flags) $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE) \
115 -c -o $@ $<
116
117$(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
118 $(call if_changed_dep,cc_o_c)
119
120targets += $(modules:.ko=.mod.o)
121
122ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
123
124# Step 6), final link of the modules with optional arch pass after final link
125quiet_cmd_ld_ko_o = LD [M] $@
126 cmd_ld_ko_o = \
127 $(LD) -r $(KBUILD_LDFLAGS) \
128 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
129 -o $@ $(real-prereqs) ; \
130 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
131
132$(modules): %.ko :%.o %.mod.o FORCE
133 +$(call if_changed,ld_ko_o)
134
135targets += $(modules)
136
137
138# Add FORCE to the prequisites of a target to force it to be always rebuilt.
139# ---------------------------------------------------------------------------
140
141PHONY += FORCE
142
143FORCE:
144
145# Read all saved command lines and dependencies for the $(targets) we
146# may be building above, using $(if_changed{,_dep}). As an
147# optimization, we don't need to read them if the target does not
148# exist, we will rebuild anyway in that case.
149
150existing-targets := $(wildcard $(sort $(targets)))
151
152-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
153 97
154endif98endif
155 99
scripts/Makefile.packagerenamed from scripts/package/Makefile+24−19
@@ -1,6 +1,7 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2# Makefile for the different targets used to generate full packages of a kernel2# Makefile for the different targets used to generate full packages of a kernel
3# It uses the generic clean infrastructure of kbuild3
4include $(srctree)/scripts/Kbuild.include
4 5
5# RPM target6# RPM target
6# ---------------------------------------------------------------------------7# ---------------------------------------------------------------------------
@@ -50,7 +51,8 @@ rm -f $(objtree)/.scmversion · 43 unmodified lines
50 51
51# rpm-pkg52# rpm-pkg
52# ---------------------------------------------------------------------------53# ---------------------------------------------------------------------------
53rpm-pkg: FORCE54PHONY += rpm-pkg
55rpm-pkg:
54 $(MAKE) clean56 $(MAKE) clean
55 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec57 $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
56 $(call cmd,src_tar,$(KERNELPATH),kernel.spec)58 $(call cmd,src_tar,$(KERNELPATH),kernel.spec)
@@ -59,15 +61,15 @@ rpm-pkg: FORCE · 2 unmodified lines
59 61
60# binrpm-pkg62# binrpm-pkg
61# ---------------------------------------------------------------------------63# ---------------------------------------------------------------------------
62binrpm-pkg: FORCE64PHONY += binrpm-pkg
65binrpm-pkg:
63 $(MAKE) -f $(srctree)/Makefile66 $(MAKE) -f $(srctree)/Makefile
64 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec67 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec
65 +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \68 +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
66 $(UTS_MACHINE) -bb $(objtree)/binkernel.spec69 $(UTS_MACHINE) -bb $(objtree)/binkernel.spec
67 70
68clean-files += $(objtree)/*.spec71PHONY += deb-pkg
69 72deb-pkg:
70deb-pkg: FORCE
71 $(MAKE) clean73 $(MAKE) clean
72 $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian74 $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
73 $(call cmd,src_tar,$(KDEB_SOURCENAME))75 $(call cmd,src_tar,$(KDEB_SOURCENAME))
@@ -75,18 +77,19 @@ deb-pkg: FORCE · 1 unmodified line
75 mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz77 mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz
76 +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -i.git -us -uc78 +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -i.git -us -uc
77 79
78bindeb-pkg: FORCE80PHONY += bindeb-pkg
81bindeb-pkg:
79 $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian82 $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
80 +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc83 +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc
81 84
82intdeb-pkg: FORCE85PHONY += intdeb-pkg
86intdeb-pkg:
83 +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb87 +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
84 88
85clean-dirs += $(objtree)/debian/
86
87# snap-pkg89# snap-pkg
88# ---------------------------------------------------------------------------90# ---------------------------------------------------------------------------
89snap-pkg: FORCE91PHONY += snap-pkg
92snap-pkg:
90 rm -rf $(objtree)/snap93 rm -rf $(objtree)/snap
91 mkdir $(objtree)/snap94 mkdir $(objtree)/snap
92 $(MAKE) clean95 $(MAKE) clean
@@ -98,17 +101,14 @@ snap-pkg: FORCE · 5 unmodified lines
98 cd $(objtree)/snap && \101 cd $(objtree)/snap && \
99 snapcraft --target-arch=$(UTS_MACHINE)102 snapcraft --target-arch=$(UTS_MACHINE)
100 103
101clean-dirs += $(objtree)/snap/
102
103# tarball targets104# tarball targets
104# ---------------------------------------------------------------------------105# ---------------------------------------------------------------------------
105tar%pkg: FORCE106tar-pkgs := tar-pkg targz-pkg tarbz2-pkg tarxz-pkg
107PHONY += $(tar-pkgs)
108$(tar-pkgs):
106 $(MAKE) -f $(srctree)/Makefile109 $(MAKE) -f $(srctree)/Makefile
107 +$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@110 +$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
108 111
109clean-dirs += $(objtree)/tar-install/
110
111
112# perf-pkg - generate a source tarball with perf source112# perf-pkg - generate a source tarball with perf source
113# ---------------------------------------------------------------------------113# ---------------------------------------------------------------------------
114 114
@@ -133,12 +133,15 @@ $(if $(findstring xz,$@),xz, \ · 18 unmodified lines
133$(error unknown target $@)))) \133$(error unknown target $@)))) \
134 -f -9 $(perf-tar).tar)134 -f -9 $(perf-tar).tar)
135 135
136perf-%pkg: FORCE136perf-tar-pkgs := perf-tar-src-pkg perf-targz-src-pkg perf-tarbz2-src-pkg perf-tarxz-src-pkg
137PHONY += $(perf-tar-pkgs)
138$(perf-tar-pkgs):
137 $(call cmd,perf_tar)139 $(call cmd,perf_tar)
138 140
139# Help text displayed when executing 'make help'141# Help text displayed when executing 'make help'
140# ---------------------------------------------------------------------------142# ---------------------------------------------------------------------------
141help: FORCE143PHONY += help
144help:
142 @echo ' rpm-pkg - Build both source and binary RPM kernel packages'145 @echo ' rpm-pkg - Build both source and binary RPM kernel packages'
143 @echo ' binrpm-pkg - Build only the binary kernel RPM package'146 @echo ' binrpm-pkg - Build only the binary kernel RPM package'
144 @echo ' deb-pkg - Build both source and binary deb kernel packages'147 @echo ' deb-pkg - Build both source and binary deb kernel packages'
@@ -152,3 +155,5 @@ help: FORCE · 7 unmodified lines
152 @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball'155 @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball'
153 @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball'156 @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball'
154 @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball'157 @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball'
158
159.PHONY: $(PHONY)
scripts/basic/Makefile+2−12
@@ -1,16 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2###2#
3# This Makefile lists the most basic programs used during the build process.3# fixdep: used to generate dependency information during build process
4# The programs listed herein are what are needed to do the basic stuff,
5# such as fix file dependencies.
6# This initial step is needed to avoid files to be recompiled
7# when kernel configuration changes (which is what happens when
8# .config is included by main Makefile.
9# ---------------------------------------------------------------------------
10# fixdep: Used to generate dependency information during build process
11 4
12hostprogs-y := fixdep5hostprogs-y := fixdep
13always := $(hostprogs-y)6always := $(hostprogs-y)
14
15# fixdep is needed to compile other host programs
16$(addprefix $(obj)/,$(filter-out fixdep,$(always))): $(obj)/fixdep
scripts/genksyms/Makefile+2−9
@@ -12,22 +12,15 @@ genksyms-objs := genksyms.o parse.tab.o lex.lex.o · 11 unmodified lines
12#12#
13# Just in case, run "$(YACC) --version" without suppressing stderr13# Just in case, run "$(YACC) --version" without suppressing stderr
14# so that 'bison: not found' will be displayed if it is missing.14# so that 'bison: not found' will be displayed if it is missing.
15ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)15ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
16 16
17quiet_cmd_bison_no_warn = $(quiet_cmd_bison)17quiet_cmd_bison_no_warn = $(quiet_cmd_bison)
18 cmd_bison_no_warn = $(YACC) --version >/dev/null; \18 cmd_bison_no_warn = $(YACC) --version >/dev/null; \
19 $(cmd_bison) 2>/dev/null19 $(cmd_bison) 2>/dev/null
20 20
21$(obj)/parse.tab.c: $(src)/parse.y FORCE21$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE
22 $(call if_changed,bison_no_warn)22 $(call if_changed,bison_no_warn)
23 23
24quiet_cmd_bison_h_no_warn = $(quiet_cmd_bison_h)
25 cmd_bison_h_no_warn = $(YACC) --version >/dev/null; \
26 $(cmd_bison_h) 2>/dev/null
27
28$(obj)/parse.tab.h: $(src)/parse.y FORCE
29 $(call if_changed,bison_h_no_warn)
30
31endif24endif
32 25
33# -I needed for generated C source (shipped source)26# -I needed for generated C source (shipped source)
scripts/genksyms/keywords.c+1−5
@@ -3,11 +3,7 @@ static struct resword { · 2 unmodified lines
3 const char *name;3 const char *name;
4 int token;4 int token;
5} keywords[] = {5} keywords[] = {
6 { "EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW },6 { "__GENKSYMS_EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW },
7 { "EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW },
8 { "EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW },
9 { "EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW },
10 { "EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW },
11 { "__asm", ASM_KEYW },7 { "__asm", ASM_KEYW },
12 { "__asm__", ASM_KEYW },8 { "__asm__", ASM_KEYW },
13 { "__attribute", ATTRIBUTE_KEYW },9 { "__attribute", ATTRIBUTE_KEYW },
scripts/genksyms/lex.l+10−22
@@ -1,25 +1,13 @@
1/* Lexical analysis for genksyms.1/* SPDX-License-Identifier: GPL-2.0-or-later */
2 Copyright 1996, 1997 Linux International.2/*
3 3 * Lexical analysis for genksyms.
4 New implementation contributed by Richard Henderson <rth@tamu.edu>4 * Copyright 1996, 1997 Linux International.
5 Based on original work by Bjorn Ekwall <bj0rn@blox.se>5 *
6 6 * New implementation contributed by Richard Henderson <rth@tamu.edu>
7 Taken from Linux modutils 2.4.22.7 * Based on original work by Bjorn Ekwall <bj0rn@blox.se>
8 8 *
9 This program is free software; you can redistribute it and/or modify it9 * Taken from Linux modutils 2.4.22.
10 under the terms of the GNU General Public License as published by the10 */
11 Free Software Foundation; either version 2 of the License, or (at your
12 option) any later version.
13
14 This program is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software Foundation,
21 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22
23 11
24%{12%{
25 13
scripts/genksyms/parse.y+10−22
@@ -1,25 +1,13 @@
1/* C global declaration parser for genksyms.1/* SPDX-License-Identifier: GPL-2.0-or-later */
2 Copyright 1996, 1997 Linux International.2/*
3 3 * C global declaration parser for genksyms.
4 New implementation contributed by Richard Henderson <rth@tamu.edu>4 * Copyright 1996, 1997 Linux International.
5 Based on original work by Bjorn Ekwall <bj0rn@blox.se>5 *
6 6 * New implementation contributed by Richard Henderson <rth@tamu.edu>
7 This file is part of the Linux modutils.7 * Based on original work by Bjorn Ekwall <bj0rn@blox.se>
8 8 *
9 This program is free software; you can redistribute it and/or modify it9 * This file is part of the Linux modutils.
10 under the terms of the GNU General Public License as published by the10 */
11 Free Software Foundation; either version 2 of the License, or (at your
12 option) any later version.
13
14 This program is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software Foundation,
21 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22
23 11
24%{12%{
25 13
scripts/headers_install.sh+72−0
@@ -41,5 +41,77 @@ sed -E -e ' · 40 unmodified lines
41scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE41scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE
42[ $? -gt 1 ] && exit 142[ $? -gt 1 ] && exit 1
43 43
44# Remove /* ... */ style comments, and find CONFIG_ references in code
45configs=$(sed -e '
46:comment
47 s:/\*[^*][^*]*:/*:
48 s:/\*\*\**\([^/]\):/*\1:
49 t comment
50 s:/\*\*/: :
51 t comment
52 /\/\*/! b check
53 N
54 b comment
55:print
56 P
57 D
58:check
59 s:^\(CONFIG_[[:alnum:]_]*\):\1\n:
60 t print
61 s:^[[:alnum:]_][[:alnum:]_]*::
62 s:^[^[:alnum:]_][^[:alnum:]_]*::
63 t check
64 d
65' $OUTFILE)
66
67# The entries in the following list are not warned.
68# Please do not add a new entry. This list is only for existing ones.
69# The list will be reduced gradually, and deleted eventually. (hopefully)
70#
71# The format is <file-name>:<CONFIG-option> in each line.
72config_leak_ignores="
73arch/alpha/include/uapi/asm/setup.h:CONFIG_ALPHA_LEGACY_START_ADDRESS
74arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K
75arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K
76arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE
77arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8
78arch/hexagon/include/uapi/asm/ptrace.h:CONFIG_HEXAGON_ARCH_VERSION
79arch/hexagon/include/uapi/asm/user.h:CONFIG_HEXAGON_ARCH_VERSION
80arch/ia64/include/uapi/asm/cmpxchg.h:CONFIG_IA64_DEBUG_CMPXCHG
81arch/m68k/include/uapi/asm/ptrace.h:CONFIG_COLDFIRE
82arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO
83arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT
84arch/sh/include/uapi/asm/ptrace.h:CONFIG_CPU_SH5
85arch/sh/include/uapi/asm/sigcontext.h:CONFIG_CPU_SH5
86arch/sh/include/uapi/asm/stat.h:CONFIG_CPU_SH5
87arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION
88arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64
89arch/x86/include/uapi/asm/mman.h:CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
90include/uapi/asm-generic/fcntl.h:CONFIG_64BIT
91include/uapi/linux/atmdev.h:CONFIG_COMPAT
92include/uapi/linux/elfcore.h:CONFIG_BINFMT_ELF_FDPIC
93include/uapi/linux/eventpoll.h:CONFIG_PM_SLEEP
94include/uapi/linux/hw_breakpoint.h:CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
95include/uapi/linux/pktcdvd.h:CONFIG_CDROM_PKTCDVD_WCACHE
96include/uapi/linux/raw.h:CONFIG_MAX_RAW_DEVS
97"
98
99for c in $configs
100do
101 warn=1
102
103 for ignore in $config_leak_ignores
104 do
105 if echo "$INFILE:$c" | grep -q "$ignore$"; then
106 warn=
107 break
108 fi
109 done
110
111 if [ "$warn" = 1 ]; then
112 echo "warning: $INFILE: leak $c to user-space" >&2
113 fi
114done
115
44rm -f $TMPFILE116rm -f $TMPFILE
45trap - EXIT117trap - EXIT
scripts/kconfig/Makefile+5−5
@@ -114,7 +114,7 @@ testconfig: $(obj)/conf · 113 unmodified lines
114 $(PYTHON3) -B -m pytest $(srctree)/$(src)/tests \114 $(PYTHON3) -B -m pytest $(srctree)/$(src)/tests \
115 -o cache_dir=$(abspath $(obj)/tests/.cache) \115 -o cache_dir=$(abspath $(obj)/tests/.cache) \
116 $(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)116 $(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)
117clean-dirs += tests/.cache117clean-files += tests/.cache
118 118
119# Help text used by make help119# Help text used by make help
120help:120help:
@@ -166,15 +166,15 @@ $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg · 45 unmodified lines
166 166
167# mconf: Used for the menuconfig target based on lxdialog167# mconf: Used for the menuconfig target based on lxdialog
168hostprogs-y += mconf168hostprogs-y += mconf
169lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o169lxdialog := $(addprefix lxdialog/, \
170mconf-objs := mconf.o $(addprefix lxdialog/, $(lxdialog)) $(common-objs)170 checklist.o inputbox.o menubox.o textbox.o util.o yesno.o)
171mconf-objs := mconf.o $(lxdialog) $(common-objs)
171 172
172HOSTLDLIBS_mconf = $(shell . $(obj)/mconf-cfg && echo $$libs)173HOSTLDLIBS_mconf = $(shell . $(obj)/mconf-cfg && echo $$libs)
173$(foreach f, mconf.o $(lxdialog), \174$(foreach f, mconf.o $(lxdialog), \
174 $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/mconf-cfg && echo $$$$cflags)))175 $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/mconf-cfg && echo $$$$cflags)))
175 176
176$(obj)/mconf.o: $(obj)/mconf-cfg177$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg
177$(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/mconf-cfg
178 178
179# qconf: Used for the xconfig target based on Qt179# qconf: Used for the xconfig target based on Qt
180hostprogs-y += qconf180hostprogs-y += qconf
scripts/kconfig/merge_config.sh+6−6
@@ -13,12 +13,12 @@ · 12 unmodified lines
13# Copyright (c) 2009-2010 Wind River Systems, Inc.13# Copyright (c) 2009-2010 Wind River Systems, Inc.
14# Copyright 2011 Linaro14# Copyright 2011 Linaro
15 15
16set -e
17
16clean_up() {18clean_up() {
17 rm -f $TMP_FILE19 rm -f $TMP_FILE
18 rm -f $MERGE_FILE20 rm -f $MERGE_FILE
19 exit
20}21}
21trap clean_up HUP INT TERM
22 22
23usage() {23usage() {
24 echo "Usage: $0 [OPTIONS] [CONFIG [...]]"24 echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
@@ -110,6 +110,9 @@ TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) · 85 unmodified lines
110MERGE_FILE=$(mktemp ./.merge_tmp.config.XXXXXXXXXX)110MERGE_FILE=$(mktemp ./.merge_tmp.config.XXXXXXXXXX)
111 111
112echo "Using $INITFILE as base"112echo "Using $INITFILE as base"
113
114trap clean_up EXIT
115
113cat $INITFILE > $TMP_FILE116cat $INITFILE > $TMP_FILE
114 117
115# Merge files, printing warnings on overridden values118# Merge files, printing warnings on overridden values
@@ -155,7 +158,6 @@ if [ "$RUNMAKE" = "false" ]; then · 39 unmodified lines
155 echo "#"158 echo "#"
156 echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"159 echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
157 echo "#"160 echo "#"
158 clean_up
159 exit161 exit
160fi162fi
161 163
@@ -177,7 +179,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET · 15 unmodified lines
177for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do179for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do
178 180
179 REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)181 REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
180 ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG")182 ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG" || true)
181 if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then183 if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
182 echo "Value requested for $CFG not in final .config"184 echo "Value requested for $CFG not in final .config"
183 echo "Requested value: $REQUESTED_VAL"185 echo "Requested value: $REQUESTED_VAL"
@@ -185,5 +187,3 @@ for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do · 1 unmodified line
185 echo ""187 echo ""
186 fi188 fi
187done189done
188
189clean_up
scripts/link-vmlinux.sh+21−19
@@ -64,6 +64,8 @@ vmlinux_link() · 63 unmodified lines
64 local output=${1}64 local output=${1}
65 local objects65 local objects
66 66
67 info LD ${output}
68
67 # skip output file argument69 # skip output file argument
68 shift70 shift
69 71
@@ -157,6 +159,18 @@ kallsyms() · 87 unmodified lines
157 ${CC} ${aflags} -c -o ${2} ${afile}159 ${CC} ${aflags} -c -o ${2} ${afile}
158}160}
159 161
162# Perform one step in kallsyms generation, including temporary linking of
163# vmlinux.
164kallsyms_step()
165{
166 kallsymso_prev=${kallsymso}
167 kallsymso=.tmp_kallsyms${1}.o
168 kallsyms_vmlinux=.tmp_vmlinux${1}
169
170 vmlinux_link ${kallsyms_vmlinux} "${kallsymso_prev}" ${btf_vmlinux_bin_o}
171 kallsyms ${kallsyms_vmlinux} ${kallsymso}
172}
173
160# Create map file with all symbols from ${1}174# Create map file with all symbols from ${1}
161# See mksymap for additional details175# See mksymap for additional details
162mksysmap()176mksysmap()
@@ -243,6 +257,7 @@ if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then · 80 unmodified lines
243fi257fi
244 258
245kallsymso=""259kallsymso=""
260kallsymso_prev=""
246kallsyms_vmlinux=""261kallsyms_vmlinux=""
247if [ -n "${CONFIG_KALLSYMS}" ]; then262if [ -n "${CONFIG_KALLSYMS}" ]; then
248 263
@@ -269,32 +284,19 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then · 20 unmodified lines
269 # a) Verify that the System.map from vmlinux matches the map from284 # a) Verify that the System.map from vmlinux matches the map from
270 # ${kallsymso}.285 # ${kallsymso}.
271 286
272 kallsymso=.tmp_kallsyms2.o287 kallsyms_step 1
273 kallsyms_vmlinux=.tmp_vmlinux2288 kallsyms_step 2
274
275 # step 1
276 vmlinux_link .tmp_vmlinux1 ${btf_vmlinux_bin_o}
277 kallsyms .tmp_vmlinux1 .tmp_kallsyms1.o
278
279 # step 2
280 vmlinux_link .tmp_vmlinux2 .tmp_kallsyms1.o ${btf_vmlinux_bin_o}
281 kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o
282 289
283 # step 3290 # step 3
284 size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" .tmp_kallsyms1.o)291 size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso_prev})
285 size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" .tmp_kallsyms2.o)292 size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso})
286 293
287 if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then294 if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then
288 kallsymso=.tmp_kallsyms3.o295 kallsyms_step 3
289 kallsyms_vmlinux=.tmp_vmlinux3
290
291 vmlinux_link .tmp_vmlinux3 .tmp_kallsyms2.o ${btf_vmlinux_bin_o}
292 kallsyms .tmp_vmlinux3 .tmp_kallsyms3.o
293 fi296 fi
294fi297fi
295 298
296info LD vmlinux299vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}
297vmlinux_link vmlinux "${kallsymso}" "${btf_vmlinux_bin_o}"
298 300
299if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then301if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then
300 info SORTEX vmlinux302 info SORTEX vmlinux
scripts/mkcompile_h+3−1
@@ -5,7 +5,8 @@ TARGET=$1 · 4 unmodified lines
5ARCH=$25ARCH=$2
6SMP=$36SMP=$3
7PREEMPT=$47PREEMPT=$4
8CC=$58PREEMPT_RT=$5
9CC=$6
9 10
10vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }11vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
11 12
@@ -53,6 +54,7 @@ UTS_VERSION="#$VERSION" · 41 unmodified lines
53CONFIG_FLAGS=""54CONFIG_FLAGS=""
54if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi55if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
55if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi56if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
57if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
56UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"58UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
57 59
58# Truncate to maximum length60# Truncate to maximum length
scripts/mkmakefile+2−2
@@ -12,6 +12,6 @@ if [ "${quiet}" != "silent_" ]; then · 11 unmodified lines
12fi12fi
13 13
14cat << EOF > Makefile14cat << EOF > Makefile
15# Automatically generated by $(realpath $0): don't edit15# Automatically generated by $0: don't edit
16include $(realpath $1/Makefile)16include $1/Makefile
17EOF17EOF
scripts/mod/file2alias.c+5−0
@@ -34,6 +34,11 @@ typedef Elf64_Addr kernel_ulong_t; · 33 unmodified lines
34typedef uint32_t __u32;34typedef uint32_t __u32;
35typedef uint16_t __u16;35typedef uint16_t __u16;
36typedef unsigned char __u8;36typedef unsigned char __u8;
37typedef struct {
38 __u8 b[16];
39} guid_t;
40
41/* backwards compatibility, don't use in new code */
37typedef struct {42typedef struct {
38 __u8 b[16];43 __u8 b[16];
39} uuid_le;44} uuid_le;
scripts/mod/modpost.c+38−10
@@ -169,6 +169,7 @@ struct symbol { · 168 unmodified lines
169 unsigned int kernel:1; /* 1 if symbol is from kernel169 unsigned int kernel:1; /* 1 if symbol is from kernel
170 * (only for external modules) **/170 * (only for external modules) **/
171 unsigned int preloaded:1; /* 1 if symbol from Module.symvers, or crc */171 unsigned int preloaded:1; /* 1 if symbol from Module.symvers, or crc */
172 unsigned int is_static:1; /* 1 if symbol is not global */
172 enum export export; /* Type of export */173 enum export export; /* Type of export */
173 char name[0];174 char name[0];
174};175};
@@ -201,6 +202,7 @@ static struct symbol *alloc_symbol(const char *name, unsigned int weak, · 26 unmodified lines
201 strcpy(s->name, name);202 strcpy(s->name, name);
202 s->weak = weak;203 s->weak = weak;
203 s->next = next;204 s->next = next;
205 s->is_static = 1;
204 return s;206 return s;
205}207}
206 208
@@ -795,9 +797,9 @@ static int match(const char *sym, const char * const pat[]) · 588 unmodified lines
795 797
796 /* "*foo*" */798 /* "*foo*" */
797 if (*p == '*' && *endp == '*') {799 if (*p == '*' && *endp == '*') {
798 char *here, *bare = strndup(p + 1, strlen(p) - 2);800 char *bare = NOFAIL(strndup(p + 1, strlen(p) - 2));
801 char *here = strstr(sym, bare);
799 802
800 here = strstr(sym, bare);
801 free(bare);803 free(bare);
802 if (here != NULL)804 if (here != NULL)
803 return 1;805 return 1;
@@ -1980,6 +1982,21 @@ static void read_symbols(const char *modname) · 1176 unmodified lines
1980 handle_modversions(mod, &info, sym, symname);1982 handle_modversions(mod, &info, sym, symname);
1981 handle_moddevtable(mod, &info, sym, symname);1983 handle_moddevtable(mod, &info, sym, symname);
1982 }1984 }
1985
1986 // check for static EXPORT_SYMBOL_* functions && global vars
1987 for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
1988 unsigned char bind = ELF_ST_BIND(sym->st_info);
1989
1990 if (bind == STB_GLOBAL || bind == STB_WEAK) {
1991 struct symbol *s =
1992 find_symbol(remove_dot(info.strtab +
1993 sym->st_name));
1994
1995 if (s)
1996 s->is_static = 0;
1997 }
1998 }
1999
1983 if (!is_vmlinux(modname) || vmlinux_section_warnings)2000 if (!is_vmlinux(modname) || vmlinux_section_warnings)
1984 check_sec_ref(mod, modname, &info);2001 check_sec_ref(mod, modname, &info);
1985 2002
@@ -2159,7 +2176,7 @@ static void add_header(struct buffer *b, struct module *mod) · 173 unmodified lines
2159 buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n");2176 buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n");
2160 buf_printf(b, "\n");2177 buf_printf(b, "\n");
2161 buf_printf(b, "__visible struct module __this_module\n");2178 buf_printf(b, "__visible struct module __this_module\n");
2162 buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");2179 buf_printf(b, "__section(.gnu.linkonce.this_module) = {\n");
2163 buf_printf(b, "\t.name = KBUILD_MODNAME,\n");2180 buf_printf(b, "\t.name = KBUILD_MODNAME,\n");
2164 if (mod->has_init)2181 if (mod->has_init)
2165 buf_printf(b, "\t.init = init_module,\n");2182 buf_printf(b, "\t.init = init_module,\n");
@@ -2213,8 +2230,7 @@ static int add_versions(struct buffer *b, struct module *mod) · 47 unmodified lines
2213 2230
2214 buf_printf(b, "\n");2231 buf_printf(b, "\n");
2215 buf_printf(b, "static const struct modversion_info ____versions[]\n");2232 buf_printf(b, "static const struct modversion_info ____versions[]\n");
2216 buf_printf(b, "__used\n");2233 buf_printf(b, "__used __section(__versions) = {\n");
2217 buf_printf(b, "__attribute__((section(\"__versions\"))) = {\n");
2218 2234
2219 for (s = mod->unres; s; s = s->next) {2235 for (s = mod->unres; s; s = s->next) {
2220 if (!s->module)2236 if (!s->module)
@@ -2250,10 +2266,7 @@ static void add_depends(struct buffer *b, struct module *mod) · 29 unmodified lines
2250 s->module->seen = is_vmlinux(s->module->name);2266 s->module->seen = is_vmlinux(s->module->name);
2251 2267
2252 buf_printf(b, "\n");2268 buf_printf(b, "\n");
2253 buf_printf(b, "static const char __module_depends[]\n");2269 buf_printf(b, "MODULE_INFO(depends, \"");
2254 buf_printf(b, "__used\n");
2255 buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
2256 buf_printf(b, "\"depends=");
2257 for (s = mod->unres; s; s = s->next) {2270 for (s = mod->unres; s; s = s->next) {
2258 const char *p;2271 const char *p;
2259 if (!s->module)2272 if (!s->module)
@@ -2271,7 +2284,7 @@ static void add_depends(struct buffer *b, struct module *mod) · 11 unmodified lines
2271 buf_printf(b, "%s%s", first ? "" : ",", p);2284 buf_printf(b, "%s%s", first ? "" : ",", p);
2272 first = 0;2285 first = 0;
2273 }2286 }
2274 buf_printf(b, "\";\n");2287 buf_printf(b, "\");\n");
2275}2288}
2276 2289
2277static void add_srcversion(struct buffer *b, struct module *mod)2290static void add_srcversion(struct buffer *b, struct module *mod)
@@ -2369,6 +2382,7 @@ static void read_dump(const char *fname, unsigned int kernel) · 91 unmodified lines
2369 s = sym_add_exported(symname, mod, export_no(export));2382 s = sym_add_exported(symname, mod, export_no(export));
2370 s->kernel = kernel;2383 s->kernel = kernel;
2371 s->preloaded = 1;2384 s->preloaded = 1;
2385 s->is_static = 0;
2372 sym_update_crc(symname, mod, crc, export_no(export));2386 sym_update_crc(symname, mod, crc, export_no(export));
2373 }2387 }
2374 release_file(file, size);2388 release_file(file, size);
@@ -2425,6 +2439,7 @@ int main(int argc, char **argv) · 50 unmodified lines
2425 char *dump_write = NULL, *files_source = NULL;2439 char *dump_write = NULL, *files_source = NULL;
2426 int opt;2440 int opt;
2427 int err;2441 int err;
2442 int n;
2428 struct ext_sym_list *extsym_iter;2443 struct ext_sym_list *extsym_iter;
2429 struct ext_sym_list *extsym_start = NULL;2444 struct ext_sym_list *extsym_start = NULL;
2430 2445
@@ -2520,6 +2535,19 @@ int main(int argc, char **argv) · 89 unmodified lines
2520 if (sec_mismatch_count && sec_mismatch_fatal)2535 if (sec_mismatch_count && sec_mismatch_fatal)
2521 fatal("modpost: Section mismatches detected.\n"2536 fatal("modpost: Section mismatches detected.\n"
2522 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");2537 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
2538 for (n = 0; n < SYMBOL_HASH_SIZE; n++) {
2539 struct symbol *s = symbolhash[n];
2540
2541 while (s) {
2542 if (s->is_static)
2543 warn("\"%s\" [%s] is a static %s\n",
2544 s->name, s->module->name,
2545 export_str(s->export));
2546
2547 s = s->next;
2548 }
2549 }
2550
2523 free(buf.p);2551 free(buf.p);
2524 2552
2525 return err;2553 return err;
usr/include/Makefile+1−3
@@ -115,6 +115,4 @@ header-test-y += $(filter-out $(header-test-), \ · 114 unmodified lines
115 $(patsubst $(obj)/%,%, $(wildcard \115 $(patsubst $(obj)/%,%, $(wildcard \
116 $(addprefix $(obj)/, *.h */*.h */*/*.h */*/*/*.h))))116 $(addprefix $(obj)/, *.h */*.h */*/*.h */*/*/*.h))))
117 117
118# For GNU Make <= 4.2.1, $(wildcard $(obj)/*/) matches to not only directories118clean-files += $(filter-out Makefile, $(notdir $(wildcard $(obj)/*)))
119# but also regular files. Use $(filter %/, ...) just in case.
120clean-dirs += $(patsubst $(obj)/%/,%,$(filter %/, $(wildcard $(obj)/*/)))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t