From 15c890179fad5a5dd2fd2850499ff3fceaa14e5e Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Fri, 9 Jul 2021 15:23:07 -0500 Subject: [PATCH] Linux kernel module: add an explicit -ffreestanding to CFLAGS in linuxkm/Makefile, and in wc_port.h ifdef WOLFSSL_LINUXKM, ignore -Wtype-limits in Linux kernel header files (needed for kernel v5.13), and suppress inclusion of stdint-gcc.h. --- linuxkm/Makefile | 2 +- wolfssl/wolfcrypt/wc_port.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/linuxkm/Makefile b/linuxkm/Makefile index c0b5aaf09..852e28310 100644 --- a/linuxkm/Makefile +++ b/linuxkm/Makefile @@ -33,7 +33,7 @@ ifndef SRC_TOP SRC_TOP=$(shell dirname $(MODULE_TOP)) endif -WOLFSSL_CFLAGS=-DHAVE_CONFIG_H -I$(SRC_TOP) -DBUILDING_WOLFSSL $(AM_CFLAGS) $(CFLAGS) -Wno-declaration-after-statement -Wno-redundant-decls +WOLFSSL_CFLAGS=-DHAVE_CONFIG_H -I$(SRC_TOP) -DBUILDING_WOLFSSL $(AM_CFLAGS) $(CFLAGS) -Wno-declaration-after-statement -Wno-redundant-decls -ffreestanding ifdef KERNEL_EXTRA_CFLAGS WOLFSSL_CFLAGS += $(KERNEL_EXTRA_CFLAGS) endif diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index d4d2c17ba..ca71bf7d9 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -82,6 +82,10 @@ _Pragma("GCC diagnostic ignored \"-Wpointer-sign\""); _Pragma("GCC diagnostic ignored \"-Wbad-function-cast\""); _Pragma("GCC diagnostic ignored \"-Wdiscarded-qualifiers\""); + _Pragma("GCC diagnostic ignored \"-Wtype-limits\""); + + /* suppress inclusion of stdint-gcc.h to avoid conflicts with Linux native include/linux/types.h: */ + #define _GCC_STDINT_H #include #include