Add option --enable-baremetal and WOLFSSL_BAREMETAL macro
#9460
+199
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds
--enable-baremetalconfigure option andWOLFSSL_BAREMETALmacro to simplify configuration for bare-metal embedded systems. This option encapsulates commonly-used defines for bare-metal environments into a single flag.The
WOLFSSL_BAREMETALmacro defines:SINGLE_THREADED- No threading supportNO_DEV_RANDOM- No /dev/random accessNO_FILESYSTEM- No file system accessNO_WRITEV- No writev() system callNO_STDIO_FILESYSTEM- No stdio-based file operationsWOLFSSL_NO_SOCK- No socket supportWOLFSSL_NO_GETPID- No process ID supportNO_ASN_TIME- Conditionally defined only whenWOLFCRYPT_ONLYis also defined. For systems without RTC, this bypasses certificate date checking.Important: Users must provide their own entropy source when using this configuration since
NO_DEV_RANDOMis defined. Implementwc_GenerateSeed()with platform-specific hardware RNG.Changes based on reviewer feedback:
WOLFCRYPT_ONLYfrom the macro - users should enable it separately via--enable-cryptonlyif neededNO_ASN_TIMEconditional onWOLFCRYPT_ONLYto avoid forcing certificate date checking to be disabledTesting
Tested with autotools build system:
Tested with both flags:
Tested with CMake build system:
Verified that
WOLFSSL_BAREMETALin settings.h correctly defines all component macros when enabled, and thatNO_ASN_TIMEis only defined whenWOLFCRYPT_ONLYis also present.Checklist