Add a tree node to group files under WORKSPACE so that
they won't be shown with full path. The WORKSPACE is
usually the same as WEST_TOPDIR unless ZEPHYR_WORKSPACE
is defined during build.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fixes part of: #32448
This commit updates the CMake CMAKE_CXX_LINK_EXECUTABLE to include
crtbegin.o and crtend.o at the right locations when linking with gcc.
It also updates linker scripts to ensure proper location of the
exception header frame sections.
This ensure proper handling of exceptions for those architectures
- x86
- xtensa
- riscv32
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
After the ARM/ARM64 split the SDK 0.12.4 is needed to be able to compile
the ARM64 arch code. Bail out if an old SDK is detected at compile time.
Also change the minimal supported Zephyr SDK to v0.12, as agreed in
Toolchain WG. Main reason is added compiler architectures and important
inclusion of fixes, for example qemu and arm fixes for veneers (TFM)
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Due to the fact that we use -mcpu=hs as a default for ARCv2 HS
the compiler doesn't generate multiply/divide/mac/64bit memory
operations instructions.
Fix that by using -mcpu=archs as a default for ARCv2 HS which is
fits for all existing boards with ARCv2 HS CPU.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Fixes: #32237
When building for native_posix, then host tools are used.
This means that gcc will link using `/usr/bin/ld` per default.
If ld points to lld, then linking will fail.
This commit will first look for ld.bfd, and if found then use
-fuse-ld=bfd for linking. If ld.bfd is not found, then ld is used as
fallback as that will be assumed to be the best working candidate.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
There is a comment which needed to be rephrased for inclusive
language. This commit replaces it with the recommended
replacement.
Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
Adds no-threadsafe-statics to compiler flags for gcc and arcmwdt.
The flag is required to compile the samples - the module can compile
without it.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Follow-up: #34842
This is a follow-up commit that ensures relevant version information
regarding the build is located together as discussed in #34842.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
If user is specifying `-DBUILD_VERSION=<value>` then the proper way to
test is using `NOT DEFINED BUILD_VERSION`.
The difference between `NOT DEFINED BUILD_VERSION` and
`NOT BUILD_VERSION` is that a user specifying `-DBUILD_VERSION=0` will
result in `NOT BUILD_VERSION` becoming true, whereas
`NOT DEFINED BUILD_VERSION` would be false, which is the correct
behavior here, as the user actually provided a specific BUILD_VERSION.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Do basic preparations for building code for ARCv3 HS6x
* add ISA_ARCV3 and CPU_HS6X config options
* add off_t type support for __ARC64__
* use elf64-littlearc format for linking
* use arc64 mcpu for CPU_HS6X
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
As of today we check against CPU_ARCHS config option which may be
related to different HS CPUs (i.e. ARCv2 HS, ARCv3 HS, etc...).
Let's check against exact HS CPU type (CPU_HS3X) as we do EM
processors.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
In an ideal world, good CIs make it very clear what exact git versions
are getting built. However:
- Zephyr is (re-)used in many projects and they cannot all be expected
to have ideal CI.
- CI with multiple git repos is complex (#34713) which makes the world
an even less ideal place: much more chance for some git versions to be
missing.
- Many developers don't realize that Github and other CIs do not test
pull/12345/head but the moving target pull/12345/merge instead. While
not resolving pull/12345/merge completely (maybe another day), this
commit provides at least evidence that pull/12345/head is NOT the
commit tested.
So the addition of the following line in the logs is a very small price
to pay that can save enormous amounts of time when trying to understand
some obscure build failures.
-- BUILD_VERSION=zephyr-v2.5.0-2957-g6230b5bb66bc
Note this obviously does not provide any git information when
BUILD_VERSION is overriden but it does not hurt either in this case:
knowing BUILD_VERSION was overriden is also useful.
The "BUILD_VERSION is left undefined" message was just wrong in
the (unlikely) case `git describe` printed something while also
failing. Remove it; it's so much simpler to just print $BUILD_VERSION
and give the direct, unfiltered information.
Note this simplification is also a partial revert of 1b80f00f56
which threw the entire git warnings "baby" with some obscure duplicate
1.13.0 "bathwater" that is not relevant any more and that I guess barely
anyone noticed even at the time.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes: #34368
Now added WEST_PYTHON to list of preferred pythons to check.
WEST_PYTHON is added after PYTHON_PREFER so that a user may still
request a specific python is used by supplying
`-DPYTHON_PREFER=<python>` even when building using `west build`.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Today, there is a build target is added for each runner: flash, debug,
debugserver, attach.
And those runners will have a dependency to Zephyr logical target that
is built before invoking `west <runner>`.
This design has some flaws, mainly that additional dependencies directly
on the target will not be built when running `west <runner>` directly.
That generator expressions cannot be used for the DEPENDS argument.
Instead, the build target `<runner>` will not have any dependencies, and
will raise a build error if a dependency is added to the target.
Due to how `add_dependencies()` work, this must be done as a build time
check, and not configure time check.
`west <runner>` will invoke a build before executing the runner, and
this way ensure the build target is up-to-date, which again removes the
need for a dedicated `west_<runner>_target`.
It also minimizes the risk of developer errors, as developers no longer
need to consider the need for adding additional dependencies.
If a custom target is part of the default `all` build, then it's ensured
to be up-to-date.
Fixes: Issue reported on slack.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Some targets require *strip* command. This command was not
being set when selecting llvm toolchain.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
When compiler results are piped through a non-terminal (e.g. ninja)
the compiler disables colour diagnostics. Using `-fdiagnostics-color`
forces the compiler to enable colour output. This flag is set for
clang and gcc when `ZEPHYR_BUILD_COLOUR_DIAGNOSTIC` environment
variable is set when a clean build is started.
Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
The parameter can be used to limit the ram and rom reports to a
certain depth. The resulting graphs with depths of e.g. 3 or 4 are
visually easier to grasp.
Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
Use -march=armv8.4-a to compile zephyr on cortex-R82.
Because Cortex-R82 has not been enabled in GCC 10.x currently.
Signed-off-by: Jaxson Han <jaxson.han@arm.com>
Add arm fvp emulator in order to use ninja run or west build -t run.
Add armfvp in order to run twister.
Set env ARMFVP_BIN_PATH before using it,
e.g. export ARMFVP_BIN_PATH=<path/to/fvp/dir>
NOTE: ARMFVP_BIN_PATH is the dir path.
Signed-off-by: Jaxson Han <jaxson.han@arm.com>
The system include directory might include spaces on windows, so quote
it.
Partially part of fix for #32111
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The usage of EXTRA_DTC_FLAGS was removed in commit
269f350487
If ninja was used and e.g. menuconfig is called, when more than one
element is in EXTRA_DTC_FLAGS, calling "ninja menuconfig" failed.
E.g.
west build -b lpcxpresso55s28_ns -t menuconfig samples/hello_world
resulted in and error. This is fixed with this commit.
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Split ARM and ARM64 architectures.
Details:
- CONFIG_ARM64 is decoupled from CONFIG_ARM (not a subset anymore)
- Arch and include AArch64 files are in a dedicated directory
(arch/arm64 and include/arch/arm64)
- AArch64 boards and SoC are moved to soc/arm64 and boards/arm64
- AArch64-specific DTS files are moved to dts/arm64
- The A72 support for the bcm_vk/viper board is moved in the
boards/bcm_vk/viper directory
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add initial support for the Cortex-M55 Core which is an implementation
of the Armv8.1-M mainline architecture and includes support for the
M‑profile Vector Extension (MVE).
The support is based on the Cortex-M33 support that already exists in
Zephyr.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Fixes: #33138
Board alias and deprecated board handling is setting the BOARD variable
after zephyr_boilerplate_watch(BOARD) has been executed.
This results in the board changed warning.
This commit moves the zephyr_boilerplate_watch(BOARD) code below the
board alias and deprecation handling.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
-P is an option that was inherited from the old MetaWare compiler.
[ccac foo.c -P] is actually a shortcut for: [ccac -E foo.c -o foo.i].
In new version of mwdt, -P option can't redirect the output. we need
to use -E option, which works in all versions.
-P: Preprocess the file and write it to <src>.i (C) or
<src>.ii(C++). No compilation is performed.
-E: Run preprocessor only.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
`west` is an optional tool.
Although `west` is optional, a developer might be working with both west
and non-west based projects, like
- vanilla Zephyr (using west)
- downstream project (not using west)
and thus have west installed, but not always in use.
In the downstream project scenario not using west, then running CMake
will print the following error:
```
FATAL ERROR: no west workspace found from "<path>/zephyr";
"west topdir" requires one.
Things to try:
- Change directory to somewhere inside a west workspace and retry.
- Set ZEPHYR_BASE to a zephyr repository path in a west workspace.
- Run "west init" to set up a workspace here.
- Run "west init -h" for additional information.
```
This commit sets `WEST` CMake variable to `WEST-NOTFOUND` when west is
found but Zephyr is not in a west workspace (`west topdir` fails)
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With the introduction of #32556 changing the BOARD now prints a warning.
Zephyr provides `zephyr_file()` to look up overlays and Kconfig
fragments for a specified board, and it used to be possible and safe to
do:
```
function(my_func)
set(BOARD <local_scope_board>)
zephyr_file(CONF_FILES ...)
endfunction(my_func)
```
As the BOARD inside `my_func` is locally scoped, this is safe to do.
But with introduction of #32556 a warning is now printed when running
CMake.
Therefore `zephyr_file` has been extended to allow for optional BOARD
and BOARD_REVISION arguments.
If BOARD is not given as argument the current BOARD in the build system
will be used.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Watching of specific Zephyr CMake build variables ensure users cannot
accidentally set important variables, such as BOARD, SHIELD, CONF_FILES
late in the build process.
This was also added to zephyr_check_cache() function.
However, the BOARD provided by the user may look as `<board>@<revision>`
and will be kept in the cache in that form.
However, the BOARD value from cache is spit into internal build
variables as: BOARD=<board> and BOARD_REVISION=<revision>.
However, this is done after `zephyr_check_cache()` which then triggers
the variable watch to trigger, and printing a warning when using board
revisions.
Therefore WATCH is now optional for `zephyr_check_cache()` and watch for
BOARD variable will be enabled when boilerplate has completed all board
handling.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
We don't use xcheck (we disable it by passing '-Hnoxcheck' to
linker) so let's avoid xcheck object linkage as well by
passing '-Hnoxcheck_obj' option.
'-Hnoxcheck_obj' option implies the '-Hnoxcheck' option.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Remove duplicates from ZEPHYR_MODULE_NAMES only if that list
exists. That avoids cmake error "list sub-command REMOVE_DUPLICATES
requires list to be present" if ZEPHYR_MODULE_NAMES is empty.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
Some toolchain variants come with no clang support, so do not assume
clang by default and enable this using the enviornment variable
XCC_USE_CLANG.
export XCC_USE_CLANG=1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
People frequently do things like setting BOARD_ROOT to
/my/module/boards/arm/my_board when it should be set to /my/module.
Similar misconfigurations happen for SOC_ROOT.
Emit warnings in these situations to try to point users in the right
direction.
A similar change could be made for DTS_ROOT, but that is trickier
since at least one directory (the application root) is legitimately
added to it that does not always contain dts/ or include/
subdirectories.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
To remove the need of empty config files, the `board_check_revision()`
now accepts a list of valid revisions.
As example:
```
board_check_revision(
FORMAT MAJOR.MINOR.PATCH
VALID_REVISIONS 0.1.0 0.5.0 0.10.0
)
```
The code is still compatible with the `<board>_<revision>.conf` changes
so that if different revisions of a board has Kconfig differences, then
there is no need to also specify the list of valid revisions.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Make sure the flags in EXTRA_DTC_FLAGS are valid for the version of dtc
we have and only invoke dtc with flags it supports.
Fixes#32644
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Fixes: #32269
This commit is a followup to #31877 where the `${shield_dir}/${s_dir}`
was adjusted to `${SHIELD_DIR_${s}}` to ensure only including shields
and not boards in list of known shields.
An `if(EXISTS ${shield_dir}/${s_dir}...)` was missed in this process
which causes #32269. This is corrected in this commit.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Several variables must be set by the time boilerplate.cmake is run.
This includes BOARD, SHIELD, CONF_FILE, and DTC_OVERLAY_FILE.
It's not always clear to users that this is the case, and we sometimes
see attempts to modify these variables in app CMakeLists.txt files
after find_package(Zephyr ...) lines, where they will have no effect.
This causes confusion.
Add a new extension function, zephyr_boilerplate_watch(), which traps
attempts to set these variables and prints a noisy warning. Use it
from boilerplate.cmake on the variables mentioned above.
This will hopefully make it clearer at build time why the changes are
being ignored.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add ability to build a UF2 (https://github.com/Microsoft/uf2)
image as an additional output type. This leverages the code
partition offset for the UF2 base address, and a configurable
UF2 family ID.
Includes an unmodified (except for headers for licensing, pylit
disabling) version of the uf2conv.py script copied the UF2
format specification repository, used to convert the bin to UF2.
Origin: UF2 file format specification reference utilies
License: MIT
URL: https://github.com/microsoft/uf2/blob/master/utils/uf2conv.py
commit: 587abb8b909266e9b468d6284f2fbd425235d1b5
Signed-off-by: Pete Johanson <peter@peterjohanson.com>
Treat shield directories containing a dts subdirectory as a DTS root
directory.
This allows shield specific devicetree include files and bindings to be
stored under the shield dts subdirectory.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The following two lines are duplicated in boilerplate.cmake
```
zephyr_file(APPLICATION_ROOT BOARD_ROOT)
list(APPEND BOARD_ROOT ${ZEPHYR_BASE})
```
This commit removes one set of the duplicated lines.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>