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

xt-clang: support bundled newlib #59291

Closed
wants to merge 10 commits into from

Commits on Aug 2, 2023

  1. samples: logging/syst: add board config for intel_ace15_mtpm

    Add a board config file for intel_ace15_mtpm which is simply
    a copy from intel_adsp_cavs25.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    7ed008c View commit details
    Browse the repository at this point in the history
  2. posix: enable building with xt-clang and newlib

    Xtensa xt-clang has very old newlib (possibly 2.0.0) which
    does not have sys/_timespec.h, and also various typedefs
    done. So we need to avoid including non-existing header
    file, and avoid re-declaring the typedefs.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    b07a382 View commit details
    Browse the repository at this point in the history
  3. libc: newlib/libc-hook: resurrect malloc lock and unlock...

    ...for old newlib version.
    
    This is needed to use the newlib bundled with Xtensa xt-clang
    toolchain, which predates the introduction of retargetable
    locking.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    3cce6d2 View commit details
    Browse the repository at this point in the history
  4. tests: newlib/thread_safety: make it work with xt-clang

    The newlib bundled with Xtensa xt-clang is an old version
    which predates the introduction of retargatable locking.
    So we need to skip all the locking tests but retains
    the stress tests if xt-clang is used.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    2c47771 View commit details
    Browse the repository at this point in the history
  5. tests: c_lib: toupper and tolower take int argument

    Typecast the arguments to both toupper() and tolower() to int.
    Some ancient newlib has a way to generate warning with -Wall
    so we need to be strict about the type of argument.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    206deb1 View commit details
    Browse the repository at this point in the history
  6. kernel: mmu: mem_domain: use PRIxPTR for printing uintptr_t

    xt-clang and its ancient newlib define uintptr_t as unsigned int
    instead of unsigned long which results in compiler complaining
    about any logging using %lx for uintptr_t of different type.
    So use the toolchain provided PRIxPTR and PRIuPTR for proper
    formatting.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    3cc65c0 View commit details
    Browse the repository at this point in the history
  7. tests: log_syst: skip float data test for Clang and no FPU

    Clang would generate floating pointer instructions to process
    floats as there usually is no soft float support from host or
    vendor LLVM toolchain. Without CONFIG_FPU enabled, the platform
    runs assuming no floating point instructions would be used, and
    encountering such instructions would result in exception. So
    skip this test if CONFIG_FPU is not enabled to avoid such
    exceptions.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    bd0d958 View commit details
    Browse the repository at this point in the history
  8. samples: logging/syst: skip printing float for Clang and no FPU

    Clang would generate floating pointer instructions to process
    floats as there usually is no soft float support from host or
    vendor LLVM toolchain. Without CONFIG_FPU enabled, the platform
    runs assuming no floating point instructions would be used, and
    encountering such instructions would result in exception. So
    only print float if CONFIG_FPU is enabled to avoid such
    exceptions.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    9f5a185 View commit details
    Browse the repository at this point in the history
  9. lib: libc/newlib: support ancient newlib version

    This introduces CONFIG_NEWLIB_LIBC_IN_TOOLCHAIN_IS_ANCIENT
    to indicate if the newlib coming from the toolchain is of
    very old verion (usually predates the retargetable locks).
    There are various changes needed to support ancient newlib
    with regard to function prototypes, data types and header
    files.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    0c2e054 View commit details
    Browse the repository at this point in the history
  10. toolchain: xt-clang: enable support for newlib

    This sets the variable TOOLCHAIN_HAS_NEWLIB to true for
    xt-clang so we can use the built-in newlib provided by
    the Xtensa toolchain.
    
    Note that C++ STL support with newlib is broken (same
    as xcc), so exclude xt-clang from the libcxx tests
    for now.
    
    Signed-off-by: Daniel Leung <[email protected]>
    dcpleung committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    0e015ba View commit details
    Browse the repository at this point in the history