aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore16
-rw-r--r--Documentation/dontdiff1
-rw-r--r--Documentation/kbuild/kbuild.txt5
-rw-r--r--Makefile146
-rw-r--r--arch/arm/plat-omap/dma.c1
-rw-r--r--drivers/clocksource/timer-ti-dm.c1
-rw-r--r--drivers/memory/Makefile7
-rw-r--r--drivers/memory/Makefile.asm-offsets4
-rw-r--r--drivers/mfd/omap-usb-tll.c1
-rw-r--r--include/asm-generic/vmlinux.lds.h1
-rw-r--r--include/linux/module.h1
-rw-r--r--include/linux/moduleparam.h12
-rw-r--r--samples/Kconfig7
-rw-r--r--samples/Makefile2
-rw-r--r--samples/seccomp/Makefile2
-rw-r--r--scripts/Makefile.build2
-rw-r--r--scripts/Makefile.host2
-rw-r--r--scripts/Makefile.lib2
-rw-r--r--scripts/Makefile.modbuiltin2
-rw-r--r--scripts/Makefile.modpost2
-rw-r--r--scripts/gdb/linux/Makefile2
-rwxr-xr-xscripts/link-vmlinux.sh3
-rwxr-xr-xscripts/mkmakefile26
-rwxr-xr-xscripts/recordmcount.pl2
-rwxr-xr-xscripts/tags.sh2
25 files changed, 128 insertions, 124 deletions
diff --git a/.gitignore b/.gitignore
index a20ac26aa2f5..d263ca9a276c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@ modules.builtin
58/vmlinuz 58/vmlinuz
59/System.map 59/System.map
60/Module.markers 60/Module.markers
61/modules.builtin.modinfo
61 62
62# 63#
63# RPM spec file (make rpm-pkg) 64# RPM spec file (make rpm-pkg)
@@ -90,10 +91,10 @@ modules.builtin
90# 91#
91# Generated include files 92# Generated include files
92# 93#
93include/config 94/include/config/
94include/generated 95/include/generated/
95include/ksym 96/include/ksym/
96arch/*/include/generated 97/arch/*/include/generated/
97 98
98# stgit generated dirs 99# stgit generated dirs
99patches-* 100patches-*
@@ -129,7 +130,12 @@ signing_key.x509
129x509.genkey 130x509.genkey
130 131
131# Kconfig presets 132# Kconfig presets
132all.config 133/all.config
134/alldef.config
135/allmod.config
136/allno.config
137/allrandom.config
138/allyes.config
133 139
134# Kdevelop4 140# Kdevelop4
135*.kdev4 141*.kdev4
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index 93693775639f..48e1930fb4a4 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -179,6 +179,7 @@ mktree
179mkutf8data 179mkutf8data
180modpost 180modpost
181modules.builtin 181modules.builtin
182modules.builtin.modinfo
182modules.order 183modules.order
183modversions.h* 184modversions.h*
184nconf 185nconf
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 8a3830b39c7d..9c230ea71963 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -11,6 +11,11 @@ modules.builtin
11This file lists all modules that are built into the kernel. This is used 11This file lists all modules that are built into the kernel. This is used
12by modprobe to not fail when trying to load something builtin. 12by modprobe to not fail when trying to load something builtin.
13 13
14modules.builtin.modinfo
15--------------------------------------------------
16This file contains modinfo from all modules that are built into the kernel.
17Unlike modinfo of a separate module, all fields are prefixed with module name.
18
14 19
15Environment variables 20Environment variables
16 21
diff --git a/Makefile b/Makefile
index bcf2e7628fe5..a61a95b6b38f 100644
--- a/Makefile
+++ b/Makefile
@@ -96,56 +96,65 @@ endif
96 96
97export quiet Q KBUILD_VERBOSE 97export quiet Q KBUILD_VERBOSE
98 98
99# kbuild supports saving output files in a separate directory. 99# Kbuild will save output files in the current working directory.
100# To locate output files in a separate directory two syntaxes are supported. 100# This does not need to match to the root of the kernel source tree.
101# In both cases the working directory must be the root of the kernel src. 101#
102# For example, you can do this:
103#
104# cd /dir/to/store/output/files; make -f /dir/to/kernel/source/Makefile
105#
106# If you want to save output files in a different location, there are
107# two syntaxes to specify it.
108#
102# 1) O= 109# 1) O=
103# Use "make O=dir/to/store/output/files/" 110# Use "make O=dir/to/store/output/files/"
104# 111#
105# 2) Set KBUILD_OUTPUT 112# 2) Set KBUILD_OUTPUT
106# Set the environment variable KBUILD_OUTPUT to point to the directory 113# Set the environment variable KBUILD_OUTPUT to point to the output directory.
107# where the output files shall be placed. 114# export KBUILD_OUTPUT=dir/to/store/output/files/; make
108# export KBUILD_OUTPUT=dir/to/store/output/files/
109# make
110# 115#
111# The O= assignment takes precedence over the KBUILD_OUTPUT environment 116# The O= assignment takes precedence over the KBUILD_OUTPUT environment
112# variable. 117# variable.
113 118
114# KBUILD_SRC is not intended to be used by the regular user (for now), 119# Do we want to change the working directory?
115# it is set on invocation of make with KBUILD_OUTPUT or O= specified.
116
117# OK, Make called in directory where kernel src resides
118# Do we want to locate output files in a separate directory?
119ifeq ("$(origin O)", "command line") 120ifeq ("$(origin O)", "command line")
120 KBUILD_OUTPUT := $(O) 121 KBUILD_OUTPUT := $(O)
121endif 122endif
122 123
123ifneq ($(words $(subst :, ,$(CURDIR))), 1) 124ifneq ($(KBUILD_OUTPUT),)
124 $(error main directory cannot contain spaces nor colons) 125# Make's built-in functions such as $(abspath ...), $(realpath ...) cannot
126# expand a shell special character '~'. We use a somewhat tedious way here.
127abs_objtree := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) && pwd)
128$(if $(abs_objtree),, \
129 $(error failed to create output directory "$(KBUILD_OUTPUT)"))
130
131# $(realpath ...) resolves symlinks
132abs_objtree := $(realpath $(abs_objtree))
133else
134abs_objtree := $(CURDIR)
135endif # ifneq ($(KBUILD_OUTPUT),)
136
137ifeq ($(abs_objtree),$(CURDIR))
138# Suppress "Entering directory ..." unless we are changing the work directory.
139MAKEFLAGS += --no-print-directory
140else
141need-sub-make := 1
125endif 142endif
126 143
127ifneq ($(KBUILD_OUTPUT),) 144abs_srctree := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
128# check that the output directory actually exists
129saved-output := $(KBUILD_OUTPUT)
130KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
131 && pwd)
132$(if $(KBUILD_OUTPUT),, \
133 $(error failed to create output directory "$(saved-output)"))
134 145
146ifneq ($(words $(subst :, ,$(abs_srctree))), 1)
147$(error source directory cannot contain spaces or colons)
148endif
149
150ifneq ($(abs_srctree),$(abs_objtree))
135# Look for make include files relative to root of kernel src 151# Look for make include files relative to root of kernel src
136# 152#
137# This does not become effective immediately because MAKEFLAGS is re-parsed 153# This does not become effective immediately because MAKEFLAGS is re-parsed
138# once after the Makefile is read. It is OK since we are going to invoke 154# once after the Makefile is read. We need to invoke sub-make.
139# 'sub-make' below. 155MAKEFLAGS += --include-dir=$(abs_srctree)
140MAKEFLAGS += --include-dir=$(CURDIR)
141
142need-sub-make := 1 156need-sub-make := 1
143else 157endif
144
145# Do not print "Entering directory ..." at all for in-tree build.
146MAKEFLAGS += --no-print-directory
147
148endif # ifneq ($(KBUILD_OUTPUT),)
149 158
150ifneq ($(filter 3.%,$(MAKE_VERSION)),) 159ifneq ($(filter 3.%,$(MAKE_VERSION)),)
151# 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x 160# 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x
@@ -155,20 +164,19 @@ need-sub-make := 1
155$(lastword $(MAKEFILE_LIST)): ; 164$(lastword $(MAKEFILE_LIST)): ;
156endif 165endif
157 166
167export abs_srctree abs_objtree
158export sub_make_done := 1 168export sub_make_done := 1
159 169
160ifeq ($(need-sub-make),1) 170ifeq ($(need-sub-make),1)
161 171
162PHONY += $(MAKECMDGOALS) sub-make 172PHONY += $(MAKECMDGOALS) sub-make
163 173
164$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make 174$(filter-out _all sub-make $(lastword $(MAKEFILE_LIST)), $(MAKECMDGOALS)) _all: sub-make
165 @: 175 @:
166 176
167# Invoke a second make in the output directory, passing relevant variables 177# Invoke a second make in the output directory, passing relevant variables
168sub-make: 178sub-make:
169 $(Q)$(MAKE) \ 179 $(Q)$(MAKE) -C $(abs_objtree) -f $(abs_srctree)/Makefile $(MAKECMDGOALS)
170 $(if $(KBUILD_OUTPUT),-C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR)) \
171 -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
172 180
173endif # need-sub-make 181endif # need-sub-make
174endif # sub_make_done 182endif # sub_make_done
@@ -213,16 +221,21 @@ ifeq ("$(origin M)", "command line")
213 KBUILD_EXTMOD := $(M) 221 KBUILD_EXTMOD := $(M)
214endif 222endif
215 223
216ifeq ($(KBUILD_SRC),) 224ifeq ($(abs_srctree),$(abs_objtree))
217 # building in the source tree 225 # building in the source tree
218 srctree := . 226 srctree := .
219else 227else
220 ifeq ($(KBUILD_SRC)/,$(dir $(CURDIR))) 228 ifeq ($(abs_srctree)/,$(dir $(abs_objtree)))
221 # building in a subdirectory of the source tree 229 # building in a subdirectory of the source tree
222 srctree := .. 230 srctree := ..
223 else 231 else
224 srctree := $(KBUILD_SRC) 232 srctree := $(abs_srctree)
225 endif 233 endif
234
235 # TODO:
236 # KBUILD_SRC is only used to distinguish in-tree/out-of-tree build.
237 # Replace it with $(srctree) or something.
238 KBUILD_SRC := $(abs_srctree)
226endif 239endif
227 240
228export KBUILD_CHECKSRC KBUILD_EXTMOD KBUILD_SRC 241export KBUILD_CHECKSRC KBUILD_EXTMOD KBUILD_SRC
@@ -436,7 +449,7 @@ USERINCLUDE := \
436LINUXINCLUDE := \ 449LINUXINCLUDE := \
437 -I$(srctree)/arch/$(SRCARCH)/include \ 450 -I$(srctree)/arch/$(SRCARCH)/include \
438 -I$(objtree)/arch/$(SRCARCH)/include/generated \ 451 -I$(objtree)/arch/$(SRCARCH)/include/generated \
439 $(if $(KBUILD_SRC), -I$(srctree)/include) \ 452 $(if $(filter .,$(srctree)),,-I$(srctree)/include) \
440 -I$(objtree)/include \ 453 -I$(objtree)/include \
441 $(USERINCLUDE) 454 $(USERINCLUDE)
442 455
@@ -497,7 +510,7 @@ PHONY += outputmakefile
497# At the same time when output Makefile generated, generate .gitignore to 510# At the same time when output Makefile generated, generate .gitignore to
498# ignore whole output directory 511# ignore whole output directory
499outputmakefile: 512outputmakefile:
500ifneq ($(KBUILD_SRC),) 513ifneq ($(srctree),.)
501 $(Q)ln -fsn $(srctree) source 514 $(Q)ln -fsn $(srctree) source
502 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) 515 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
503 $(Q)test -e .gitignore || \ 516 $(Q)test -e .gitignore || \
@@ -520,15 +533,6 @@ KBUILD_AFLAGS += $(CLANG_FLAGS)
520export CLANG_FLAGS 533export CLANG_FLAGS
521endif 534endif
522 535
523RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
524RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register
525RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
526RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline
527RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
528RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
529export RETPOLINE_CFLAGS
530export RETPOLINE_VDSO_CFLAGS
531
532# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included. 536# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
533# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. 537# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
534# CC_VERSION_TEXT is referenced from Kconfig (so it needs export), 538# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
@@ -595,20 +599,21 @@ endif
595 599
596export KBUILD_MODULES KBUILD_BUILTIN 600export KBUILD_MODULES KBUILD_BUILTIN
597 601
602ifeq ($(dot-config),1)
603include include/config/auto.conf
604endif
605
598ifeq ($(KBUILD_EXTMOD),) 606ifeq ($(KBUILD_EXTMOD),)
599# Objects we will link into vmlinux / subdirs we need to visit 607# Objects we will link into vmlinux / subdirs we need to visit
600init-y := init/ 608init-y := init/
601drivers-y := drivers/ sound/ 609drivers-y := drivers/ sound/
610drivers-$(CONFIG_SAMPLES) += samples/
602net-y := net/ 611net-y := net/
603libs-y := lib/ 612libs-y := lib/
604core-y := usr/ 613core-y := usr/
605virt-y := virt/ 614virt-y := virt/
606endif # KBUILD_EXTMOD 615endif # KBUILD_EXTMOD
607 616
608ifeq ($(dot-config),1)
609include include/config/auto.conf
610endif
611
612# The all: target is the default when no target is given on the 617# The all: target is the default when no target is given on the
613# command line. 618# command line.
614# This allow a user to issue only 'make' to build a kernel including modules 619# This allow a user to issue only 'make' to build a kernel including modules
@@ -625,6 +630,15 @@ ifdef CONFIG_FUNCTION_TRACER
625 CC_FLAGS_FTRACE := -pg 630 CC_FLAGS_FTRACE := -pg
626endif 631endif
627 632
633RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
634RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register
635RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
636RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline
637RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
638RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
639export RETPOLINE_CFLAGS
640export RETPOLINE_VDSO_CFLAGS
641
628# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default 642# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
629# values of the respective KBUILD_* variables 643# values of the respective KBUILD_* variables
630ARCH_CPPFLAGS := 644ARCH_CPPFLAGS :=
@@ -985,8 +999,9 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
985 $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ 999 $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
986 $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y))) 1000 $(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))
987 1001
988vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ 1002vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \
989 $(init-) $(core-) $(drivers-) $(net-) $(libs-) $(virt-)))) 1003 $(patsubst %/,%,$(filter %/, $(init-) $(core-) \
1004 $(drivers-) $(net-) $(libs-) $(virt-))))
990 1005
991init-y := $(patsubst %/, %/built-in.a, $(init-y)) 1006init-y := $(patsubst %/, %/built-in.a, $(init-y))
992core-y := $(patsubst %/, %/built-in.a, $(core-y)) 1007core-y := $(patsubst %/, %/built-in.a, $(core-y))
@@ -1003,7 +1018,7 @@ export KBUILD_VMLINUX_LIBS := $(libs-y1)
1003export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds 1018export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
1004export LDFLAGS_vmlinux 1019export LDFLAGS_vmlinux
1005# used by scripts/package/Makefile 1020# used by scripts/package/Makefile
1006export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools) 1021export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch include scripts tools)
1007 1022
1008vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) 1023vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
1009 1024
@@ -1040,11 +1055,8 @@ vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
1040 1055
1041targets := vmlinux 1056targets := vmlinux
1042 1057
1043# Build samples along the rest of the kernel. This needs headers_install. 1058# Some samples need headers_install.
1044ifdef CONFIG_SAMPLES
1045vmlinux-dirs += samples
1046samples: headers_install 1059samples: headers_install
1047endif
1048 1060
1049# The actual objects are generated when descending, 1061# The actual objects are generated when descending,
1050# make sure no implicit rule kicks in 1062# make sure no implicit rule kicks in
@@ -1064,7 +1076,7 @@ filechk_kernel.release = \
1064 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" 1076 echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
1065 1077
1066# Store (new) KERNELRELEASE string in include/config/kernel.release 1078# Store (new) KERNELRELEASE string in include/config/kernel.release
1067include/config/kernel.release: $(srctree)/Makefile FORCE 1079include/config/kernel.release: FORCE
1068 $(call filechk,kernel.release) 1080 $(call filechk,kernel.release)
1069 1081
1070# Additional helpers built in scripts/ 1082# Additional helpers built in scripts/
@@ -1086,9 +1098,11 @@ PHONY += prepare archprepare prepare1 prepare3
1086# and if so do: 1098# and if so do:
1087# 1) Check that make has not been executed in the kernel src $(srctree) 1099# 1) Check that make has not been executed in the kernel src $(srctree)
1088prepare3: include/config/kernel.release 1100prepare3: include/config/kernel.release
1089ifneq ($(KBUILD_SRC),) 1101ifneq ($(srctree),.)
1090 @$(kecho) ' Using $(srctree) as source for kernel' 1102 @$(kecho) ' Using $(srctree) as source for kernel'
1091 $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \ 1103 $(Q)if [ -f $(srctree)/.config -o \
1104 -d $(srctree)/include/config -o \
1105 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
1092 echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \ 1106 echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \
1093 echo >&2 " in the '$(srctree)' directory.";\ 1107 echo >&2 " in the '$(srctree)' directory.";\
1094 /bin/false; \ 1108 /bin/false; \
@@ -1304,6 +1318,7 @@ _modinst_:
1304 fi 1318 fi
1305 @cp -f $(objtree)/modules.order $(MODLIB)/ 1319 @cp -f $(objtree)/modules.order $(MODLIB)/
1306 @cp -f $(objtree)/modules.builtin $(MODLIB)/ 1320 @cp -f $(objtree)/modules.builtin $(MODLIB)/
1321 @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
1307 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1322 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1308 1323
1309# This depmod is only for convenience to give the initial 1324# This depmod is only for convenience to give the initial
@@ -1344,10 +1359,11 @@ endif # CONFIG_MODULES
1344 1359
1345# Directories & files removed with 'make clean' 1360# Directories & files removed with 'make clean'
1346CLEAN_DIRS += $(MODVERDIR) include/ksym 1361CLEAN_DIRS += $(MODVERDIR) include/ksym
1362CLEAN_FILES += modules.builtin.modinfo
1347 1363
1348# Directories & files removed with 'make mrproper' 1364# Directories & files removed with 'make mrproper'
1349MRPROPER_DIRS += include/config usr/include include/generated \ 1365MRPROPER_DIRS += include/config usr/include include/generated \
1350 arch/*/include/generated .tmp_objdiff 1366 arch/$(SRCARCH)/include/generated .tmp_objdiff
1351MRPROPER_FILES += .config .config.old .version \ 1367MRPROPER_FILES += .config .config.old .version \
1352 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ 1368 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
1353 signing_key.pem signing_key.priv signing_key.x509 \ 1369 signing_key.pem signing_key.priv signing_key.x509 \
@@ -1358,7 +1374,7 @@ MRPROPER_FILES += .config .config.old .version \
1358# 1374#
1359clean: rm-dirs := $(CLEAN_DIRS) 1375clean: rm-dirs := $(CLEAN_DIRS)
1360clean: rm-files := $(CLEAN_FILES) 1376clean: rm-files := $(CLEAN_FILES)
1361clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples) 1377clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs))
1362 1378
1363PHONY += $(clean-dirs) clean archclean vmlinuxclean 1379PHONY += $(clean-dirs) clean archclean vmlinuxclean
1364$(clean-dirs): 1380$(clean-dirs):
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index d4012d6c0dcb..5ca4c5fd627a 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1449,7 +1449,6 @@ static void __exit omap_system_dma_exit(void)
1449 1449
1450MODULE_DESCRIPTION("OMAP SYSTEM DMA DRIVER"); 1450MODULE_DESCRIPTION("OMAP SYSTEM DMA DRIVER");
1451MODULE_LICENSE("GPL"); 1451MODULE_LICENSE("GPL");
1452MODULE_ALIAS("platform:" DRIVER_NAME);
1453MODULE_AUTHOR("Texas Instruments Inc"); 1452MODULE_AUTHOR("Texas Instruments Inc");
1454 1453
1455/* 1454/*
diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index ee8ec5a8cb16..e40b55a7086f 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -970,5 +970,4 @@ module_platform_driver(omap_dm_timer_driver);
970 970
971MODULE_DESCRIPTION("OMAP Dual-Mode Timer Driver"); 971MODULE_DESCRIPTION("OMAP Dual-Mode Timer Driver");
972MODULE_LICENSE("GPL"); 972MODULE_LICENSE("GPL");
973MODULE_ALIAS("platform:" DRIVER_NAME);
974MODULE_AUTHOR("Texas Instruments Inc"); 973MODULE_AUTHOR("Texas Instruments Inc");
diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
index 90161dec6fa5..91ae4eb0e913 100644
--- a/drivers/memory/Makefile
+++ b/drivers/memory/Makefile
@@ -28,6 +28,9 @@ ti-emif-sram-objs := ti-emif-pm.o ti-emif-sram-pm.o
28 28
29AFLAGS_ti-emif-sram-pm.o :=-Wa,-march=armv7-a 29AFLAGS_ti-emif-sram-pm.o :=-Wa,-march=armv7-a
30 30
31include drivers/memory/Makefile.asm-offsets
32
33drivers/memory/ti-emif-sram-pm.o: include/generated/ti-emif-asm-offsets.h 31drivers/memory/ti-emif-sram-pm.o: include/generated/ti-emif-asm-offsets.h
32
33include/generated/ti-emif-asm-offsets.h: drivers/memory/emif-asm-offsets.s FORCE
34 $(call filechk,offsets,__TI_EMIF_ASM_OFFSETS_H__)
35
36targets += emif-asm-offsets.s
diff --git a/drivers/memory/Makefile.asm-offsets b/drivers/memory/Makefile.asm-offsets
deleted file mode 100644
index 0447e174c752..000000000000
--- a/drivers/memory/Makefile.asm-offsets
+++ /dev/null
@@ -1,4 +0,0 @@
1include/generated/ti-emif-asm-offsets.h: drivers/memory/emif-asm-offsets.s FORCE
2 $(call filechk,offsets,__TI_EMIF_ASM_OFFSETS_H__)
3
4targets += emif-asm-offsets.s
diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index 446713dbee27..93177d85e7a9 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -459,7 +459,6 @@ EXPORT_SYMBOL_GPL(omap_tll_disable);
459 459
460MODULE_AUTHOR("Keshava Munegowda <keshava_mgowda@ti.com>"); 460MODULE_AUTHOR("Keshava Munegowda <keshava_mgowda@ti.com>");
461MODULE_AUTHOR("Roger Quadros <rogerq@ti.com>"); 461MODULE_AUTHOR("Roger Quadros <rogerq@ti.com>");
462MODULE_ALIAS("platform:" USBHS_DRIVER_NAME);
463MODULE_LICENSE("GPL v2"); 462MODULE_LICENSE("GPL v2");
464MODULE_DESCRIPTION("usb tll driver for TI OMAP EHCI and OHCI controllers"); 463MODULE_DESCRIPTION("usb tll driver for TI OMAP EHCI and OHCI controllers");
465 464
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f8f6f04c4453..bbb9e332f2fe 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -844,6 +844,7 @@
844 EXIT_CALL \ 844 EXIT_CALL \
845 *(.discard) \ 845 *(.discard) \
846 *(.discard.*) \ 846 *(.discard.*) \
847 *(.modinfo) \
847 } 848 }
848 849
849/** 850/**
diff --git a/include/linux/module.h b/include/linux/module.h
index 7dc4dc79b634..484b5cbb3410 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -253,6 +253,7 @@ extern typeof(name) __mod_##type##__##name##_device_table \
253#define MODULE_VERSION(_version) MODULE_INFO(version, _version) 253#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
254#else 254#else
255#define MODULE_VERSION(_version) \ 255#define MODULE_VERSION(_version) \
256 MODULE_INFO(version, _version); \
256 static struct module_version_attribute ___modver_attr = { \ 257 static struct module_version_attribute ___modver_attr = { \
257 .mattr = { \ 258 .mattr = { \
258 .attr = { \ 259 .attr = { \
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index ba36506db4fb..5ba250d9172a 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -10,23 +10,21 @@
10 module name. */ 10 module name. */
11#ifdef MODULE 11#ifdef MODULE
12#define MODULE_PARAM_PREFIX /* empty */ 12#define MODULE_PARAM_PREFIX /* empty */
13#define __MODULE_INFO_PREFIX /* empty */
13#else 14#else
14#define MODULE_PARAM_PREFIX KBUILD_MODNAME "." 15#define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
16/* We cannot use MODULE_PARAM_PREFIX because some modules override it. */
17#define __MODULE_INFO_PREFIX KBUILD_MODNAME "."
15#endif 18#endif
16 19
17/* Chosen so that structs with an unsigned long line up. */ 20/* Chosen so that structs with an unsigned long line up. */
18#define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) 21#define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long))
19 22
20#ifdef MODULE
21#define __MODULE_INFO(tag, name, info) \ 23#define __MODULE_INFO(tag, name, info) \
22static const char __UNIQUE_ID(name)[] \ 24static const char __UNIQUE_ID(name)[] \
23 __used __attribute__((section(".modinfo"), unused, aligned(1))) \ 25 __used __attribute__((section(".modinfo"), unused, aligned(1))) \
24 = __stringify(tag) "=" info 26 = __MODULE_INFO_PREFIX __stringify(tag) "=" info
25#else /* !MODULE */ 27
26/* This struct is here for syntactic coherency, it is not used */
27#define __MODULE_INFO(tag, name, info) \
28 struct __UNIQUE_ID(name) {}
29#endif
30#define __MODULE_PARM_TYPE(name, _type) \ 28#define __MODULE_PARM_TYPE(name, _type) \
31 __MODULE_INFO(parmtype, name##type, #name ":" _type) 29 __MODULE_INFO(parmtype, name##type, #name ":" _type)
32 30
diff --git a/samples/Kconfig b/samples/Kconfig
index 30a89425009c..0561a94f6fdb 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -20,8 +20,7 @@ config SAMPLE_TRACE_PRINTK
20 test various trace_printk() calls from a module. 20 test various trace_printk() calls from a module.
21 21
22config SAMPLE_KOBJECT 22config SAMPLE_KOBJECT
23 tristate "Build kobject examples -- loadable modules only" 23 tristate "Build kobject examples"
24 depends on m
25 help 24 help
26 This config option will allow you to build a number of 25 This config option will allow you to build a number of
27 different kobject sample modules showing how to use kobjects, 26 different kobject sample modules showing how to use kobjects,
@@ -103,8 +102,8 @@ config SAMPLE_CONNECTOR
103 See also Documentation/connector/connector.txt 102 See also Documentation/connector/connector.txt
104 103
105config SAMPLE_SECCOMP 104config SAMPLE_SECCOMP
106 tristate "Build seccomp sample code -- loadable modules only" 105 bool "Build seccomp sample code"
107 depends on SECCOMP_FILTER && m 106 depends on SECCOMP_FILTER
108 help 107 help
109 Build samples of seccomp filters using various methods of 108 Build samples of seccomp filters using various methods of
110 BPF filter construction. 109 BPF filter construction.
diff --git a/samples/Makefile b/samples/Makefile
index 2484cc262d3e..8e096e0d45d1 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -1,6 +1,6 @@
1# Makefile for Linux samples code 1# Makefile for Linux samples code
2 2
3obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \ 3obj-y += kobject/ kprobes/ trace_events/ livepatch/ \
4 hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \ 4 hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \
5 configfs/ connector/ v4l/ trace_printk/ \ 5 configfs/ connector/ v4l/ trace_printk/ \
6 vfio-mdev/ vfs/ qmi/ binderfs/ pidfd/ 6 vfio-mdev/ vfs/ qmi/ binderfs/ pidfd/
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index fb43a814d4c0..00e0b5e90bd0 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -40,5 +40,5 @@ HOSTLDLIBS_bpf-fancy += $(MFLAG)
40HOSTLDLIBS_dropper += $(MFLAG) 40HOSTLDLIBS_dropper += $(MFLAG)
41HOSTLDLIBS_user-trap += $(MFLAG) 41HOSTLDLIBS_user-trap += $(MFLAG)
42endif 42endif
43always := $(hostprogs-m) 43always := $(hostprogs-y)
44endif 44endif
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 0c5969fa795f..ae9cf740633e 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -504,7 +504,7 @@ existing-targets := $(wildcard $(sort $(targets)))
504 504
505-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) 505-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
506 506
507ifneq ($(KBUILD_SRC),) 507ifneq ($(srctree),.)
508# Create directories for object files if they do not exist 508# Create directories for object files if they do not exist
509obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets)))) 509obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets))))
510# If targets exist, their directories apparently exist. Skip mkdir. 510# If targets exist, their directories apparently exist. Skip mkdir.
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index a115259b57e7..73b804197fca 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -71,7 +71,7 @@ __hostc_flags = $(_hostc_flags)
71__hostcxx_flags = $(_hostcxx_flags) 71__hostcxx_flags = $(_hostcxx_flags)
72 72
73ifeq ($(KBUILD_EXTMOD),) 73ifeq ($(KBUILD_EXTMOD),)
74ifneq ($(KBUILD_SRC),) 74ifneq ($(srctree),.)
75__hostc_flags = -I$(obj) $(call flags,_hostc_flags) 75__hostc_flags = -I$(obj) $(call flags,_hostc_flags)
76__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) 76__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags)
77endif 77endif
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8a1f64f17740..41e98fa66b91 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -144,7 +144,7 @@ __cpp_flags = $(_cpp_flags)
144# If building the kernel in a separate objtree expand all occurrences 144# If building the kernel in a separate objtree expand all occurrences
145# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). 145# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
146ifeq ($(KBUILD_EXTMOD),) 146ifeq ($(KBUILD_EXTMOD),)
147ifneq ($(KBUILD_SRC),) 147ifneq ($(srctree),.)
148 148
149# -I$(obj) locates generated .h files 149# -I$(obj) locates generated .h files
150# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files 150# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin
index a072a4267746..ea90a90b41a0 100644
--- a/scripts/Makefile.modbuiltin
+++ b/scripts/Makefile.modbuiltin
@@ -15,7 +15,7 @@ include include/config/tristate.conf
15 15
16include scripts/Kbuild.include 16include scripts/Kbuild.include
17 17
18ifneq ($(KBUILD_SRC),) 18ifneq ($(srctree),.)
19# Create output directory if not already present 19# Create output directory if not already present
20_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) 20_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
21endif 21endif
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 6b7f354f189a..fec6ec2ffa47 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -78,7 +78,7 @@ modpost = scripts/mod/modpost \
78 $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \ 78 $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \
79 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ 79 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
80 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ 80 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
81 $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) 81 $(if $(KBUILD_MODPOST_WARN),-w)
82 82
83MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS))) 83MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS)))
84 84
diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile
index 3df395a9c2ce..9fd3d8ed731a 100644
--- a/scripts/gdb/linux/Makefile
+++ b/scripts/gdb/linux/Makefile
@@ -1,6 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2 2
3ifneq ($(KBUILD_SRC),) 3ifneq ($(srctree),.)
4 4
5symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py)) 5symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))
6 6
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index e3c06b9482a2..a7124f895b24 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -212,6 +212,9 @@ modpost_link vmlinux.o
212# modpost vmlinux.o to check for section mismatches 212# modpost vmlinux.o to check for section mismatches
213${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o 213${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o
214 214
215info MODINFO modules.builtin.modinfo
216${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo
217
215kallsymso="" 218kallsymso=""
216kallsyms_vmlinux="" 219kallsyms_vmlinux=""
217if [ -n "${CONFIG_KALLSYMS}" ]; then 220if [ -n "${CONFIG_KALLSYMS}" ]; then
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 412f13fdff52..4d0faebb1719 100755
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -7,33 +7,11 @@
7# Usage 7# Usage
8# $1 - Kernel src directory 8# $1 - Kernel src directory
9 9
10# Only overwrite automatically generated Makefiles
11# (so we do not overwrite kernel Makefile)
12if test -e Makefile && ! grep -q Automatically Makefile
13then
14 exit 0
15fi
16if [ "${quiet}" != "silent_" ]; then 10if [ "${quiet}" != "silent_" ]; then
17 echo " GEN Makefile" 11 echo " GEN Makefile"
18fi 12fi
19 13
20cat << EOF > Makefile 14cat << EOF > Makefile
21# Automatically generated by $0: don't edit 15# Automatically generated by $(realpath $0): don't edit
22 16include $(realpath $1/Makefile)
23ifeq ("\$(origin V)", "command line")
24VERBOSE := \$(V)
25endif
26ifneq (\$(VERBOSE),1)
27Q := @
28endif
29
30MAKEFLAGS += --no-print-directory
31
32.PHONY: __sub-make \$(MAKECMDGOALS)
33
34__sub-make:
35 \$(Q)\$(MAKE) -C $1 O=\$(CURDIR) \$(MAKECMDGOALS)
36
37\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
38 @:
39EOF 17EOF
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index f71666899245..d24759214efd 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -496,7 +496,7 @@ sub update_funcs
496# 496#
497# Step 2: find the sections and mcount call sites 497# Step 2: find the sections and mcount call sites
498# 498#
499open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump"; 499open(IN, "LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";
500 500
501my $text; 501my $text;
502 502
diff --git a/scripts/tags.sh b/scripts/tags.sh
index f470d9919ed7..70e14c67bde7 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -19,7 +19,7 @@ ignore="$ignore ( -name *.mod.c ) -prune -o"
19# Do not use full path if we do not use O=.. builds 19# Do not use full path if we do not use O=.. builds
20# Use make O=. {tags|cscope} 20# Use make O=. {tags|cscope}
21# to force full paths for a non-O= build 21# to force full paths for a non-O= build
22if [ "${KBUILD_SRC}" = "" ]; then 22if [ "${srctree}" = "." -o -z "${srctree}" ]; then
23 tree= 23 tree=
24else 24else
25 tree=${srctree}/ 25 tree=${srctree}/