aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/Makefile.modpost11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 4b2721ca97da..6c5469b1473b 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -32,6 +32,10 @@
32# Step 4 is solely used to allow module versioning in external modules, 32# Step 4 is solely used to allow module versioning in external modules,
33# where the CRC of each module is retrieved from the Module.symers file. 33# where the CRC of each module is retrieved from the Module.symers file.
34 34
35# KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
36# symbols in the final module linking stage
37# KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
38# This is solely usefull to speed up test compiles
35PHONY := _modpost 39PHONY := _modpost
36_modpost: __modpost 40_modpost: __modpost
37 41
@@ -46,7 +50,8 @@ modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
46__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 50__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
47modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) 51modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
48 52
49_modpost: $(modules) 53# Stop after building .o files if NOFINAL is set. Makes compile tests quicker
54_modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))
50 55
51 56
52# Step 2), invoke modpost 57# Step 2), invoke modpost
@@ -58,7 +63,7 @@ quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
58 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ 63 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
59 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ 64 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
60 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ 65 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
61 $(if $(KBUILD_EXTMOD),-w) \ 66 $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
62 $(wildcard vmlinux) $(filter-out FORCE,$^) 67 $(wildcard vmlinux) $(filter-out FORCE,$^)
63 68
64PHONY += __modpost 69PHONY += __modpost
@@ -92,7 +97,7 @@ targets += $(modules:.ko=.mod.o)
92 97
93# Step 6), final link of the modules 98# Step 6), final link of the modules
94quiet_cmd_ld_ko_o = LD [M] $@ 99quiet_cmd_ld_ko_o = LD [M] $@
95 cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \ 100 cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
96 $(filter-out FORCE,$^) 101 $(filter-out FORCE,$^)
97 102
98$(modules): %.ko :%.o %.mod.o FORCE 103$(modules): %.ko :%.o %.mod.o FORCE