From 6885573d3d2102e0b0492e1d9fee9028cf605721 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 4 Nov 2025 14:00:58 -0600 Subject: [PATCH] linuxkm/Kbuild: add helper variable EXPORT_SYMBOL to facilitate export attribute control. --- linuxkm/Kbuild | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linuxkm/Kbuild b/linuxkm/Kbuild index 16c6d6b40..76a13464b 100644 --- a/linuxkm/Kbuild +++ b/linuxkm/Kbuild @@ -308,6 +308,7 @@ endif # auto-generate the exported symbol list, leveraging the WOLFSSL_API visibility tags. # exclude symbols that don't match wc_* or wolf*. +EXPORT_SYMBOL := EXPORT_SYMBOL_NS_GPL $(obj)/linuxkm/module_exports.c: $(src)/module_exports.c.template $(WOLFSSL_OBJ_TARGETS) $(obj)/linuxkm/module_hooks.o @$(RENAME_PIE_TEXT_AND_DATA_SECTIONS) @cp $< $@ || exit $$? @@ -321,9 +322,9 @@ $(obj)/linuxkm/module_exports.c: $(src)/module_exports.c.template $(WOLFSSL_OBJ_ $(AWK) '/^ *[0-9]+: / { if ($$8 !~ /^(wc_|wolf|WOLF|TLSX_)/){next;} if (($$4 == "FUNC") && ($$5 == "GLOBAL") && ($$6 == "DEFAULT")) { - print "EXPORT_SYMBOL_NS_GPL(" $$8 ", '"$$ns"');"; + print "$(EXPORT_SYMBOL)(" $$8 ", '"$$ns"');"; } }' >> $@ || exit $$? - echo -e "#ifndef NO_CRYPT_TEST\nEXPORT_SYMBOL_NS_GPL(wolfcrypt_test, $${ns});\n#endif" >> $@ + echo -e "#ifndef NO_CRYPT_TEST\n$(EXPORT_SYMBOL)(wolfcrypt_test, $${ns});\n#endif" >> $@ clean-files := linuxkm src wolfcrypt