Skip to content
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

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

LLEXT: build libraries #9702

wants to merge 18 commits into from

Commits on Nov 27, 2024

  1. llext: simplify offset calculation when copying sections

    Use section offset from the section header in
    llext_manager_load_data_from_storage() to simplify calculations and
    eliminate a function parameter.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    cc6b184 View commit details
    Browse the repository at this point in the history
  2. llext: remove an unused field

    file_offset in struct lib_manager_segment_desc is unused, remove it.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    8501150 View commit details
    Browse the repository at this point in the history
  3. llext: remove LIB_MANAGER_BSS

    We don't need to store .bss address and size until the module is
    freed since .bss is allocated together with .data and we only need
    its size when initialising it, not when freeing module memory. Remove
    it to save memory.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    cf6adac View commit details
    Browse the repository at this point in the history
  4. rimage: split a function

    Split man_get_module_manifest() into two functions in preparation for
    multi-part relocatable module library support.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    08d125a View commit details
    Browse the repository at this point in the history
  5. rimage: split man_module_create_reloc()

    The second preparatory step for multi-part relocatable module
    libraries.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    1eb4ad6 View commit details
    Browse the repository at this point in the history
  6. rimage: (cosmetic) remove redundant NULL-checks

    free(NULL) is allowed, remove redundant checks.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    45f2fe6 View commit details
    Browse the repository at this point in the history
  7. rimage: add support for multi-part llext libraries

    Rimage generates an image from multiple input modules. However, in
    case of building libraries from multiple relocatable ELF files it
    doesn't currently construct manifest correctly. It mixes up manifest
    provided in TOML with manifest structures in ".module" sections of
    modules. Clean this up to only use manifests from ELF and append
    configuration from TOML.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    2a22eaf View commit details
    Browse the repository at this point in the history
  8. llext: (cosmetic) simplify 3 functions

    Remove unused arguments from llext_manager_load_module(),
    llext_manager_unload_module() and llext_manager_link().
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    5198be5 View commit details
    Browse the repository at this point in the history
  9. llext: add per-module contexts

    Run-time loadable SOF libraries can contain multiple modules. To
    prepare to support them add a module context type.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    109fcd9 View commit details
    Browse the repository at this point in the history
  10. llext: (cosmetic) remove function names from logging

    Zephyr logging prints function names, no need to include them
    explicitly.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    0bd6002 View commit details
    Browse the repository at this point in the history
  11. llext: fix potential NULL dereference

    NULL checking should be done before dereferencing, not after. Also
    rearrange varoable definition in llext_manager_allocate_module() to
    make it more logical.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    b04d1fe View commit details
    Browse the repository at this point in the history
  12. llext: fix an error code

    llext_manager_allocate_module() should return 0 when failing, not an
    error code.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    b344522 View commit details
    Browse the repository at this point in the history
  13. llext: support libraries with multiple modules

    Loadable libraries can contain multiple modules, where each module
    can contain multiple manifest entries, e.g. when providing multiple
    Module Adapter drivers. This commit adds support for such libraries,
    built by specifying all the modules on rimage command line.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    4e7e74e View commit details
    Browse the repository at this point in the history
  14. mux: remove DEMUX entry from LLEXT build

    mux.toml doesn't have a demux entry in it, therefore we cannot have
    one in .module either, remove it until fixed. Also fix a copy-paste
    error in the same code block.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    967a24c View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2024

  1. llext: generate fully modular configuration

    Add a FORCE_ALL_MODULES macro to mtl.toml.h. When this header is then
    preprocessed with that macro defined, all module TOML files will be
    included. This then can be used to generate module libraries.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    608668d View commit details
    Browse the repository at this point in the history
  2. llext: add a parameter to sof_llext_build()

    Add a parameter to sof_llext_build() to support adding modules to
    libraries. Specifying a LIB parameter in that function with a single
    value adds that module to a library with that name.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    e2e8368 View commit details
    Browse the repository at this point in the history
  3. llext: (WiP) illustrate adding modules to libraries

    Add src, volume and mixin-mixout to LLEXT libraries.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    f6264e8 View commit details
    Browse the repository at this point in the history
  4. llext: add support for library building

    Build libraries of modules, as specified in their cmake files.
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    lyakh committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    24a0dd9 View commit details
    Browse the repository at this point in the history