-
Notifications
You must be signed in to change notification settings - Fork 349
llext: fix auxiliary module ordering #9953
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
Conversation
ujfalusi
left a comment
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.
Works great, thank you!
|
fixes #9941 |
kv2019i
left a comment
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.
Looks good! And good catch @ujfalusi for the original bug.
scripts/xtensa-build-zephyr.py
Outdated
| pattern_aux = re.compile(r'^aux\d_.+_llext$') | ||
| aux = sorted([d for d in dirlist if pattern_aux.match(d)], reverse=True) | ||
| llext_dirs = [d for d in dirlist if d.endswith('_llext') and d not in aux] | ||
| finallist = aux + llext_dirs |
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.
final_list? looks a bit weird when other variables have underscores
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.
Eurovision-easter egg?
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.
@kv2019i done :-)
Fully automated module dependency tree generation isn't planned for SOF yet, so for now we do this manually. At the moment the sorting is completely random, relying on Python's os.scandir() output. This patch makes it possible to order auxiliary LLEXT modules explicitly. It supports up to 9 dependency levels with level 1 being the most shallow one, i.e. only end-user modules can depend on it. If any level 1 modules depend on further modules, those are called "level 2" modules etc. For this llext targets in respective CMakeLists.txt files have to be called, e.g. "aux1_iir" - see existing examples. This then guarantees correct ordering and successful run-time symbol resolution. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Fully automated module dependency tree generation isn't planned for SOF yet, so for now we do this manually. At the moment the sorting is completely random, relying on Python's os.scandir() output. This patch makes it possible to order auxiliary LLEXT modules explicitly. It supports up to 9 dependency levels with level 1 being the most shallow one, i.e. only end-user modules can depend on it. If any level 1 modules depend on further modules, those are called "level 2" modules etc. For this llext targets in respective CMakeLists.txt files have to be called, e.g. "aux1_iir" - see existing examples. This then guarantees correct ordering and successful run-time symbol resolution.
Recommendet reviewing mode with white space differences removed