Open
Conversation
added 2 commits
April 17, 2026 09:41
rtapi_app.h unconditionally declares EXPORT_SYMBOL for both
rtapi_app_main and rtapi_app_exit, so every module is expected to
provide both entry points. enum.c only implemented rtapi_app_main,
which slipped past GNU ld but trips lld 17+'s default
--no-undefined-version (LLVM D135402) when the generated version
script references the missing symbol:
ld.lld: error: version script assignment of 'global' to symbol
'rtapi_app_exit' failed: symbol not defined
Provide an empty rtapi_app_exit so enum.c satisfies the contract.
Builds clean with clang 19 / ld.lld 19 for a uspace configuration.
Fixes LinuxCNC#3191.
rtapi_app.h mandates that every component exports both rtapi_app_main and rtapi_app_exit, but do_load_cmd() only checked for main and do_unload_cmd() silently skipped the exit call when it was absent. That let enum.c slip into the tree without rtapi_app_exit for years (Fixes LinuxCNC#3191), visible only once lld 17+'s default --no-undefined-version made it a hard link error. Check for rtapi_app_exit in do_load_cmd() alongside rtapi_app_main and refuse to load the component otherwise, so future omissions surface immediately at load time with a clear error message. While here, also correct the dlsym cast for rtapi_app_exit in both do_load_cmd() and do_unload_cmd() from int(*)(void) to void(*)(void) to match the component's actual declaration. The int version was copy-pasted from the rtapi_app_main lookup and while harmless in practice (the return value was never read) it misrepresents the function signature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cherry-pick of #3925 for 2.9, seems cherry-pick applied cleanly...
@NTULINUX @andypugh @BsAtHome