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

20241210-fixes #8272

Merged
merged 1 commit into from
Dec 10, 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
4 changes: 3 additions & 1 deletion cmake/options.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

/* cmake template for options.h */

#ifndef WOLFSSL_OPTIONS_H
#ifdef WOLFSSL_NO_OPTIONS_H
/* options.h inhibited by configuration */
#elif !defined(WOLFSSL_OPTIONS_H)
#define WOLFSSL_OPTIONS_H


Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10169,7 +10169,9 @@ echo " *" >> $OPTION_FILE
echo " */" >> $OPTION_FILE

echo "" >> $OPTION_FILE
echo "#ifndef WOLFSSL_OPTIONS_H" >> $OPTION_FILE
echo "#ifdef WOLFSSL_NO_OPTIONS_H" >> $OPTION_FILE
echo "/* options.h inhibited by configuration */" >> $OPTION_FILE
echo "#elif !defined(WOLFSSL_OPTIONS_H)" >> $OPTION_FILE
echo "#define WOLFSSL_OPTIONS_H" >> $OPTION_FILE
echo "" >> $OPTION_FILE
echo "" >> $OPTION_FILE
Expand Down
4 changes: 2 additions & 2 deletions linuxkm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endif
ccflags-y := $(WOLFSSL_CFLAGS) $(WOLFSSL_CFLAGS_NO_VECTOR_INSNS)

$(obj)/libwolfssl.mod.o: ccflags-y :=
$(obj)/wolfcrypt/test/test.o: ccflags-y += -DNO_MAIN_DRIVER
$(obj)/wolfcrypt/test/test.o: ccflags-y += -DNO_MAIN_DRIVER -DWOLFSSL_NO_OPTIONS_H

$(obj)/wolfcrypt/src/aes.o: ccflags-y = $(WOLFSSL_CFLAGS) $(WOLFSSL_CFLAGS_YES_VECTOR_INSNS)

Expand All @@ -109,7 +109,7 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes"
$(obj)/linuxkm/module_hooks.o: ccflags-y += $(PIE_SUPPORT_FLAGS)
endif

$(obj)/wolfcrypt/benchmark/benchmark.o: ccflags-y = $(WOLFSSL_CFLAGS) $(CFLAGS_FPU_ENABLE) $(CFLAGS_SIMD_ENABLE) $(PIE_SUPPORT_FLAGS) -DNO_MAIN_FUNCTION
$(obj)/wolfcrypt/benchmark/benchmark.o: ccflags-y = $(WOLFSSL_CFLAGS) $(CFLAGS_FPU_ENABLE) $(CFLAGS_SIMD_ENABLE) $(PIE_SUPPORT_FLAGS) -DNO_MAIN_FUNCTION -DWOLFSSL_NO_OPTIONS_H
$(obj)/wolfcrypt/benchmark/benchmark.o: asflags-y = $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPU_ENABLE_SIMD_DISABLE)

asflags-y := $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPUSIMD_DISABLE)
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/benchmark/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#include <config.h>
#endif

#ifndef WOLFSSL_USER_SETTINGS
#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H)
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h> /* also picks up user_settings.h */
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <config.h>
#endif

#ifndef WOLFSSL_USER_SETTINGS
#if !defined(WOLFSSL_USER_SETTINGS) && !defined(WOLFSSL_NO_OPTIONS_H)
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
Expand Down
4 changes: 3 additions & 1 deletion wolfssl/options.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

/* default blank options for autoconf */

#ifndef WOLFSSL_OPTIONS_H
#ifdef WOLFSSL_NO_OPTIONS_H
/* options.h inhibited by configuration */
#elif !defined(WOLFSSL_OPTIONS_H)
#define WOLFSSL_OPTIONS_H


Expand Down
24 changes: 15 additions & 9 deletions wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@
extern "C" {
#endif

/* This flag allows wolfSSL to include options.h instead of having client
* projects do it themselves. This should *NEVER* be defined when building
* wolfSSL as it can cause hard to debug problems. */
#if defined(EXTERNAL_OPTS_OPENVPN) || defined(WOLFSSL_USE_OPTIONS_H)
#include <wolfssl/options.h>
/* WOLFSSL_USE_OPTIONS_H directs wolfSSL to include options.h on behalf of
* application code, rather than the application including it directly. This is
* not defined when compiling wolfSSL library objects, which are configured
* through CFLAGS.
*/
#if (defined(EXTERNAL_OPTS_OPENVPN) || defined(WOLFSSL_USE_OPTIONS_H)) && \
!defined(WOLFSSL_NO_OPTIONS_H)
#include <wolfssl/options.h>
#endif

/* Uncomment next line if using IPHONE */
Expand Down Expand Up @@ -335,10 +338,13 @@
#include "nucleus.h"
#include "os/networking/ssl/lite/cyassl_nucleus_defs.h"
#elif !defined(BUILDING_WOLFSSL) && !defined(WOLFSSL_OPTIONS_H) && \
!defined(WOLFSSL_CUSTOM_CONFIG)
/* This warning indicates that the settings header may not be included before
* other wolfSSL headers. If you are using a custom configuration method,
* define WOLFSSL_CUSTOM_CONFIG to override this error. */
!defined(WOLFSSL_NO_OPTIONS_H) && !defined(WOLFSSL_CUSTOM_CONFIG)
/* This warning indicates that wolfSSL features may not have been properly
* configured before other wolfSSL headers were included. If you are using
* an alternative configuration method -- e.g. custom header, or CFLAGS in
* an application build -- then your application can avoid this warning by
* defining WOLFSSL_NO_OPTIONS_H or WOLFSSL_CUSTOM_CONFIG as appropriate.
*/
#warning "No configuration for wolfSSL detected, check header order"
#endif

Expand Down