Fixes: #30531
Now using MD5 sum of CMAKE_C_COMPILER (path), CMAKE_C_COMPILER_ID and
CMAKE_C_COMPILER_VERSION variables as part of the TOOLCHAIN_SIGNATURE.
Moved MD5 calculation of executable into
cmake/target_toolchain_flags.cmake to have common location, as
CMAKE_C_COMPILER_ID and CMAKE_C_COMPILER_VERSION are not available until
project() has executed.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
As part of toolchain abstraction three template files to facilitate
additional toolchain support development has been introduced.
Those covers:
- bintools
- compiler flags
- linker flags
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This forms the foundation for the abstraction of the binary tools,
where the following steps are taken:
- Move binary tool resolving, such as objcopy, objdump, readelf and
so forth, out of compiler definitions and place in a dedicated binary
tools folder with the binary tools supplier as subfolder, similar to
the compiler and linker directories.
- Create binary tool sets, gnu, host-gnu and llvm.
- Each toolchain selects the required set of binary tools by setting
BINTOOLS via its generic.cmake as it also does for compiler and linker.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
This allows for inclusion of out-of-tree toolchain cmake files
relating to compiler and linker for both target and generic
toolchains.
The base path used was ZEPHYR_BASE, instead of TOOLCHAIN_ROOT, thus
making it impossible to load the out-of-tree toolchain specific
cmake files.
In addition, the generic toolchain may now specify a generic cmake
file for the linker, similar to the target toolchain linker.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
toolchain_ld_base() represents flags that are fundamental to linking or
otherwise does not belong in any further specified linker flag category.
No functional change expected.
This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Aid user in understanding what CMake expects of:
* Document and add CMAKE_SYSTEM_VERSION
* Document CMAKE_SYSTEM_NAME
* Document CMAKE_SYSTEM_PROCESSOR
* Document BUILD_SHARED_LIBS
* Document Policies CMP0002, CMP0079
CMAKE_SYSTEM_VERSION is required officially by CMake, but appears
unused -- at least now we are compliant.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
These variables affect how CMake locates programs, libraries, include
files, and CMake packages. But the defaults are sufficient for Zephyr.
NEVER: Only host system's root will be searched.
ONLY: Only the paths specified by a variable will be searched. Typically
these paths point to cross-compilers.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
Split up the toolchain configuration into two phases, generic and
target. The 'generic' phase configures the toolchain just enough to be
able to preprocess DT files. The 'target' phase completes the
configuration with target-specific configuration.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>