Repository navigation
Conversation
Without WOLFSSL_MDK_ARM they fell into the MSVC-only __stdcall branch.
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues blocking the CMSIS threading compatibility change.
No open issues 🎉
What changed in this PR
Fixes GCC compilation for CMSIS-RTOS v1/v2 configurations without WOLFSSL_MDK_ARM by avoiding __stdcall in wolfSSL’s thread definitions.
Changes:
- Adds a CMSIS-specific threading branch while preserving existing MDK ARM behavior.
- Adds a host-only GCC regression test with minimal CMSIS header stubs.
- Packages the test files and runs the reproducer in Ubuntu 24.04 CI.
| File | Description |
|---|---|
wolfssl/wolfcrypt/types.h |
Defines CMSIS thread types with an empty calling-convention macro. |
tests/include.am |
Includes regression test files in source distributions. |
tests/cmsis-rtos-thread-types-repro/user_settings.h |
Provides minimal multithreaded test settings. |
tests/cmsis-rtos-thread-types-repro/run.sh |
Compiles both CMSIS variants explicitly with GCC. |
tests/cmsis-rtos-thread-types-repro/repro.c |
Exercises thread callback declarations and assignment. |
tests/cmsis-rtos-thread-types-repro/cmsis_os2.h |
Supplies minimal CMSIS-RTOS v2 type stubs. |
tests/cmsis-rtos-thread-types-repro/cmsis_os.h |
Supplies minimal CMSIS-RTOS v1 type stubs. |
.github/workflows/cmsis-rtos-thread-types.yml |
Runs the regression test on Ubuntu 24.04. |
Review effort: Balanced
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12099
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/workflows/cmsis-rtos-thread-types.yml, tests/cmsis-rtos-thread-types-repro/cmsis_os.h, tests/cmsis-rtos-thread-types-repro/cmsis_os2.h, tests/cmsis-rtos-thread-types-repro/run.sh, tests/cmsis-rtos-thread-types-repro/user_settings.h, tests/include.am
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
Description
When WOLFSSL_CMSIS_RTOS or WOLFSSL_CMSIS_RTOSv2 is built with GCC and without WOLFSSL_MDK_ARM, types.h falls through to its generic threading branch. That branch defines WOLFSSL_THREAD as the MSVC-only __stdcall, so any file that includes types.h fails to compile. MBED is also affected, because settings.h sets WOLFSSL_CMSIS_RTOS for it.
Testing
Known limitation (pre-existing, follow-up PR): a GCC build against a pure CMSIS-RTOS v1.x header (osCMSIS < 0x20000) now gets past types.h but then fails in src/internal.c at LowResTimer(). That function calls the v2-only osKernelGetTickCount(). v1-compat headers built on RTOS2, such as Keil RTX5 and STM32Cube FreeRTOS CMSIS_RTOS_V2, are not affected.
Checklist