Create generate_shell_aliases_inc_file_for_target() function that
can be used to convert shell aliases file to a format that can be
included in the shell to support aliases.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This replaces a workaround in `ExternalZephyrVariantProject_Add()` -
setting KCONFIG_TARGETS-NOTFOUND - which turned out to be incomplete.
For example, it had no way of accounting for EXTRA_KCONFIG_TARGETS
(which could be set on the command line or through something like
`ZephyrBuildConfig.cmake`).
Instead, the creation of `menuconfig` and friends can be gated on
KCONFIG_VARIANT_SOURCE, which is the variable sysbuild uses to forward
the source configuration to the variant image. This way, both lists of
Kconfig targets are excluded reliably.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Our virtio driver in the zephyr tree only supports
version 2 and not the legacy one, therefore force it
to be used. Needed for the riscv virt target.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Follow the same logic as in dts.cmake, where after:
zephyr_file_copy(file.new file.old ONLY_IF_DIFFERENT)
the .new file is removed.
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
Add new implementations for entropy driver and random subsystem
based on ARM64 RNDRRS and RNDR instructions.
Signed-off-by: Christoph Busold <cbusold@qti.qualcomm.com>
The current implementation of the LLEXT EDK exports only a partial set
of compiler settings to the EDK build system, specifically only the ones
defined by the Zephyr core (the 'zephyr_interface' target). Extending
this to include application and module-specific settings (from the 'app'
target and its dependencies) is tricky, because:
- while evaluating the main CMakeLists.txt, the 'app' target is not
fully configured yet, and
- using generator expressions is not possible due to CMake not allowing
expansion of $<COMPILE_LANGUAGE:...> outside of a proper compile
context.
To work around this, this change introduces a new CMake subdirectory
(misc/llext_edk) that creates a dummy target which imports the build
configuration from 'app', but overrides the C compile rules to simply
output the resulting properties (defines, include directories, flags)
to text files. The EDK generation script then reads those text files
to get the full set of build properties, and includes them in the EDK
tarball.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This function was introduced when the EDK was first implemented to reuse
the flag filtering code in 'add_llext_target'.
After moving the EDK filtering code to a later stage where simpler regex
eplacements can be used, the helper function is used only in its former
location and is no longer needed. Remove the otherwise-unused public
function to simplify the codebase.
This is a revert of commit dc8d7ada19
("cmake/modules: Extract flags filtering code to a function") with
minimal code style cleanups.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This changes the LLEXT EDK flag filtering to be done after the main
Zephyr build is completed. Instead of filtering the flags via genexes,
the full set is passed to the script along with the set of filters to be
applied, and the filter is applied later.
No functional change is intended.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Using package helper for running CMake for Zephyr.
This commit provides to option to also print the value of a Zephyr CMake
variable when Zephyr modules have been loaded.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Adds variant image handling CMake code which re-uses parts of the
original dts CMake module code but applies variant-specific parts
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Export the resolved K_HEAP_MEM_POOL_SIZE value to the
linker generator and evaluate it while generating the
IAR command file.
Fixes: #107234
Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Users may want to use a custom toolchain configuration. Moving this
inclusion to `zephyr_common_config.ecl` allows user-defined rulesets
to control this aspect.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
The "used_compiler" variable name was erroneously used as a pattern
instead of being expanded and concatenated in the file_tag matcher.
Some configurations were inconsistently matching C99 and C18 standards.
With this change, the generic "c" matcher is used. References to the
standard are updated to C18 ("C_STD").
Signed-off-by: Roberto Bagnara <roberto.bagnara@bugseng.com>
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
sca_options.cmake defines the ECLAIR-related options, so it should
always be included.
Consistency checks on these options are moved to sca.cmake. This way
they are applied after the conditional inclusion of the
ECLAIR_OPTIONS_FILE.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
The analysis directory setup should happen before the project analysis.
This missing dependency would otherwise cause non-deterministic
failures of the analysis, as the directory could be removed while
ECLAIR is producing analysis frame files.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
The options set in ECLAIR_OPTIONS_FILE would be overwritten by the
subsequent "set" commands (e.g. `set(ECLAIR_ENV_ADDITIONAL_OPTIONS "")`).
By moving the inclusion of the options file below these commands, we
avoid this unwanted behavior.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
ECLAIR_ENV_ADDITIONAL_OPTIONS is a semicolon-separated list. Expanding
the variable directly would produce an invalid option for ECLAIR.
By joining the list with spaces, ECLAIR will receive the arguments
separately as expected.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
This change disables ECLAIR's default toolchain aliases and sets them
to the exact toolchain paths that are used in the build.
This also simplifies ECLAIR analyses on MacOS systems, where using
ECLAIR's default path-based trap would require additional setup.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
Allows calling an init function/macro inside of zephyr module
files, this allows for making it easier to reuse/override module
CMake code
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The previous webbrowser.open(file_path) approach fails under WSL
because Windows cannot open files via UNC paths. Use a local HTTP
server instead, which works reliably across more platforms.
Also add USES_TERMINAL to the CMake dashboard target so that log
output is visible.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Don't use COMMAND_EXPAND_LISTS for the targets added for menuconfig,
guiconfig, etc. so the list of shields is properly quoted when including
multiples with a semicolon separator.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
The iar toolchain fails to build after the update to the
1.0.0 Zephyr SDK. The path to the gnu toolchains
was updated to '${ZEPHYR_SDK_INSTALL_DIR}/gnu/'
in order to be compatible with the 1.0.0 SDK.
Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
The arcmwdt toolchain fails to build after the update to the
1.0.0 Zephyr SDK. The path to the generic.cmake in the toolchain
was updated to '${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/gnu/target.cmake'
in order to be compatible with the 1.0.0 SDK. This commit also
sets the required zephyr SDK to 1.0 as the SDK is no longer backwards
compatible and will fail to build with any version less than 1.0.
Signed-off-by: Christopher Turner <christopher.g.turner@intel.com>
This change adds a script to generate an HTML dashboard, invoked via
west, providing a consolidated and user-friendly view of various build
artifacts and metrics. This includes footprint information (as both
tables and plots), configuration tracing, sys init levels, an interactive
devicetree browser, and more.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
Signed-off-by: Martí Bolívar <mbolivar@oss.qualcomm.com>
This adds the bits to support running whisper as simulator
so that we can do west build with debug and run targets.
The simulator is used for simulating SweRV SoCs.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The Qemu emulator executable for the OpenRISC 1000 (or1k) architecture is
named qemu-or1k. This patch adds this information to the qemu architecture
suffix list.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Add support for producing a zephyr.mem binary in Verilog memory hex dump
output format. This requires binutils v2.40 or newer.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The driver implements the QEMU ramfb as a framebuffer-based display.
It only implements the basic capabilities necessary (ARGB8888) with
resolution configurable via DTS. For initialization it uses the fwcfg
driver.
Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
ZephyrSDK v1.0.0 is updated to support RXv2 and RXv3 instruction
this update the gcc cmake configuration for RX build on Zephyr SDK
for RXv2 and RXv3 MCU
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
The espressif toolchain variant (ZEPHYR_TOOLCHAIN_VARIANT=espressif)
has not been used for years. Espressif targets are now built using the
Zephyr SDK, which bundles the required Xtensa and RISC-V toolchains.
Remove the cmake/toolchain/espressif/ directory containing generic.cmake,
target.cmake, and Kconfig files that implemented this variant. Also
clean up references in the coredump xtensa gdb stubs, removing the
ESPRESSIF toolchain enum value and related handling code.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This commit updates the minimum required Zephyr SDK version to 1.0.
This is mandated by the new SDK directory layout scheme as well as the dual
(GNU and LLVM) compiler support in the SDK.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Until https://github.com/zephyrproject-rtos/sdk-ng/pull/936 is merged,
SDK 0.18 is incompatible with previous versions as the paths to
find the cmake bits is different.
Deal with that by checking for files in the wrong place as well as the
right one.
Signed-off-by: Keith Packard <keithp@keithp.com>
Support specifying compiler type for Zephyr SDK in the
ZEPHYR_TOOLCHAIN_VARIANT variable.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Combine toolchains provided by the host into one variant. This includes
both gcc and llvm installation typically coming from the distribution
(on Linux).
Both gcc and llvm are now part of the 'host' variant, the default is the
gnu compiler, so setting
ZEPHYR_TOOLCHAIN_VARIANT=host
Will select the gnu compiler. To select llvm or any other compuler
provided in this variant, use the follwoing format:
ZEPHYR_TOOLCHAIN_VARIANT=<variant>/<compiler>
The following will select llvm:
ZEPHYR_TOOLCHAIN_VARIANT=host/llvm
Although gnu is the default, it can also be selected using the above
syntax:
ZEPHYR_TOOLCHAIN_VARIANT=host/gnu
This commit removes the llvm variant for now, it should be deperecated
in another commit to follow.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Override the GCC-specific `-Wno-volatile` flag specified by GCC
`compiler_flags.cmake` with the Clang-equivalent
`-Wno-deprecated-volatile`.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
When LLVM linker is used, the toolchain-provided C standard library is
always linked, even when the Zephyr minimal libc is selected, because `c`
is unconditionally specified in `link_order_library`, which causes `-lc` to
be specified in the linker flags.
This commit adds a check to ensure that `-lc` is not specified when the
Zephyr minimal libc is selected because it is a standalone C standard
library and it does not make sense to link two C standard libraries at
once.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit introduces `TOOLCHAIN_HAS_LIBCXX` CMake variable, which is set
to `y` when LLVM C++ Standard Library aka. libc++ is available.
This helps filter libc++-specific Kconfig and tests in a more refined
manner.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit introduces `TOOLCHAIN_HAS_GLIBCXX` CMake variable, which is
set to `y` when GNU C++ Standard Library aka. libstdc++ is available.
This helps filter libstdc++-specific Kconfig and tests in a more refined
manner.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Address review feedback: avoid _ prefixing local CMake variables
as it conflicts with the convention used for function overloading.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Prevent cppcheck-preprocessorErrorDirective failures by
passing includes to both autoconf.h and a generated header file
containing compiler-specific definitions to Cppcheck
Signed-off-by: Martin Lampacher <martin.lampacher@gmail.com>
Z_HEAP_MIN_SIZE and Z_HEAP_MIN_SIZE_FOR were defined in kernel.h as
hardcoded magic numbers gated by a growing tower of #ifdefs — one
per Kconfig option that happened to affect the heap struct layout.
Every internal change required manually recomputing the constants,
duplicating layout knowledge across files, and praying nobody forgot
to update the #ifdef matrix. This is fragile and unscalable: adding
a single new heap feature (e.g. a chunk canary trailer) would add yet
another dimension to the combinatorial explosion.
Replace this with build-time computation from the actual C structures.
A new lib/heap/heap_constants.c uses GEN_ABSOLUTE_SYM to emit the
correct values into a generated heap_constants.h header via the
zephyr_constants_library() infrastructure. Z_HEAP_MIN_SIZE is
derived through an iterative fixed-point expansion (3 rounds, always
convergent) that mirrors the runtime logic in sys_heap_init().
Big vs small heap determination uses CONFIG_SYS_HEAP_SMALL_ONLY,
CONFIG_SYS_HEAP_BIG_ONLY, and sizeof(void *), mirroring the
big_heap_chunks() logic in heap.h.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add an optional DEPENDS parameter to zephyr_constants_library() that
lists other constants libraries whose generated headers must be
produced before this library is compiled. This creates proper build
ordering through add_dependencies() on the header-generation targets.
A build test with four constants libraries exercising various
dependency patterns (fan-in, fan-out, diamond) validates this.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Introduce a reusable CMake function that creates an OBJECT library
from a C source file containing GEN_ABSOLUTE_SYM() declarations and
generates a header file from the resulting symbols. This encapsulates
the boilerplate needed for the offsets-style pattern: OBJECT library
creation, LTO prohibition, gen_offset_header.py invocation, and
dependency registration.
Convert the existing offsets.h generation to use this new function.
The zephyr_generated_headers target is moved earlier in CMakeLists.txt
so that subsystem CMakeLists.txt files can register generated headers
via zephyr_constants_library().
Also update gen_offset_header.py to derive the include guard from the
output filename instead of hardcoding __GEN_OFFSETS_H__, and remove the
unused input_name parameter. This allows multiple generated headers to
coexist with distinct include guards.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>