Merge pull request #8295 from douzzer/20241216-linuxkm-export-ns-quotes

20241216-linuxkm-export-ns-quotes
This commit is contained in:
philljj
2024-12-16 12:37:21 -06:00
committed by GitHub
2 changed files with 12 additions and 6 deletions

View File

@ -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
READELF := readelf
endif
ifeq "$(ENABLED_LINUXKM_PIE)" "yes"
rename-pie-text-and-data-sections: $(WOLFSSL_OBJ_TARGETS)
@ -145,10 +149,6 @@ ifndef NM
NM := nm
endif
ifndef READELF
READELF := readelf
endif
ifndef OBJCOPY
OBJCOPY := objcopy
endif
@ -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

View File

@ -47,6 +47,12 @@
#define EXPORT_SYMBOL_NS_GPL(sym, ns) EXPORT_SYMBOL_GPL(sym)
#endif
#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>