Skip to content

Commit 96d97f2

Browse files
committed
kbuild: fix $(src) assignmnet with external modules
When we introduced support for KBUILD_EXTRA_SYMBOLS we started to include the externam module's kbuild file when doing the final modpost step. As external modules often do: ccflags-y := -I$(src) We had problems because $(src) was unassinged and gcc then used the next parameter for -I resulting in strange build failures. Fix is to assign $(src) and $(obj) when building external modules. This fixes: http://bugzilla.kernel.org/show_bug.cgi?id=10798 Signed-off-by: Sam Ravnborg <[email protected]> Cc: Tvrtko <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]>
1 parent 7353190 commit 96d97f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/Makefile.modpost

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ _modpost: __modpost
4343
include include/config/auto.conf
4444
include scripts/Kbuild.include
4545

46+
# When building external modules load the Kbuild file to retreive EXTRA_SYMBOLS info
4647
ifneq ($(KBUILD_EXTMOD),)
48+
49+
# set src + obj - they may be used when building the .mod.c file
50+
obj := $(KBUILD_EXTMOD)
51+
src := $(obj)
52+
4753
# Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS
4854
include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
4955
$(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)

0 commit comments

Comments
 (0)