Replaces space with an equal sign when assigning the clang configuration
file to the --config parameter. This change improves compatibility with
tools that parse the compilation database and expect compiler arguments
to be separated by space.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
.xtensa.info section isn't large so it was ignored in the beginning,
but its contents can differ depending on the build platform even if
the sources and the toolchain are the same. Strip the section to
restore binary reproducibility.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Update getting started guide, release notes, CI actions and
Python version compliance check to use Python 3.12 as
minimum supported version.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Implement the MIN_SIZE and MAX_SIZE options to
zephyr_linker_section_configurefor the IAR icf linker file
generator
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
This makes c++ sample
`sample.libraries.hash_map.newlib.cxx_unordered_map.djb2`
start working on gcc w. `CMAKE_LINKER_GENERATOR=y`.
Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
The build system currently generates mapfiles by invoking ld with the
"-Map=<mapfile>" command line argument. This variant of the flag was
introduced in GNU binutils 2.20.
To enable compatibility with legacy versions of the GNU ld, the argument
has been replaced with the "-Map <mapfile>" variant.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
The existing logic caused a regeneration when any of the .conf files
changed, but modifying the Kconfig files can also cause the .config file
to become out of date e.g. by adding a new config option or by changing
the default value of a config option (when that default is not
overridden by a .conf).
Without this change, an incremental build wouldn't pick up the new value
and would require the user to notice that and manually do a clean build.
Signed-off-by: Richard Hughes <rhughes@xilinx.com>
To circumvent peculiarities in the linker, the _init blocks
(as well as their content) needs to be tagged with keep.
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
SUBALIGN forces alignment to the specified value, even if the object
requires stricter alignment. This causes mis-aligned access when accessing
the resulting value.
Signed-off-by: Keith Packard <keithp@keithp.com>
Most uses of this macro should *not* include SUBALIGN as that can reduce
the alignment requirement for data and cause unaligned access faults in
the processor. Leave support for this in place in case there are
still uses for it.
Signed-off-by: Keith Packard <keithp@keithp.com>
Although xt-clang is based on clang, for some reason, it still
lists xcc system include path as the first search path (e.g.
for stddef.h), and the clang system include path as last. This
creates a big issue when the code starts to use any standards
past C89 (since xcc is based on GCC 4.2). We can use compiler
property nostdin_include to add -isystem to compiler options.
However, some modules (e.g. picolibcs) somehow ignore this.
So we also need to forcibly do add_compile_options() to make
sure the clang system include path is placed before the xcc
system include path.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Xtensa toolchain xt-clang needs similar treatment to xcc in
terms of nostdinc and nostdinc_include, so add it to the if
block to exclude these by default.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
If this section is placed in FLASH, the section gets marked
as writable even though .tbss values will never be stored there.
Signed-off-by: Keith Packard <keithp@keithp.com>
Introduce ECLAIR_SUMMARY_HTML and ECLAIR_FULL_HTML CMake options to
enable the generation of HTML reports.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
Added prerequisites section, fixed some typos and added
ECLAIR_RULESET_ZEPHYR_GUIDELINES option.
Also updated dead doc string links in ECLAIR configuration files.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
Added the main rules from the conding guidelines selection listed in
/doc/contribute/coding_guidelines/index.rst to the zephyr_guidelines
configuration.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
This check prevents misconfigurations where more than one ruleset is
selected, ensuring that the analysis is not silently performed with
an unintended configuration.
Signed-off-by: Luca Ciucci <luca.ciucci@bugseng.com>
Various improvements to the integration files in order to obtain correct
static analysis results:
- variable `ECLAIR_WORKSPACE' is set to the build output directory, to
allow multiple ECLAIR analyses running in parallel on the same machine
without conflicts;
- fix the evaluation order of rulesets to allow a user-provided ruleset to
be selected without a cmake options file that undefines other
ECLAIR_RULESET_* variables;
- add a clean-only frame to initiate the analysis and a project
frame to end it.
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
zephyr_append_cmake_library attempts to warn the user if a user calls it
to create a Zephyr library while the build is in application mode. At
that stage of the build, the list of Zephyr libraries has already been
processed so the function is effectively a no-op.
This heuristic used to determine if the build was in kernel mode or
application mode checked for the presence of the zephyr_prebuilt target.
This check was broken by a previous commit that renamed this target.
This commit fixes the heuristic by checking for the zephyr_pre0 target.
This was tested by calling zephyr_append_cmake_library from some
application build files, building the application, and seeing the
warning only for the call I added. No warnings were printed for any
Zephyr internal libraries.
Link: https://github.com/zephyrproject-rtos/zephyr/pull/35887
Link: https://github.com/zephyrproject-rtos/zephyr/pull/39959
Signed-off-by: Kesavan Yogeswaran <hikes@google.com>
This fixes the invocation of the 'elfconvert' and 'slid_inject' commands
in the `add_llext_target` function by ensuring that the arguments are
expanded correctly before passing them to the shell.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
"-fshort-enums" changes the ABI. It's not enabled for gcc, so it's not
clear why it's enabled for clang (only ARM) and armclang, other than it
looks like some users of these toolchains may be linking against code
that is compiled with "-fshort-enums".
As an example, when compiling with clang, CONFIG_LTO, and a toolchain
built without "-fshort-enums", the linker warns:
ld.lld: error: linking module flags 'min_enum_size': IDs have
conflicting values in
'/usr/armv7m-cros-eabi/usr/lib/libc++_static.a(string.cpp.o at 784090)'
and 'ld-temp.o'
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
When running naive sim builds using clang, respect user passed
SYSROOT_DIR values. Additionally, allow overriding the archive tool
when calling Make for the native simulator.
Add the sysroot (if available) to the native_simulator target and
TOOLCHAIN_C_FLAGS and TOOLCHAIN_LD_FLAGS. Additionally pass CMAKE_AR
to NSI_AR.
Signed-off-by: Yuval Peress <peress@google.com>
Rework how the compilation-options for the gperf generated
kobject_hash*.c files are put together to fix problems with SHELL:
and cmake-list separators handling.
zephyr_get_compile_options_for_lang_as_string() returns the set of
options as a cmake generator expression string which is cumbersome to
edit. This caused the command line for the IAR toolchain to have broken
SHELL: entries, and other some command line entries being postfixed by
"gnu".
This also adds CMake compiler properties for no_function_sections and
no_data_sections options
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
Add cmake linker generator things for .last_section.
Follow up to #88970. Fixes bug #89719, for gcc/ld & iar
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
This commit brings a convenient way to run clang static analyzer on a
project with 'analyze-build' llvm utility.
Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
The logic to "guess" shield names/dirs was duplicated between
list_shields.py (which is used by e.g. west shields) and shields.cmake.
This commit moves the logic to list_shields.py, and updates
shields.cmake to call the script and process its JSON output.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The RX floating-point hardware only works on 32-bit values
so default gcc will build doubles as 32-bit, this make many
test fail on RX build test.
This commit force the build for RX arch to use 64-bit doubles
FPU will be supported later on this arch
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Make the image devicetrees available to sysbuild for advanced use cases.
This is done by calling `zephyr_dt_import` on each image target. The DT
target properties are all expected to be prefixed with `DT_`, so there
should be no conflicts.
Thus, the DT contents of a given `<image>` can be retrieved using e.g.:
dt_nodelabel(<var> NODELABEL <label> TARGET <image>)
as noted in `extensions.cmake`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
The CMake dt_* API is backed by target properties. By default, it uses
the target named `devicetree_target` that is initialized in `dts.cmake`.
We should be able to customize this, now that we have a function for
loading those properties into a different target. For example:
zephyr_dt_import(EDT_PICKLE_FILE /path/to/edt.pickle TARGET target)
dt_nodelabel(node NODELABEL label TARGET target)
This would make it possible to reference multiple devicetrees in the
same build system, particularly sysbuild.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Extract the part of `dts.cmake` that invokes `gen_dts_cmake.py`, then
generalize it into a CMake extension, which can be reused by sysbuild.
The Python script itself is also updated, so that the generated CMake
file can accept an input variable DEVICETREE_TARGET, which comes from
the `zephyr_dt_import(TARGET ...)` argument.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
The ECLAIR service STD.emptrecd (which checks for empty structures) is now
deprecated.
Use STD.anonstct (which checks for structures with no named
members, an UB in C99)
Based on a change by Nicola Vetrini in the Xen project:
https://lists.xenproject.org/archives/html/xen-changelog/2024-12/msg00125.html
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
While legacy shields are still supported, this introduces a shield.yml
file similar to board.yml that allows to more explicitly declare a
shield and to set some useful metadata such as vendor and full name.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Some simics dependencies live at its own directory, not application's.
Note we need to change it to its absolute path, because relative paths
for `add_custom_target` are relative to the build directory, while
relative SIMICS_PROJECT are more likely to be relative to ZEPHYR_BASE,
from where west or twister are normally run.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Similar to the pre_dt_board.cmake, this is an optional file for
additional arguments that need to get passed to the devicetree compiler.
Signed-off-by: Paul Schaetzle <paulschaetzle@mailbox.org>
Automatically generate a boolean CONFIG_BOARD_REVISION_FOO=y Kconfig
option based on e.g. CONFIG_BOARD_REVISION="foo".
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit allows comments to reference files with paths that are relative
to the Zephyr workspace root. This is done by adding a new argument
'--workspace-dir' to the 'gen_edt.py' script, which is passed to the
'EDT' and 'DT' classes and used instead of the current working directory.
The workspace directory is set to WEST_TOPDIR if West is in use,
otherwise it is set to the parent directory of ZEPHYR_BASE so that
Zephyr files have a 'zephyr/' prefix.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This will implement a way of doing static initialization
the "IAR" way. This is done by calling __iar_data_init3
which handles all static initialization that is mentioned
in the linker file "initialize by copy".
Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
Support to run non secure variants with ARMFVP was enabled with
a7122cf5 and fa45bebc
however, the pattern search doesn't work as expected.
This commit fixes that.
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
Add coverity integration as a SCA variant. This is targetting the
service provided by blackduck to open-source projects available on
scan.coverity.com.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Instead of obscure linker-file hacks providing dummy definitions before
we have the proper generated k-object lookup functions, provide weak
definitions that will be taken out by the real generated implementations
when they are available.
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>