Specifying undefined symbol on linker invocation requests the linker to
search and include the symbol.
This ensures the symbol will be present in final output.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit enables users to pass -DQEMU_SOCKET=y for 'west' when
selecting to run the build on a QEMU VM. This allows the target's serial
port to be served to the host via a TCP/IP port for convenience, easing
communication with the target from the external world.
Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Adds a new compiler flag to enable function instrumentation injection
at compile time for compilers that support it.
Adds support for this flag to GCC when `CONFIG_INSTRUMENTATION` is
enabled, setting the `-finstrument-functions` flag during compilation.
Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
Commit eff5d02872 added
`net_socket_service_desc` to common-rom ld snippet but not to common-rom
CMake linker generator equivalent.
Bring common-rom.cmake up-to-date to ensure `net_socket_service_desc`
works correctly with the linker generator.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
`file(COPY_FILE ...)` is from CMake 3.21.
Zephyr still supports CMake 3.20, so use zephyr_file_copy(...)
instead of `file(COPY_FILE ...)`.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes#91045
Adding NO_SPLIT in the TOOLCHAIN_LD_FLAGS list caused every flags in the
list to be checked together by the linker. This caused issues where
incompatible flags was passed together, and the result was that none was
propagated to the linker.
By using separate variables, we can achieve the initial goal of NO_SPLIT to
only group a sub-set of flags.
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
This commit adds support for IAR C-STAT Static Analysis
in the Zephyr's SCA Framework.
By specifying -DZEPHYR_SCA_VARIANT=iar_c_stat in west, a SQLite
database file will be generated under build/sca/iar_c_stat.
Signed-off-by: Felipe Torrezan <felipe.torrezan@iar.com>
Set -Wshadow when compiling unit tests, this way we can test macro
combinations and ensure they don't generate shadowed variables, which
would generate a warning by default in normal Zephyr builds.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Introduce a streaming APIs for ADC devices.
Two new APIs are added to the adc_driver_api: submit and get_decoder.
Added decoder following APIs: get_frame_count, get_size_info, decode,
has_trigger.
Supported triggers are:
- ADC_TRIG_DATA_READY
- ADC_TRIG_FIFO_WATERMARK
- ADC_TRIG_FIFO_FULL
Supported operations to be done on trigger:
- include - whatever data is associated with the trigger
- nop - do nothing with data associated with the trigger
- drop - clear data associated with the trigger
Some changes to the linker scripts were needed to add decoder APIs.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Enhance the armfvp emulator cmake handling to allow additional options
for setting ARMFVP_BIN_PATH, relaxing the previous requirement to set in
an environment variable. This makes it possible to run twister with
multiple armfvp platforms located in different paths.
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
This potentially fixes an issues whereby when sysbuild projects
import dts configuration from images and images are reconfigured,
that sysbuild will needlessly rerun even if the output has not
changed by using a temporary output file and then only updating
the actual file if the contents have changed
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Compiler property no_track_macro_expansion is controlled by
CONFIG_COMPILER_TRACK_MACRO_EXPANSION.
When that Kconfig is set to Y, clang fails with the following error
message:
unknown argument: '-ftrack-macro-expansion=0'
This commit modifies clang/compiler_flags.cmake so that there is a
proper clang compiler option for this flag.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Since we're not yet at a consensus on where 'write-block-size' should be
set, make the adjustable alignment expected only in the revert case
to restore functionality on the 'normal' case.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
implemented as an SCA for now but might benefit from being baked into
the build system so that it's always available.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Adds a dependency that causes CMake to re-configure if the input
key files for MCUboot signing/encryption have changed
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
-Wno-volatile is set by gcc/compiler_flags.cmake,
but is not supported by clang and generated warnings.
Signed-off-by: Jaagup Averin <jaagup.averin@gmail.com>
Since this overrides values from gcc/compiler_flags.cmake,
they should ideally have the same structure and order.
Signed-off-by: Jaagup Averin <jaagup.averin@gmail.com>
Loads this file in a better way that means samples and modules
should not have to source the file before referencing Kconfig
module path variables
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Replace the default serial device with a virtconsole if it
is configured in the devicetree. Because of the way -nographic
works, -serial none and -monitor none had to be added as well.
Tested with west build -t run and west build -t debugserver_qemu.
Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com>
Extra Zephyr modules can be provided via the EXTRA_ZEPHYR_MODULES CMake
list variable. Previously, if this variable were set in multiple places
(e.g. local CMake variable, cache variable set via -D, environment
variable), Zephyr will pick one source based on zephyr_get's documented
hierarchy and ignore the others.
Add the MERGE keyword when EXTRA_ZEPHYR_MODULES is read so that the list
of Zephyr modules is merged from all sources if this variable is set in
multiple places.
An example where this can be useful is when integrating additional Zephyr
modules with a vendor's Zephyr-based application whose build system already
contains usage of EXTRA_ZEPHYR_MODULES.
Signed-off-by: Kesavan Yogeswaran <hikes@google.com>
Do not use private API prefix and move to architecture interface as
those functions are primarily used across arches and can be defined by
the architecture.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Introduce a new Kconfig option CPU_CORTEX_A78 to enable support for the
Arm Cortex-A78 CPU architecture within Zephyr. This configuration can be
selected by boards or SoCs that utilize the Cortex-A78 core, enabling
architecture-specific features and optimizations as needed.
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
Add a possibility to specify VID and CID for each MCUboot image and pass
it to the imgtool.
Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
Adds a output env file that lists the paths of zephyr modules
which can be used in Kconfig files and uses this in Kconfig. Also
updates Kconfig doc output to generate and use this
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Provide toolchain-specific implementations for the new functions
added in d77b58a, because the default ones end up with build failures.
As the MWDT toolchain doesn't support different combinations of
compilers and linkers, there's no need to pass any linker properties
from the compiler, at least for the time being. Moreover, the default
implementation of compiler_set_linker_properties() uses the compiler
flag (--print-libgcc-file-name) that doesn't make any sense for MWDT.
Therefore, provide an empty implementation of the function.
The default implementation of toolchain_linker_add_compiler_options()
doesn't cause any issues for now, but it's still better to replace
it with the passthrough implementation borrowed from ld/lld.
Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
Use CMAKE_C_COMPILER_TARGET to allow clang to correctly determine
the runtime library for the target architecture.
Otherwise, the default runtime library will be selected.
Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
The computation of paths to crtbegin.o and crtend.o must be delayed until
after the compiler_file_path function has been defined. The
toolchain_linker_finalize function is where these are supposed to get set
now.
Signed-off-by: Keith Packard <keithp@keithp.com>
Adds a variable that has the path of the module directory, this
is supplied as an argument when running cmake normally but is
not supplied when running the check compliance script, this
addition allows checks to be ran that use such syntax in Kconfig
files. This is then removed from cmake as the python file handles
it instead
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The IAR linker ilink does not have any optimization options, and
with the newly added linker optimization flags that default to
the compiler optimization flags, ilink will fail with an
"illegal command line option" error.
This temporary workaround will use a harmless option instead to
avoid errors, until we can update the linker.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
With inclusion of the optimization flag into the multilib selection
process, we cannot compute the compiler library path when the compiler's
target.cmake is processed as LINKER_OPTIMIZATION_FLAG is not computed until
much later.
Instead, add a function (compiler_file_path) which can be used to locate
the appropriate crtbegin.o and crtend.o files.
Delay computation of lib_include_dir and rt_library until after all
compiler flags have been computed by adding compiler_set_linker_properties
and calling that just before toolchain_linker_finalize is invoked.
Place default implementations of both of these functions in a new file,
cmake/compiler/target_template.cmake, where we assume the compiler works
like gcc or clang and handlers the --print-file-name and
--print-libgcc-file-name options. Compilers needing alternate
implementations can override these functions in their target.cmake files.
These implementations require that no generator expressions are necessary
for the compiler to compute the right library paths.
This mechanism is also used to take any additional compiler options by
adding a new (optional) linker function,
toolchain_linker_add_compiler_options, which maps compiler options to
equivalent linker options, discarding any that aren't applicable.
Signed-off-by: Keith Packard <keithp@keithp.com>
The option -Hlld of the MWDT linker is relevant only for classic ARC.
It is incompatible with ARC-V platform options like -av5rmx.
Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
This commit adds changes which are necessary to support
the AES256 encryption algorithm in mcuboot.
Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
Commit f499ea0 made it so that the compiler optimization flags are also
passed to the assembler. However, this breaks for the IAR toolchain
since it uses the GNU assembler which does not have the same
optimization flags as the IAR compiler.
This commit separates the compiler and assembler optimizations to make
it possible to specify appropriate flags in a toolchains corresponding
`compiler_flags.cmake`
Signed-off-by: Daniel Flodin <daniel.flodin@iar.com>
Add initial support for the Cortex-M52 Core which is an implementation
of the Armv8.1-M mainline architecture.
The support is based on the Cortex-M55 support that already exists in
Zephyr.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Prefer flashing the confirmed image when one is created with
CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE. This way, the west runner will
flash this image over the signed image if it exists.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
When signing for ramload mode, respect the write alignment size setting.
This is required when creating a confirmed image, as the BOOT_MAGIC
value changes based on the alignment size in use.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Add Kconfigs for RAMLOAD_WITH_REVERT mode in MCUBoot. This mode works in
a manner similar to DIRECT_XIP_WITH_REVERT- namely, mcuboot will only
boot an image that is either confirmed or marked as pending. If both
images are confirmed, mcuboot will still select the one with the higher
version, so downgrading is not possible using this mode.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Adds fixes to get LLEXT tests to work for NSIM VPX on MWDT.
Excludes prelocated extensions for MWDT for now.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Allow users to compile LLEXTs with the MetaWare Design Toolchain.
Provides utility to dramatically shrink bloated extensions by removing
unused section names left behind by MWDT strip. Test extensions will
not fit in NSIM VPX5 memory otherwise; each is reduced from ~16k to ~1k.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Update signing script to use proper arguments for imgtool when SHA512
or pure signature is needed.
Signed-off-by: Michal Kozikowski <michal.kozikowski@nordicsemi.no>
This commit introduces the SRAM_SW_ISR_TABLE option which is selected by
DYNAMIC_INTERRUPT. It allows splitting the DYNAMIC_INTERRUPT option into
two parts:
- One for the relocation of the ISR vector table in RAM
- One for the inclusion of functions needed to install ISRs dynamically
The goal is to later only select the relocation of the ISR vector table in
RAM and not all the associated functions from the dynamic interrupt
mechanism.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Merging in DTS_ROOT from sysbuild allows applications to specify a custom
DTS_ROOT path for the application via sysbuild.
Signed-off-by: Nick Brook <nrbrook@gmail.com>
Before this commit, building llext packages with a `POST_BUILD` step added
via `add_llext_command()` only worked for from-scratch builds (tested with
Ninja).
When the client CMake script called `add_llext_command()` to add a custom
`POST_BUILD` step, `has_post_build_cmds` was set to 1, and a `true` (do
nothing) command was executed instead of `copy` for the `llext_pkg_input`
target. Consequently, the timestamp of `llext_pkg_input` was not updated.
Before executing `llext_proc_target`, Ninja seems to check the timestamp
of `llext_pkg_input`. When the custom command added by
`add_llext_command()` generated a new `llext_pkg_input`, Ninja was unaware
that `llext_pkg_input` had been updated, and the dependent
`llext_pkg_output` was not executed. Building only worked if
`llext_pkg_input` was missing, i.e., only for from-scratch builds.
The fix replaces dependencies so the command for `llext_pkg_input` is
executed after `llext_proc_target` (after `llext_proc_target` may generate
a new `llext_pkg_input`).
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>