linuxkm: configure.ac more incompatible options: --enable-fastmath, --enable-iopool, and --enable-fips; linuxkm/Makefile: reduce -Wframe-larger-than from 65536 to kernel-compatible 5000; wolfssl/wolfcrypt/settings.h: unset HAVE_THREAD_LS when WOLFSSL_LINUXKM; wolfssl/wolfcrypt/types.h: when NO_INLINE and __GNUC__, #define WC_INLINE __attribute__((unused)) rather than to nothing to avoid -Wunused-function warnings; wolfssl/wolfcrypt/wc_port.h: #undef noinline after Linux kernel header includes (another macro conflict).

This commit is contained in:
Daniel Pouzzner
2020-08-20 11:42:34 -05:00
parent 03d5a4eadd
commit 836915d05f
5 changed files with 23 additions and 6 deletions

View File

@ -5321,6 +5321,16 @@ if test "x$ENABLED_LINUXKM" = "xyes"; then
if test "$ENABLED_VALGRIND" = "yes"; then
AC_MSG_ERROR([--enable-valgrind is incompatible with --enable-linuxkm.])
fi
if test "$ENABLED_FASTMATH" = "yes"; then
AC_MSG_ERROR([--enable-fastmath is incompatible with --enable-linuxkm (conflicts with stack size limits).])
fi
if test "$ENABLED_IOPOOL" = "yes"; then
AC_MSG_ERROR([--enable-iopool is incompatible with --enable-linuxkm.])
fi
#FIPS currently depends on thread-local storage
if test "$ENABLED_FIPS" = "yes"; then
AC_MSG_ERROR([--enable-fips is incompatible with --enable-linuxkm.])
fi
if test "$ENABLED_EXAMPLES" = "yes"; then
AC_MSG_NOTICE([--enable-examples is incompatible with --enable-linuxkm (forcing to no).])
ENABLED_EXAMPLES=no

View File

@ -22,7 +22,7 @@ ifeq "$(src_libwolfssl_la_OBJECTS)" ""
$(error $$src_libwolfssl_la_OBJECTS is unset.)
endif
WOLFSSL_CFLAGS=-DHAVE_CONFIG_H -I$(SRC_TOP) -DBUILDING_WOLFSSL $(AM_CFLAGS) $(CFLAGS) -Wframe-larger-than=65536 -mpreferred-stack-boundary=4
WOLFSSL_CFLAGS=-DHAVE_CONFIG_H -I$(SRC_TOP) -DBUILDING_WOLFSSL $(AM_CFLAGS) $(CFLAGS) -Wframe-larger-than=5000 -mpreferred-stack-boundary=4
WOLFSSL_ASFLAGS=-DHAVE_CONFIG_H -I$(SRC_TOP) -DBUILDING_WOLFSSL $(AM_CCASFLAGS) $(CCASFLAGS)
WOLFSSL_OBJ_FILES=linuxkm/module_hooks.o $(patsubst %.lo, %.o, $(patsubst src/src_libwolfssl_la-%, src/%, $(patsubst src/libwolfssl_la-%, src/%, $(patsubst wolfcrypt/src/src_libwolfssl_la-%, wolfcrypt/src/%, $(src_libwolfssl_la_OBJECTS)))))
@ -31,8 +31,8 @@ export WOLFSSL_CFLAGS WOLFSSL_ASFLAGS WOLFSSL_OBJ_FILES
libwolfssl.ko:
@mkdir -p linuxkm src wolfcrypt/src
@if [[ ! -h $(SRC_TOP)/Kbuild ]]; then ln -s $(MODULE_TOP)/Kbuild $(SRC_TOP)/Kbuild; fi
make -C $(KROOT) M=$(MODULE_TOP) src=$(SRC_TOP)
@if test ! -h $(SRC_TOP)/Kbuild; then ln -s $(MODULE_TOP)/Kbuild $(SRC_TOP)/Kbuild; fi
+make -C $(KROOT) M=$(MODULE_TOP) src=$(SRC_TOP)
.PHONY: clean

View File

@ -2089,6 +2089,8 @@ extern void uITRON4_free(void *p) ;
#define NO_DEV_RANDOM
#define NO_WRITEV
#define NO_FILESYSTEM
#define NO_CRYPT_BENCHMARK 1
#define NO_CRYPT_TEST 1
#define SIZEOF_LONG 8
#define SIZEOF_LONG_LONG 8
#define CHAR_BIT 8
@ -2096,14 +2098,13 @@ extern void uITRON4_free(void *p) ;
/* tweak the autotools-detected feature set to accommodate switch from user to kernel space: */
#undef HAVE_STRINGS_H
#undef HAVE_ERRNO_H
#undef HAVE_THREAD_LS
#undef WOLFSSL_HAVE_MIN
#undef WOLFSSL_HAVE_MAX
#define WOLFSSL_DH_CONST 1 /* Linux kernel doesn't have floating point math facilities. */
#define WOLFSSL_NO_SOCK 1
#define WOLFSSL_USER_IO 1
#define USE_WOLF_STRTOK
#define NO_CRYPT_BENCHMARK 1
#define NO_CRYPT_TEST 1
#endif

View File

@ -201,10 +201,14 @@ decouple library dependencies with standard string, memory and so on.
#else
#define WC_INLINE
#endif
#else
#ifdef __GNUC__
#define WC_INLINE __attribute__((unused))
#else
#define WC_INLINE
#endif
#endif
#endif
#if defined(HAVE_FIPS) || defined(HAVE_SELFTEST)
#define INLINE WC_INLINE

View File

@ -95,6 +95,8 @@
*/
#undef current
#undef noinline
/* prevent gcc's mm_malloc.h from being included, since it unconditionally includes stdlib.h, which is kernel-incompatible: */
#define _MM_MALLOC_H_INCLUDED