This reverts commit 8f48758836.
as it's part of a series of commits causing issues on Windows
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
GCC versions starting from 4.3.0 until 12.4.0 stored the limits.h header in
a directory named include-fixed/ . Before 4.3.0 and after 12.4.0 i.e. from
13.1.0 onward, the header is stored in a directory named include/ .
Previously, target.cmake would only detect if the GCC version was 13.1.0 or
newer. This patch adds a check to also check if it is older than 4.3.0.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
A legacy build of GNU ld emits the following version string:
GNU ld version 2.17.50.0.9 20070103
This patch fixes the regex parsing so that the version number is correctly
extracted from the string.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
GCC versions before 7.1.0 do not have the -fno-printf-return-value flag and
give an error if it is used. This patch improves compatibility with older
compilers by making CMake check for the flag's availability before using.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
The -fdiagnostics-color flag is only on GCC versions 4.9.0 and newer.
Previously, CMake only checked that the compiler was not the XCC compiler
before using the flag.
However, given that the flag us unavailable on compilers other than XCC,
e.g. old versions of GCC, this patch replaces the previous logic with a
flag-check using the check_set_compiler_property() CMake function.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
This commit introduce support for maps in a yaml list.
The yaml_set() function has been extended with the following signature:
> yaml_set(NAME <name> KEY <key>...
> [APPEND] LIST MAP <map1> MAP <map2> MAP ...
> )
where a `MAP <map>` has the form:
`MAP "<key1>: <value1>, <key2>: <value2>, ...`
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The schema for build info already contained a `board:path` sequence tag
definition, but boards.cmake did not populate this in the generated
build_info.yml.
Fix this by correctly populating the `board:path` with list of board
directories.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
LLEXT-related files are currently scattered in multiple locations in the
build directory. For easier access, this patch groups the outputs in a
subdirectory named 'llext' at the root of the build binaries, alongside
the 'zephyr' directory. This directory will thus contain the generated
debug ELF and the final .llext file for each compiled extension.
Note that this does not affect out-of-tree projects that use LLEXT,
since they already pass the full LLEXT file path to add_llext_target().
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This patch changes the way extensions are built to allow for debugging
information to be collected. Debug flags are now used when compiling and
linking the extension source code, generating a debuggable ELF file.
The final .llext file is then stripped of unneeded symbols, including
all debugging information, at packaging time.
The debugging flag is still removed from the EDK-exported flags.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This flag is used by LLEXT to strip all unreferenced symbols and
debugging information from a binary.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
cmake: Added "-" support to EXTRAVERSION.
Added to the regex and update the documentation.
Also updated the examples in the documentation.
Signed-off-by: Nick Brook <nrbrook@gmail.com>
cmake: Allow semver style EXTRAVERSION
Semver versions are commonly in the form X.X.X-a.1, X.X.X-beta.2, etc.
However, currently EXTRAVERSION cannot include ".". This change allows it.
Signed-off-by: Nick Brook <nrbrook@gmail.com>
Changes the priority of imgtool so that the preferred version is
the one inside of the MCUboot directory
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Allow user to specify protocol extensions when receiving data
from Ethernet network. This means that user can register L3
protocol handler using NET_L3_REGISTER() with the desired
protocol type. Ethernet code will then call the handler if
such a protocol type packet is received. This is currently
only implemented for Ethernet. The original IPv4 and IPv6
handling is left intact even if they can be considered to
be L3 layer protocol. This could be changed in the future
if needed so that IPv4 and IPv6 handling could be made
pluggable protocols.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The elfconvert_flag_lma_adjust property is required when using
CONFIG_BUILD_OUTPUT_ADJUST_LMA, but was missing for LLVM.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The `xtools` toolchain variant, which was originally introduced to be used
with the Crosstool-NG-based Zephyr SDK toolchains and has been replaced by
the `zephyr` toolchain variant, has been marked as deprecated since Zephyr
v3.3.0.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Add support to run unit tests directly from `west build`, for
environments where `west build -t run-test` (which runs the binary under
valgrind) is inappropriate or unavailable (WSL).
`west build -t run` also has the muscle-memory advantage of being the
same target name as the `native_sim` boards.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Recently, the "Generated zephyr.dts" message started being shown twice,
because of some now redundant code that was left behind by commit
fe3287a9ac.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Add the cmake files for running static code analysis with the Polyspace
tools in the west build. The analysis leverages the compilation database.
Options for the analysis are documented in doc/develop/sca/polyspace.rst.
Analysis results are printed as command line output and provided as CSV.
Manually tested on v4.0.0 with various sample applications.
Signed-off-by: Martin Becker <mbecker@mathworks.com>
Adds support for sysbuild loading snippets, these can be included
by using e.g.: cmake ... -DSB_SNIPPET=blah for sysbuild
directly or can be used with an application and sysbuild using
-DSNIPPET. Snippets for sysbuild can use SB_EXTRA_CONF_FILE in the
snippet file to specify an extra Kconfig fragment for sysbuild
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Targets are not available in script mode.
To support the Zephyr scoping feature used by snippets and yaml module
then this commit moves from using custom targets to use GLOBAL
properties for scopes.
A scope property is prefixed with `<scope>:<property>` to avoid naming
collisions.
A `scope:<scope-name>` global property is used to track created scopes.
Tracking valid scopes ensure that properties are only set on known
scopes and thus catches typos / naming errors.
Add zephyr_scope_exists() and zephyr_get_scoped() to abstract the
implementation details of the scoped property retrieval and refactor
current code to use them.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This reverts commit 9d849d92bf that seems to
be causing dozens of basic kernel test failures across various platforms.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
STACK_CANARIES was enabling canaries in all functions using the compiler
flag -fstack-protector-all. This became confuse with the addition of the
options STRONG and EXPLICIT.
This commit adds the missing option (default level) and disambiguous the
options mapping them close to the compiler flags.
Now we have the following options:
STACK_CANARIES -> fstack-protector
STACK_CANARIES_STRONG -> fstack-protector-strong
STACK_CANARIES_ALL -> fstack-protector-all
STACK_CANARIES_EXPLICIT -> fstack-protector-explicit
Note that from now on STACK_CANARIES_ALL is the symbol that adds canaries
for all functions.
Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
Add option to enable stack canaries only when explicitely
declared. It adds a new function attribute, __stack_protect, that
can be used to enable stack protection in a function.
Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
Previously, when stack canaries were enabled, Zephyr applied this
protection to all functions. This commit introduces a new option that
allows stack canary protection to be applied selectively to specific
functions based on certain criteria.
Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
CMakeLists.txt uses the C compiler parameter -include,
This is causing issues for other toolchains and needs to generalized.
Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
Add a check to set the warnings_as_errors flags in unit tests if
CONFIG_COMPILER_WARNINGS_AS_ERRORS is specified, this should catch
warnings in unit test twister runs.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This flag is set on other compiler as well for normal builds, and
suppresses a warning for empty print, which is apparently quite common.
The unit test build uses its own flags so set it there as well to get
the same behavior as with the rest of the code base.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Some Python scripts need to access to the underlying OS, like
using redirections. These interactions go through TTY interface.
On MinGW, these interactions/interfaces are called 'winpty'.
=> use them when available (harmless on platform *NIX platforms)
Signed-off-by: Cedric Lescop <cedric.lescop@se.com>
Improve Simics support for `boards/intel/ish/intel_ish_5_8_0`
for better integration with the simulator.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Add `zephyr,memory-region-flags` for supporting memory region flags
setting.
For example, when the below node is in the devicetree,
```
test_sram: sram@20010000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = < 0x20010000 0x1000 >;
zephyr,memory-region = "FOOBAR";
zephyr,memory-region-flags = "rw";
};
```
We get the following line in MEMORY section of linker script.
```
FOOBAR (rw) : ORIGIN = (0x20010000), LENGTH = (0x1000)
```
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Original implementation of `toolchain_linker_finalize` duplicates
the `LINK_FLAGS` in the link command. This can cause some problems
like duplicate definitions when using link options like
`--whole-archive`.
This commit fixes it by removing the duplicate `LINK_FLAGS`.
Fixes#82281
Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
The llvm-objcopy doesn't support a gap-fill argument, therefore clear
the property to remove the error:
> llvm-objcopy: error: unknown argument '--gap-fill'
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Extend the device subsystem enumeration script to produce a CMake
pre-load script.
This allow CMake linker generator scripts to create iterable sections
based on output from device subsystem enumeration.
This ensures that same functionality is available in both ld linker
templates and the linker generator.
Update linker generators to support the use of the device subsystem
enumeration CMake pre-load script.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Create a CMake preload file with linker settings which is then passed
to the linker script generator as preload file.
This removes the need for command invocation with long arguments.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
CMAKE_LINKER_GENERATOR common-ram.cmake is out of date.
This updates it to keep it up to date with common-ram.ld
Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
Get eclair specific option file variable via zephyr_get.
This is also needed if the sca is invoked with sysbuild so it uses
the intended file.
Signed-off-by: Simon Hein <Shein@baumer.com>
Add support for the rtt target so that users can run
`west build -p auto -b <board> -t rtt <app>`
similarly to the way that users can now do so with the debug
target, since the rtt target is supposed to be used in a similar
way.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>