[ovs-dev] [PATCH] kbuild: Include external modules compile flags

Greg Rose gvrose8192 at gmail.com
Mon Jan 27 21:50:06 UTC 2020


Since this commit:
'commit 9b9a3f20cbe0 ("kbuild: split final module linking out into Makefile.modfinal")'
at least one out-of-tree external kernel module build fails
during the modfinal make phase because Makefile.modfinal does
not include the ccflags-y variable from the exernal module's Kbuild.
Make sure to include the external kernel module's Kbuild so that the
necessary command line flags from the external module are set.

Reported-by: David Ahern <dsahern at gmail.com>
CC: Masahiro Yamada <yamada.masahiro at socionext.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
---
 scripts/Makefile.modfinal | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
index 411c1e60..a645ba6 100644
--- a/scripts/Makefile.modfinal
+++ b/scripts/Makefile.modfinal
@@ -21,6 +21,10 @@ __modfinal: $(modules)
 modname = $(notdir $(@:.mod.o=))
 part-of-module = y
 
+# Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS
+include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
+             $(KBUILD_EXTMOD)/Kbuild)
+
 quiet_cmd_cc_o_c = CC [M]  $@
       cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
 
-- 
1.8.3.1



More information about the dev mailing list