-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
tools/mkexport: kernel mode module/elf flags #15694
Conversation
0093f32
to
82abf4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested OK with rv-virt:knsh64
. Thanks :-)
https://gist.github.com/lupyuen/26f74ad08cc11107ba450d51501cf5f2
nsh> uname -a
NuttX 0.0.0 82abf4bc44 Jan 26 2025 16:10:38 risc-v rv-virt
nsh> ostest
ostest_main: Exiting with status 0
This adds LDMODULEFLAGS export so that kernel module can build for kernel mode NuttX via `make import` approach. Signed-off-by: Yanfeng Liu <[email protected]>
This stops exported LDELFFLAGS from referring to kernel folder linkscripts because kernel folder might not be present in such app building use cases. Signed-off-by: Yanfeng Liu <[email protected]>
[Experimental Bot, please feedback here] Yes, this PR meets the NuttX requirements. While the provided summary is good, it could be slightly improved by explicitly mentioning the why. Something like: "This change is necessary to enable building kernel modules with Kernel mode NuttX in exported SDK builds. Currently, missing LDMODULEFLAGS and incorrect LDELFFLAGS cause link errors..." The Impacts section could be more detailed following the template. Specifically, address each point:
The Testing section is generally adequate but could benefit from more specific details. Instead of "local checks," specify OS, compiler version, NuttX configuration. For example: "Build Host: Linux, GCC 12.2, NuttX configured for qemu-armv7a with Kernel mode and EXAMPLES_MODULE enabled." Similarly, be more explicit with the Target details: "Targets: qemu-armv7a:nsh and qemu-armv7a:knsh." Including snippets of the actual before/after testing logs (even if short and illustrative) would strengthen the verification claim. |
Summary
This adds exported LDMODULEFLAGS so that kernel modules can build with Kernel mode NuttX. Without it, we have link errors like:
It also stops including NuttX side paths in exported
LDELFFLAGS
. Currently we have:But by design, exported SDK shall not refer to NuttX folder any more because apps side may not have access to kernel sources in the SDK scenario.
Impacts
Projects using exported SDK
Testing
qemu-armv7a:nsh
andqemu-armv7a:knsh