Add a new compiler option to control tracking locations of tokens across
macro expansions. It may be useful to disable it when debugging long
macro expansion chains.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Introduce Kconfig symbol FULL_LIBCPP_SUPPORTED that is similar to the
C version FULL_LIBC_SUPPORTED. This way we can utilize the same
pattern in tests and samples to filter for when a full libc++ is
needed.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
This symbol is selected when the target has any full libc available. This
allows tests to filter on this condition. It doesn't depend on whether the
application actually selects that library, only whether requesting a full C
library would work.
Signed-off-by: Keith Packard <keithp@keithp.com>
Add an explicit compiler configuration, COMPILER_FREESTANDING, which
controls whether the compiler should operate in freestanding or hosted mode
(according to the C and C++ language specifications.
This depends on having a C library which conforms with the language
specification, and the minimal C library does not. Have the minimal C
library select COMPILER_FREESTANDING to continue using freestanding mode
with that library.
For other C libraries, leave this disabled by default while allowing users
to enable it if they want to go back to the previous configuration.
Signed-off-by: Keith Packard <keithp@keithp.com>
Add CONFIG_BUILD_OUTPUT_STRIP_PATHS to allow keeping absolute paths
in the build output.
This can be helpful for IDEs to detect links in a console output and
jump to the code location (e.g. when running tests in native_posix
locally).
Debuggers usually have a path mapping feature to ensure the files are
still found.
Signed-off-by: Martin Jäger <martin@libre.solar>
Add a Kconfig option to set the compiler save-temps flag and set the GCC
implementation. This is very useful for troubleshooting macro expansion
issues, having an option allows a user to set it like any other config
option.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This moves CONFIG_LLVM_USE_LD into cmake/toolchain/llvm as this
is a toolchain kconfig. Also make it a choice to allow the use
of LLVM's lld as linker.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The commit adds CONFIG_MCUBOOT_CMAKE_WEST_SIGN_PARAMS Kconfig
option to allow passing arguments to west sign.
The option is used to pass arguments that immediately follow
west sign in cmake invocations and replaces hardcoded
"--quiet" parameter, but defaults to the "--quiet" value to
keep current behaviour.
New Kconfig option allows to pass arguments to west sign
without modifying cmake/mcuboot.cmake.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
LEGACY_INCLUDE_PATH has been defaulting to "n" and marked as deprecated
in both v3.2 and v3.3. Drop the option entirely for v3.4.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Move extra warning option from generic twister script into
compiler-dependent config files.
ARCMWDT compiler doesn't support extra warning options ex.
"-Wl,--fatal-warnings". To avoid build fails flag
"disable_warnings_as_errors" should be passed to twister.
This allows all warning messages and make atomatic test useles.
Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
In some architectures the linker performs global optimization relaxing
address modes and changing intructions in the output object file. This
is a problem when userspace is enabled since it assumes that addresses
won't change after certain build stage. In no supported architectures
this option is ignored.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Update UF2 family ID for the entire STM32F4 series, except STM32F407xx
which have their own dedicated IDs.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
imgtool could be used for many things, but
CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS, despite it's generic name, is only
applied when signing. Make it even more clear in the prompt and help
text that it's limited to signing.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This adds a choice of three different libc API buffer overflow detection
modes:
* None
* Compile-time
* Compile-time and Run-time
These correspond with the clang/gcc _FORTIFY_SOURCE modes (0/1/2).
_FORTIFY_SOURCE depends on compiler optimizations and require libc support
which the minimal C library doesn't include, so _FORTIFY_SOURCE is disabled
by default in those cases. Native tooling might also enable
_FORTIFY_SOURCE, so don't enable it by default in that case either.
Signed-off-by: Keith Packard <keithp@keithp.com>
Linker scripts contains a `.last_section` section that is placed in rom
region as NOLOAD for the purpose of retrieve the actual number of bytes
contained in the image. See d85efe0b10
However, a previous section may cause the location counter to be
incremented for alignment purposes. This can result in the size of the
image to be 0x10FA but location counter to be 0x1100 because it has been
aligned for next section placement.
Therefore, two new Kconfig settings are introduced.
Those settings request the linker to will write a pattern in
`.last_section`. Together with removing NOLOAD and writing a patten to
the section then we ensure that data is written after alignment of
location counter, and thereby forces the image size to be in sync with
the location counter.
The default pattern used will be 0xE015 (end of last section).
Some systems may fill up the flash completely, or simply write data at
the end of the flash, which in both cases can result in overflow.
Therefore, the new settings can be disabled.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Use XOSHIRO random number generator if target has entropy generator.
Some entropy generators may have limitations (e.g. only thread context)
which would conflict with ztress usage.
Added Kconfig.defconfig for testsuite.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
In order to ensure that builds properly reflect the use of binary blobs,
it is important to markt the build as tainted. For that purpose
introduce two new Kconfig options that ultimately will be reflected in
the build image itself.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Commit cd7c44a152
("Kconfig: flag LEGACY_INCLUDE_PATH as deprecated") forgot to select
DEPRECATED when deprecating a Kconfig option. Fix it.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Move Kconfig.dts before modules so that any of the auto generated
symbols will be available to module Kconfigs.
Signed-off-by: Kumar Gala <galak@kernel.org>
Change the default config for LEGACY_INCLUDE_PATH to 'n'.
This makes any test or sample fail CI if there's any #include missing
the "zephyr/" prefix.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This adds two new Kconfig settings.
The first setting `DEPRECATED` which is a promptless symbol.
This symbol must be selected by any deprecated setting when enabled.
The second setting is `WARN_DEPRECATED` which is a user controlled
setting that configures the build system to print a warning when a
deprecated feature is enabled.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Optional way for generating symbols file using binutils. This file will
be generated on demand for tests which will then be parsed by twister to
create an accurate test plan from the listed testcase/suites.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
There are few cases where removing this enforcement is desirable:
- linking against binary C++ libs with incompatible type mangling
- linking against system provided headers i.e. native_posix
- compiling with legacy code that assumes a different convention
So let's create a Kconfig symbol for it. This is IMHO a good compromize
compared to using the %"PRId32" abomination everywhere otherwise.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add a Kconfig to disable non prefixed includes. By setting
`CONFIG_LEGACY_INCLUDE_PATH=n` developers can disable having
`include/zephyr` in the search path. This means that includes such
as `#include <kernel.h>` will no longer work.
Internally, every header should be updated to add the `zephyr/`
prefix to the headers. Only then, will developers be able to use
this config value for their applications.
Signed-off-by: Yuval Peress <peress@google.com>
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:
sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
UF2 offset configurable to be either flash base reg + offset,
or simply the flash bare reg if the offset is configured
to be ignored.
Signed-off-by: Peter Johanson <peter@peterjohanson.com>
This commit adds support for adjust the addresses of the final image.
This is useful when the image is to be flashed at a location different
from the LMA address encoded in the ELF file by the linker.
An example use-case is multicore systems where core A might load image
from a flash partition into RAM in order for core B to execute and load,
but where the image itself is build with the RAM addresses as LMA.
It updates the zephyr_image_info.h header with information of adjustment
value.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit adds the `gen_image_info.py` script which supports creation
of a header file with image information from the EFL file.
This version populates the header file with:
- Number of segments in the image
- LMA address of each segment
- VMA address of each segment
- Size of each segment
The header file can be used by a secondary build system which needs this
information.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Select configuration when mcuboot is enabled.
At this moment, only UNSIGNED image is supported as per
Espressif's mcuboot porting.
This also updates esp32 runner to use proper bin_file name
and updates default bootloader check.
Move CMakeLists.txt content from board to soc directory
as this support is for esp32 architecture and not board
specific.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This commit adds a change to support running west sign command even if
the keyfile is not provided. Default value of the configuration
is set to n in order to maintain backward compatibility.
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
The PR #39382 raised a discussion on build reproducibility and knowledge
of west projects being out of sync with the west manifest.
Similar to how `git submodules` will report the working tree dirty if
any of the submodules HEAD points to a SHA different than the one
recorded in the super project.
Based on this discussion this commit extends the Zephyr and manifest
repo (when `west` is used) revisions to include the concatenated states
of the workspace.
The workspace states are:
> dirty: false / true
> extra: false / true
> off: false / true
the final revision will become: <SHA>-<state1>-<state2>-<state3>
For example:
> zephyr:
> path: /.../zephyr
> revision: <SHA>-dirty-extra-off
or
> zephyr:
> path: /.../zephyr
> revision: <SHA>-extra
The `BUILD_OUTPUT_META_STATE_PROPAGATE` Kconfig setting is introduced
to provide user control of this behavior.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The PR #39382 raised a discussion on build reproducibility and knowledge
of west projects being out of sync with the west manifest.
Similar to how `git submodules` will report the working tree dirty if
any of the submodules HEAD points to a SHA different than the one
recorded in the super project.
Based on this discussion this commit extends the Zephyr build meta file
with overall workspace status included in the meta file.
It adds the following meta info to the build meta file:
> workspace:
> dirty: false / true
> extra: false / true
> off: false / true
A project using west and having an extra Zephyr module loaded not
controlled using git and a west project at a SHA different than the
SHA referenced by the manifest can look like:
zephyr:
path: /.../zephyr
revision: 863600cd0e
modules:
- name: mcuboot
path: /.../bootloader/mcuboot
revision: c61538748ead773ea75a551a7beee299228bdcaf
- name: local_module
path: /.../local_module
revision: null
west:
manifest: /.../zephyr/west.yml
projects:
- path: /.../zephyr
revision: 863600cd0e
- path: /.../bootloader/mcuboot
revision: c61538748ead773ea75a551a7beee299228bdcaf-off
- path: /.../tools/net-tools
revision: f49bd1354616fae4093bf36e5eaee43c51a55127
workspace:
dirty: false
extra: true
'off': true
And without west:
zephyr:
path: /.../zephyr
revision: 863600cd0e
modules:
- name: hal_nordic
path: /.../modules/hal/nordic
revision: a6e5299041f152da5ae0ab17b2e44e088bb96d6d
- name: local_module
path: /.../local_module
revision: null
workspace:
dirty: false
extra: true
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is motivated by the west discussion in:
https://github.com/zephyrproject-rtos/west/issues/548
The commit provides the ability to generate a build meta info file
containing lists of:
- Zephyr: path and revision
- Zephyr modules: name, path, and revision
- West: manifest path
path and revision for each project
For Zephyr or Zephyr modules the revision will be `null` if it is not
under git version control.
If Zephyr, a modules, or a project has uncommitted changes, the revision
will be marked dirty.
If west is not installed or used for the build process, the
west-projects list will be empty.
If a project is both a Zephyr module and a west project it will show up
in both lists.
Similar to Zephyr, which is independently referred as the Zephyr in use
but also listed as west project when west is used.
This is important in case ZEPHYR_BASE was manually set and pointing to
a different Zephyr repository.
The build meta file is not created per default but can be enabled with
the BUILD_OUTPUT_META Kconfig setting.
A project using west and having an extra Zephyr module loaded not
controlled using git can look like:
zephyr:
path: /.../zephyr
revision: 863600cd0e3c0a271e86629c5089821e5e4380cc-dirty
modules:
- name: mcuboot
path: /.../bootloader/mcuboot
revision: c61538748ead773ea75a551a7beee299228bdcaf
- name: local_module
path: /.../local_module
revision: null
west:
manifest: /.../zephyr/west.yml
projects:
- path: /.../zephyr
revision: 863600cd0e3c0a271e86629c5089821e5e4380cc-dirty
- path: /.../bootloader/mcuboot
revision: c61538748ead773ea75a551a7beee299228bdcaf
- path: /.../tools/net-tools
revision: f49bd1354616fae4093bf36e5eaee43c51a55127
And without west:
zephyr:
path: /.../zephyr
revision: 863600cd0e3c0a271e86629c5089821e5e4380cc-dirty
modules:
- name: hal_nordic
path: /.../modules/hal/nordic
revision: a6e5299041f152da5ae0ab17b2e44e088bb96d6d
west: null
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This adds two new Kconfig settings.
The first setting `EXPERIMENTAL` which is a promptless symbol.
This symbol must be selected by any setting which is used to enable
an experimental feature.
The second setting is `WARN_EXPERIMENTAL` which is a user controlled
setting that configures the build system to print a warning when
experimental features are enabled.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
In order to be able to make a "choice" from any other
Kconfig.defconfig (-ish) file, the choice needs to be named.
This commit names a few choices.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Support for ARM Compiler C library.
This commit add support for the ARM Compiler C libary in:
- Kconfig
- libc/armstdc
A new Kconfig symbol is added to allow a toolchain to specify if they
support linking with the minimal C library.
Also the CMake variable `TOOLCHAIN_HAS_NEWLIB` is exported to Kconfig
so that CONFIG_NEWLIB_LIBS can only be enabled if the toolchain has
newlib.
The armclang toolchain selects the CMake scatter file generator and
disables support for the LD linker template which is not supported by
armlink.
For the ARM Compiler C library, a corresponding lib/libc/armstc/ folder
with a minimal implementation to work with the ARM Compiler C library
is added.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
A "Linker script" choice group has been added to the linker options
menu.
The existing HAVE_CUSTOM_LINKER_SCRIPT config has been relocated inside
the linker script menu.
Two new entries has been created:
- LD template, for using the old ld template files together with the C
pre-processor to create the final linker script.
- CMake linker generator, used for ARMClang / armlink toolchain.
The CMake linker generator is also supported for LD linker scripts
for the ARM architecture.
In CMake, the file cmake/linker/ld/target.cmake has been updated to
support the CMake LD linker generator.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With demand paging and pinned sections enabled, it is possible for
data to be brought into physical memory as required by current
execution context. However, the kernel still assumes that all data
pages are present at boot which may not be desirable for certain
scenarios. This introduces a new kconfig to specify that those
data pages other than the boot and pinned sections are not present,
and they would be paged in on demand.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Introduce new Kconfig option MCUBOOT_ENCRYPTION_KEY_FILE. If the
string is not empty Cmake will try to encrypt the final binaries using
the given key file.
Signed-off-by: Helge Juul <helge@fastmail.com>
Always source the Zephyr base soc and shield (board root) Kconfigs
directly from Kconfig instead of generated Kconfig files.
This has the benefit that it is no longer necessary to generate Kconfig
files to source SoC root and shield (board root) when no custom roots
are provided.
Also this cleans up the doc/CMakeLists.txt and ensures that the
doc/CMakeLists.txt is not getting out of sync with the Kconfig.cmake.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>