llext: fix auxiliary module ordering#9953
Merged
lgirdwood merged 1 commit intothesofproject:mainfrom Apr 4, 2025
Merged
Conversation
ujfalusi
approved these changes
Apr 4, 2025
Contributor
ujfalusi
left a comment
There was a problem hiding this comment.
Works great, thank you!
Collaborator
Author
|
fixes #9941 |
kv2019i
approved these changes
Apr 4, 2025
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 |
Collaborator
There was a problem hiding this comment.
final_list? looks a bit weird when other variables have underscores
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>
lgirdwood
approved these changes
Apr 4, 2025
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.
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