Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20241216-linuxkm-export-ns-quotes #8295

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions linuxkm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ $(obj)/wolfcrypt/src/poly1305_asm.o: asflags-y = $(WOLFSSL_ASFLAGS) $(ASFLAGS_FP
$(obj)/wolfcrypt/src/poly1305_asm.o: OBJECT_FILES_NON_STANDARD := y
$(obj)/wolfcrypt/src/wc_kyber_asm.o: asflags-y = $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPU_DISABLE_SIMD_ENABLE)

ifndef READELF
philljj marked this conversation as resolved.
Show resolved Hide resolved
READELF := readelf
endif

ifeq "$(ENABLED_LINUXKM_PIE)" "yes"

rename-pie-text-and-data-sections: $(WOLFSSL_OBJ_TARGETS)
Expand All @@ -145,10 +149,6 @@ ifndef NM
NM := nm
endif

ifndef READELF
READELF := readelf
endif

ifndef OBJCOPY
OBJCOPY := objcopy
endif
Expand Down Expand Up @@ -197,9 +197,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 ", WOLFSSL);"; \
print "EXPORT_SYMBOL_NS_GPL(" $$8 ", EXPORT_SYMBOL_NS_Q(WOLFSSL));";\
} \
}' >> $@
@echo -e '#ifndef NO_CRYPT_TEST\nEXPORT_SYMBOL_NS_GPL(wolfcrypt_test, WOLFSSL);\n#endif' >> $@
@echo -e '#ifndef NO_CRYPT_TEST\nEXPORT_SYMBOL_NS_GPL(wolfcrypt_test, EXPORT_SYMBOL_NS_Q(WOLFSSL));\n#endif' >> $@

clean-files := linuxkm src wolfcrypt
6 changes: 6 additions & 0 deletions linuxkm/module_exports.c.template
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
#define EXPORT_SYMBOL_NS_GPL(sym, ns) EXPORT_SYMBOL_GPL(sym)
#endif

philljj marked this conversation as resolved.
Show resolved Hide resolved
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
#define EXPORT_SYMBOL_NS_Q(x) #x
#else
#define EXPORT_SYMBOL_NS_Q(x) x
#endif

#include <wolfssl/wolfcrypt/memory.h>
#include <wolfssl/wolfcrypt/wc_port.h>
#include <wolfssl/wolfcrypt/logging.h>
Expand Down