Skip to content

Added CMake support for ThreadX module shim library - #854

Open
Dev10-sys wants to merge 1 commit into
eclipse-threadx:devfrom
Dev10-sys:feat/cmake-module-lib-support
Open

Dev10-sys wants to merge 1 commit into
eclipse-threadx:devfrom
Dev10-sys:feat/cmake-module-lib-support

Conversation

@Dev10-sys

Copy link
Copy Markdown

Fixes #851

Summary

The dev branch recently added support for Module Manager kernels (-DTHREADX_MODULE_MANAGER=ON, target azrtos::threadx), but there was no first-class CMake target for building the companion module shim library (module_lib) that dynamically loadable modules link against.

This PR adds:

  • THREADX_MODULE_LIB option (default OFF) and companion target threadx_module_lib (aliased as azrtos::threadx_module_lib).
  • Inclusion of common module shims from common_modules/module_lib/src/ and port-specific sources from ${TX_PORT_PATH}/module_lib/src/.
  • Export of public include directories (${TX_PORT_PATH}/inc, common/inc or common_smp/inc, common_modules/inc, and ${CUSTOM_INC_DIR}).
  • Export of compile definitions (TX_INCLUDE_USER_DEFINE_FILE and TX_MPCORE for SMP builds).
  • Architecture/toolchain PIC options under GNU (-fpic -fno-plt -mno-pic-data-is-text-relative -msingle-pic-base on 32-bit Arm, -fpic on 64-bit Arm).
  • Strict isolation from the kernel target: threadx_module_lib does not define TXM_MODULE_MANAGER and does not link kernel sources.
  • Configuration failure with a clear error message when configured with an architecture/toolchain combination lacking module_lib support.
  • Companion consumer check target threadx-module-lib-consumer-check verifying clean compilation against module APIs.
  • Updated documentation in README.md.

Verification

  • Configured -DTHREADX_MODULE_LIB=ON on Linux: cleanly fails with ThreadX module library is not supported for architecture 'linux' with toolchain 'gnu' (SMP=OFF).
  • Configured for Cortex-M4 GNU UP: verified PIC flags (-fpic -fno-plt -mno-pic-data-is-text-relative -msingle-pic-base) and inclusion of all 98 shims + port sources.
  • Configured for Cortex-A35 GNU UP and SMP: verified 64-bit PIC flags (-fpic) and -DTX_MPCORE propagation without leaking TXM_MODULE_MANAGER.
  • Compiled consumer_check.c with -Wall -Wextra -Werror: clean with zero warnings.

PR checklist

  • Updated function header with a short description and version number
  • Added test case for bug fix or new feature
  • Validated on real hardware

Signed-off-by: Dev10-sys kalpanagola9897@gmail.com

Fixes eclipse-threadx#851

CMake could build standard, SMP, and Module Manager kernels, but had no
target for building the module-side shim library that loadable modules link
against.

Added the opt-in THREADX_MODULE_LIB option and companion target
threadx_module_lib (aliased as azrtos::threadx_module_lib). It compiles
common module_lib shims and port-specific module_lib sources, exports the
required include paths and user definitions, applies GNU PIC compilation
options, and provides a portable consumer check.

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant