Always print the note to make sure it isn't missed, but make it easy to
disable (by creating an empty file).
The note will be removed later.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
CMake has several prototypes/signatures for the function
'target_link_libraries'. This commit migrates the usage of
'target_link_libraries' on Zephyr CMake libraries from the old 'plain'
signature to the new '<PRIVATE|PUBLIC|INTERFACE>' signature.
For technical reasons the two signatures can not be mixed. Each
library must exclusively use either the old or new signature.
The 'old' plain signature is equivalent to using the PUBLIC
signature. Migrating to use 'PUBLIC' is therefore expected to be a
safe change.
After the migration it will be possible to use the PRIVATE and
INTERFACE signatures on Zephyr CMake libraries. This is useful for
instance to fix issue 8438.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The old GCC ARM Embedded website on launchpad
(https://launchpad.net/gcc-arm-embedded) has been superseeded by the new
GNU Arm Embedded one
(https://developer.arm.com/open-source/gnu-toolchain/gnu-rm).
This also means a change of name from "GCC" to "GNU". Reflect this in
the enviroment variables so that the proper term is used henceforth.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Due to a misspelling in the existence check for the stored checksum
file, zephyr/.config was always regenerated from the config fragments
(e.g. prj.conf), overwriting any custom zephyr/.config configuration
done in e.g. menuconfig.
This bug was introduced by commit 5402662dd9 ("cmake: kconfig: Fix
rerunning cmake after Kconfig warnings").
Fixes: #9270
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Commit b3d165f ("scripts: kconfig: Handle warnings generated
during evaluation") made it common for kconfig.py to fail after writing
zephyr/.config. This confuses the configuration fragment checksum logic
in cmake/kconfig.cmake, because it expects the saved checksum file to
exist if zephyr/.config exists.
The end result is a CMake error when rerunning the configuration after
non-whitelisted Kconfig warnings.
Fix it by only writing zephyr/.config (and zephyr/include/autoconf.h) in
kconfig.py if there are no warnings-turned-errors.
Also check if the saved checksum file exists in kconfig.cmake before
trying to open it. Normally this shouldn't happen though.
Move the writing of the checksum file to before writing zephyr/.config
as well. That way, zephyr/.config only gets written if the other
operations succeed.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
When the SDK/toolchain has been incorrectly installed such that the
user does not have permissions to execute it an incomprehensible
errror message occurs.
This patch tests that executing 'gcc --version' does not give an error
code and errors out with an appropriate error message if it does.
This fixes#8977
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
In order to merge multiple files into a single one, this convenience
script is provided to be able to do so at build time in a manner
compatible with all operating systems.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In order to be able to execute a process at build time (and not at
configure time) in a cross-platform manner while at the same time
redirecting stdout and stderr to files, add a script that wraps CMake's
execute_process() command.
The script can be invoked with identical parameters to execute_process()
but at build time, allowing CMake users to store stdout and stderr in
files in a way that works on all operating systems.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
SDK 0.9.3 has been out for a while, to avoid inconsistency and false
positive when filing bugs, require the latest version.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Latest crosstools NG supports ARC, so add it here for those who build
their own toolchains using xtools-ng or use the scripts from sdk-ng repo
in the zephyr project.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Older Git versions still do not support the -C argument for specifying
the working directory. Switch to using cmake WORKING_DIRECTORY instead.
This fixes#7287 again after commit 5e7e1cb.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit updates the compile options in cmake to distinguish
between ARMv8-M Mainline MCUs with or withouth the optional DSP
extension. A new Kconfig option: ARMV8_M_DSP, is introduced, to
signify the use of an ARMv8-M MCU with DSP support.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Add an LLVM backend and a clang toolchain variant to support building
with llvm coming with popular Linux distributions.
This has been tested with X86 boards:
- quark_d2000_crb
- quark_se_c1000_devboard/Arduino 101
Use:
export ZEPHYR_TOOLCHAIN_VARIANT=clang
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This resolves#5723 by adding support for assigning to Kconfig options
from the CMake CLI.
CMake CLI Kconfig options can be specified like so:
'cmake -DCONFIG_ASSERT=y'
The lifetime of such an option is the same as the lifetime of a CMake
cache variable, and in principle any method of populating the
CMakeCache could be used, such as cmake-gui.
This has been implemented by scanning the CMakeCache variables before
Kconfig is executed and writing any that are prefixed with 'CONFIG_'
to a new Kconfig fragment in the build directory that is merged in
with a high precedence.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The "git describe" call for setting the boot banner is broken. The
--work-tree option sets the checked out work tree, not the directory
containing .git, which is where git describe needs to look for
information on tags.
Use -C instead so it's as if Git were run from the zephyr base
directory instead.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Both variables were used (with the same value) interchangeably
throughout CMake files and per the discussion in GH issue,
ZEPHYR_BASE is preferred.
Also add a comment with explanation of one vs. the other.
Tested by building hello_world for several boards ensuring no errors.
Fixes#7173.
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Modify CONF_FILE variable treatment in the cmake infrastructure
to enable the use of CMake lists and semicolon-separated strings
in setting the CONF_FILE list for multiple configuration files.
This change does not impact the current method of using
single-space-separated strings for multiple files.
Signed-off-by: Michael R Rosen <michael.r.rosen@intel.com>
The flash script was broken after the cmake changes.
Updated the path needed for the flash scripts.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Someone doing bisects on Zephyr will have to have both older
ZEPHYR_GCC_VARIANT and newer ZEPHYR_TOOLCHAIN_VARIANT environment
variables defined. Then warning about ZEPHYR_GCC_VARIANT is
confusing. Issue it if only ZEPHYR_GCC_VARIANT is defined, and
ZEPHYR_TOOLCHAIN_VARIANT isn't.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This cmake macro was changing the control flow of the cmake files.
It is not advisable to modify the callee control flow from inside
a cmake macro.
Hence removing all instances of this macro from the build system.
Fixes: GH-7565
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
The Kconfig option TOOLCHAIN_VARIANT (not to be confused with
ZEPHYR_TOOLCHAIN_VARIANT) is a legacy configuration option that has
very few use-cases and can easily be dropped.
It's functionality is easily covered by CONFIG_X86_IAMCU and
ZEPHYR_TOOLCHAIN_VARIANT.
This commit removes all references of it from Zephyr.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Continue better integration of the runner subpackage into west by
moving the common runner configuration options into the command
core. This allows commands like "west flash -h" to display help for
common overrides like --kernel-hex.
Adjustments needed to make this happen are:
- Change the build system to separate common configuration values from
runner-specific options and arguments
- Prepare the runner core by defining a new RunnerConfig class that
represents the common configuration, and accepting that from a new
create() method, which replaces create_from_args().
- Convert all concrete runner classes to use the new style of
argument parsing and initialization.
- Group the command options appropriately for help output readability
There's still a bit of tool-specific stuff in the common
configuration (gdb and openocd configuration in particular); a more
generic way to deal with that will be necessary to better support
things like non-GDB debuggers, but that's out of scope of this patch.
All the runner-specific options are still in the runner packge, which
currently prevents them from being included in "west flash -h" etc.
Fixing that is also out of scope of this patch.
This has the ancillary benefit of getting rid of the legacy 'debug'
argument to ZephyrBinaryRunner, which is no longer appropriate since
verbose debug logging is handled by log.py in west.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Since, by design, the west 'flash', 'debug', and 'debugserver'
commands operate the same way as the Makefile targets when given no
arguments, so just delegate to west from cmake/flash/CMakeLists.txt
instead of invoking zephyr_flash_debug.py by hand.
Removing the old script is the first step towards being able to clean
up the command line argument handling in the runner package, which was
always kind of a hack and can be improved now that runner is part of a
larger tool.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
This is a stepping-stone to adding runner functionality into west
itself.
Since all of the runner tools assume a Zephyr build directory layout,
this doesn't put anything generic into a Zephyr-specific tool.
Make minimal adjustments to zephyr_flash_debug.py to keep existing
build system targets working unmodified.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Persist all the important information needed by the runner package to
the CMake cache. This serves as a parseable record for various tools
which need to understand how to run the binary.
In particular, it will be used by the west tool, which will be
introduced in subsequent patches.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Add a variant on generate_inc_file_for_target in which the user can
specify the target that the generated file will depend on. This allows
exposing that target to other possible places where a dependency on the
generated file existing might be needed.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This used to be done by hand but can easily be generated like
we do other switch statements based on object type.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Checks if a certain Kconfig is enabled and then do the same
operation as zephyr_library.
If it finds that the Kconfig is not set it will not
create a new library and will stop processing the rest of
the CMakeFile.txt. Usefull in processing the driver Cmake
files.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
The original em7d, em9d and em11d are different configurations of
em_starterkit. They have the same peripherals, e.g. uart, spi, gpio
, ddr. The differences of them are in arc core configurations, interrupt
number assignment.
So em7d, em9d and em11d can be viewed in the same SoC family or SoC
series.
Referring other arch's implementation, this commit merges em7d, em9d
and em11d into the same SoC, named snps_emsk. This will eliminate
unnecessary duplication and make it easier for future maintainment.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Remove the C Kconfig tools and various scripts associated with them.
scripts/kconfig/diffconfig is popular, so keep it.
I don't know whether anyone is using scripts/kconfig/config. Remove it
and see if anyone screams.
scripts/kconfig/streamline_config.pl deals with modules ('m' values) and
can safely be removed. Zephyr's Kconfig files do not use modules.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
They will no longer be available once the C Kconfig implementation is
removed.
oldconfig and allno/yesconfig implementations are available for
kconfiglib and could be added later if needed. savedefconfig (minimal
configuration generation) is available from the menuconfig.py
configuration interface.
cmake/usage/kconfig-usage.cmake becomes kinda pointless after this
change, so merge it into cmake/usage/usage.cmake.
Remove the kconfig_target, COMMAND_FOR_*, and COMMAND_RUNS_ON_WIN_*
CMake variables, as there's just the 'menuconfig' target now.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Make 'make/ninja menuconfig' run menuconfig.py instead of mconf from the
C Kconfig tools. Get rid of the 'pymenuconfig' target.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
When a bug in the caching mechanism is detected the cache format must
be bumped to ensure that we no longer get a cache hit on old corrupted
keys.
This fixes#7246 when the cache is corrupted.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Messages about compiler checks are very verbose so we disable them by
default. They have always been undesirably verbose, but introducing
CMAKE_REQUIRED_FLAGS into the 'check' string made them unacceptably
so.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Fix a bug where different compiler checks were aliased and therefore
the test results were incorrectly re-used.
The 'check' string is used by CMake internally to cache test results,
but when testing linker flags the check string has been aliased
between the different linker checks. To fix the aliasing issue we add
the CMAKE_REQUIRED_FLAGS variable to the 'check' string. The aliasing
issue disappears because the linker flag-under-test is in
'CMAKE_REQUIRED_FLAGS'.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This patchset provides Xtensa's xcc compiler support for Xtensa
projects in Cmake. This requires the below environment variables
to be defined aptly. The appropriate xcc license information also
need to be supplied.
ZEPHYR_GCC_VARIANT=xcc
TOOLCHAIN_VER=RF-2015.3-linux
XTENSA_CORE=cavs21_LX6HiFi3_RF3_WB16
XTENSA_SYSTEM=/opt/xtensa/XtDevTools/install/tools/
RF-2015.3-linux/XtensaTools/config/
XTENSA_BUILD_PATHS=/opt/xtensa/XtDevTools/install/builds/
Change-Id: Ib3c10e8095439b0e32276ff37c00eca8420773ec
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Older Git versions do not support the -C argument for specifying the
working directory. Switch to using --work-tree instead.
This fixes#7287.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit adds a Kconfiglib-based menuconfig implementation, built
with the standard Python 'curses' module. A new 'pymenuconfig' target is
added to run it.
The C tools are kept for now. Removing them separately allows testing of
pymenuconfig alongside the C tools, and keeps changes small and focused.
A feature is planned for later that shows all symbols -- including those
that aren't currently visible -- along with a search and "jump to"
feature. Loading of arbitrary .config files will be supported later as
well (as opposed to always loading .config/KCONFIG_CONFIG). Those
features are all connected implementation-wise.
For Windows, the wheels at
https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses provide the curses
implementation. They use the standard Python curses module
(_cursesmodule.c), linked against PDCurses.
Running 'python -VV' gives the Python version and bitness, to know which
wheel to install. User documentation will be added once the C tools are
removed and the 'pymenuconfig' target is moved over to 'menuconfig'.
The CMake parts are originally by Sebastian Bøe.
Description, taken from the menuconfig.py docstring:
Overview
========
A curses-based menuconfig implementation. The interface should feel
familiar to people used to mconf ('make menuconfig').
Supports the same keys as mconf, and also supports a set of
keybindings inspired by Vi:
J/K : Down/Up
L : Enter menu/Toggle item
H : Leave menu
Ctrl-D/U: Page Down/Page Down
G/End : Jump to end of list
g/Home : Jump to beginning of list
The mconf feature where pressing a key jumps to a menu entry with
that character in it in the current menu isn't supported. A search
feature with a "jump to" function for jumping directly to a
particular symbol regardless of where it is defined will be added
later instead.
Space and Enter are "smart" and try to do what you'd expect for the
given menu entry.
Running
=======
menuconfig.py can be run either as a standalone executable or by
calling the menu.menuconfig() function with an existing Kconfig
instance. The second option is a bit inflexible in that it will
still load and save .config, etc.
When run in standalone mode, the top-level Kconfig file to load can
be passed as a command-line argument. With no argument, it defaults
to "Kconfig".
The KCONFIG_CONFIG environment variable specifies the .config file
to load (if it exists) and save. If KCONFIG_CONFIG is unset,
".config" is used.
$srctree is supported through Kconfiglib.
Other features
==============
- Seamless terminal resizing
- No dependencies on *nix, as the 'curses' module is in the Python
standard library
- Unicode text entry
- Improved information screen compared to mconf:
* Expressions are split up by their top-level &&/|| operands
to improve readability
* Undefined symbols in expressions are pointed out
* Menus and comments have information displays
* Kconfig definitions are printed
Limitations
===========
- Python 3 only
This is mostly due to Python 2 not having curses.get_wch(),
which is needed for Unicode support.
- Doesn't work out of the box on Windows
Has been tested to work with the wheels provided at
https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses though.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Instead of using a module that tries to do too many things that break
in different places, keep it simple and just call git describe.
This fixes#7044 and fixes#7207.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make posix align with non-posix platforms by having CMAKE_C_COMPILER
and friends use absolute paths.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit ports nearly all usage of check_c_compiler_flag,
check_cxx_compiler_flag, and check_compiler_flag to use
zephyr_check_compiler_flag instead.
This has a significant CMake configure-time performance impact.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
zephyr_check_compiler_flag is introduced to resolve
https://github.com/zephyrproject-rtos/zephyr/issues/5633
The time spent when invoking CMake is halved with a warm cache.
See the API documentation for details.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit introduces TOOLCHAIN_SIGNATURE. A CMake variable that is
defined like this:
Toolchains with the same signature will always support the same set of
flags.
Currently it is implemented by MD5summing the CC binary.
This is useful for instance if the build system needs to determine if
it has seen the toolchain before, e.g. in a caching use-case.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>