Some tests require the zephyr toolchain version 0.16 or newer to
be able to use picolibc functionality.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
When building with clang, the unittests were giving us an error:
```
error: undefined symbol: llvm_gcda_start_file
```
This seems to be from linking in `gcov` regardless of the toolchain.
It appears that clang doesn't need any special library for coverage.
With this change the following now produce identical coverage reports:
```
$ ZEPHYR_TOOLCHAIN_VARIANT=zephyr ./scripts/twister -p unit_testing \
--coverage -i -T tests/unit/intmath/
$ ZEPHYR_TOOLCHAIN_VARIANT=host ./scripts/twister -p unit_testing \
--coverage -i -T tests/unit/intmath/
$ ZEPHYR_TOOLCHAIN_VARIANT=llvm ./scripts/twister -p unit_testing \
--coverage -i --coverage-tool lcov \
--gcov-tool $(pwd)/scripts/utils/llvm-gcov.sh \
-T tests/unit/intmath/
```
Signed-off-by: Yuval Peress <peress@google.com>
Follow-up: #49672
Zephyr SDK and host tools detection was reworked in #49672.
That rework accidentally changed the lookup order from:
- Zephyr SDK
- Other host tools
- Generic (host) C compiler
into
- Other host tools
- Zephyr SDK
- Generic (host) C compiler
this causes host tools shipped with Zephyr SDK, such as openocd to not
be discovered unless in path.
Restore the original order so that Zephyr SDK is located first so that
host tools from the SDK can be found without having them in path.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Move deprecated XCC_USE_CLANG setting to deprecated module.
Deprecated and move the use of CROSS_COMPILE to deprecated module as we
have had ZEPHYR_TOOLCHAIN_VARIANT==cross-compile for a long time.
Deprecated code is now loaded with a single line:
> find_package(Deprecated COMPONENTS XCC_USE_CLANG CROSS_COMPILE)
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Follow-up: #41301
This commit is a rework and cleanup of the tools handling in Zephyr
CMake build system.
Instead of directly loading code a CMake modules for tool lookup, the
host tools now follows the CMake `find_package()` pattern for finding
programs / tools in module mode.
This makes it more clear which modules are responsible for finding tools
and which modules provides build integration / features.
The following tools can now be found using `find_package()`:
- Zephyr-sdk : find_package(Zephyr-sdk <version>)
- Generic host tools: find_package(HostTools)
This further allows us to decouple the `verify-toolchain` CMake script
part required by `twister` into a tool lookup module and a dedicated
CMake script which utilizes the lookup module.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>