-
Notifications
You must be signed in to change notification settings - Fork 322
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
LLEXT: build libraries #9702
LLEXT: build libraries #9702
Conversation
Can be reviewed but shouldn't be merged yet because of a zephyrproject-rtos/zephyr#82735 Zephyr dependency |
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.
LGTM - let get the Zephyr part merged first.
one more change that has to be done before merging: actually only PTL should be converted to library style so far, convert it back to draft to really avoid accidental merge |
41a829e
to
5d5e5df
Compare
35eebb0
to
8afc3f3
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.
Code looks good, but I'm a bit uncertain what (if any) changes expect in the build with this. I did some test builds locally and I see no change... expected?
app/boards/intel_adsp_ace30_ptl.conf
Outdated
@@ -36,6 +36,10 @@ CONFIG_ZEPHYR_NATIVE_DRIVERS=y | |||
# SOF / loadable modules | |||
CONFIG_INTEL_MODULES=y | |||
CONFIG_LIBRARY_MANAGER=y | |||
CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 | |||
CONFIG_LIBRARY_MANAGER=y |
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.
CONFIG_LIBRARY_MANAGER^2 ? Also on L38
app/boards/intel_adsp_ace30_ptl.conf
Outdated
CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 | ||
CONFIG_LIBRARY_MANAGER=y | ||
CONFIG_LIBRARY_BUILD_LIB=y | ||
CONFIG_LIBRARY_DEFAULT_MODULAR=y |
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.
Hmm, is this series missing something still? I don't see ptl build changed with this PR, should it? I see ace30_ptl.conf doesn't have LLEXT set, so this CONFIG_LIBRARY_DEFAULT_MODULAR=y setting won't have any impact. Is this intentional?
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 no, it isn't intentional, thanks for catching! Let me fix
Build libraries of modules, as specified in their cmake files. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Size of constant and writable objects of the same type is the same, drop the "const" qualifier from sizeof() type specification. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Fix typos, using pin-configuration references when parsing module configuration. Also clarify some magic constants. Signed-off-by: Guennadi Liakhovetski <[email protected]>
zephyrproject-rtos/zephyr#81360 seems to be needed for this, without it a lock up or a crash is observed when destroying pipeline threads. With that fix and with thesofproject/linux#5270 this PR enables building of "openmodules" libraries when enabled in Kconfig |
Btw, I assume the log strings are part of the module (i.e. string memory is owned by module and we pass string pointer) but the formatted data is owned by the log infra, hence we should |
@lgirdwood this is already done by LLEXT in Zephyr core, PR81360 just changes the way how it is done |
Add a function to search for a TOML configuration entry by module name. Signed-off-by: Guennadi Liakhovetski <[email protected]>
When building libraries we know how many input files we use, but we also need to count how many modules each file contains. Add respective calculations. Signed-off-by: Guennadi Liakhovetski <[email protected]>
8955c21
to
ad9e827
Compare
Dropping the GitHub out-of-storage space fix here, moving it to a separate #9766 , let's merge that one before this. |
The CI seems to be misbehaving: https://sof-ci.01.org/sofpr/PR9702/build10065/devicetest/index.html, https://sof-ci.01.org/sofpr/PR9702/build10063/devicetest/index.html and https://sof-ci.01.org/sofpr/PR9702/build10064/devicetest/index.html seem to have appeared way too early. |
@lyakh can you check CI , thanks! |
LNL https://sof-ci.01.org/sofpr/PR9702/build10112/devicetest/index.html didn't run at all. Relaunching |
SOFCI TEST |
Files on rimage command line don't have to follow in the same order as modules in TOML. Moreover, the TOML configuration is global, it contains all modules, enabled for this platform, whereas when building libraries we need to select only configurations for used modules. This patch finds and copies each such configuration individually. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Module hash sums are per-file, when building libraries we have to walk files, not modules, and copy hashes to all modules in each file. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Instead of dropping this in the commit that enabled this option, we make a separate commit to make it simple to revert it once the kernel driver and CI testing are updated to use installed module libraries. Signed-off-by: Guennadi Liakhovetski <[email protected]>
CI: jenkins tests https://sof-ci.01.org/sofpr/PR9702/build10148/devicetest/index.html and https://sof-ci.01.org/sofpr/PR9702/build10149/devicetest/index.html "failed" because one device out of 3 wasn't tested in each of them. The two tested devices in both sets are "green" |
as it stands, this PR won't break anything, because building libraries is disabled in this configuration. But to actually enable it it needs zephyrproject-rtos/zephyr#81360 and thesofproject/linux#5270 |
Extends #9688 with library build support. Needs zephyrproject-rtos/zephyr#82443