Skip to content

Commit

Permalink
Merge pull request wolfSSL#8295 from douzzer/20241216-linuxkm-export-…
Browse files Browse the repository at this point in the history
…ns-quotes

20241216-linuxkm-export-ns-quotes
  • Loading branch information
philljj authored Dec 16, 2024
2 parents e3876fc + 6fbc18f commit c5c607b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
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
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

#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

0 comments on commit c5c607b

Please sign in to comment.