PR #9522 series ending with commit c2c9265b7d ("tests: cmsis: Disable
two cmsis portability tests on x86_64") added -mx32 support for the
x86_64 ARCH and qemu_x86_64. While this was implemented in
"compiler/gcc/target.cmake" as fall back from cross-compilation to the
host compiler, it worked with a direct ZEPHYR_TOOLCHAIN_VARIANT=host
too.
Later, -lgcc was added to "compiler/host-gcc/target.cmake" by PR #12674
to fix the -m32 x86 build. This broke the x86_64 build when using
ZEPHYR_TOOLCHAIN_VARIANT=host because even "multilib" packages usually
don't feature the -mx32 version of libgcc.
Fix this by excluding -lgcc in compiler/host-gcc/target.cmake just like
compiler/gcc/target.cmake always did for x86_64.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Introduce the first of the toolchain_cc-family of macros:
toolchain_cc_security_fortify and toolchain_cc_security_canaries.
No functional change expected.
Fortify source is not supported by Clang, but this commit retains
current behavior.
This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting easier porting to other (commercial) toolchains.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
Add missing -lgcc when compiling with ZEPHYR_TOOLCHAIN_VARIANT=host
merely copying some existing code from
'compiler/{clang,gcc}/target.cmake'.
This fixes compilation for the following boards with an x86
microprocessor:
galileo, minnowboard, qemu_x86, qemu_x86_nommu, up_squared,
up_squared_sbl
Compilation of the following boards with an X86_IAMCU microcontroller
still fail with a "cannot find -lgcc" error:
arduino_101, qemu_x86_iamcu, quark_d2000_crb, quark_se_c1000_devboard,
tinytile
This is _not_ a regression because these boards _already_ failed with
"undefined reference to __udivdi3" and other libgcc symbols.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This fixes the following error on all x86 BOARDs (qemu_x86,
galileo,... see "make usage" for the complete list) when compiling
assembly files with ZEPHYR_TOOLCHAIN_VARIANT=host:
cc1: error: CPU you selected does not support x86-64 instruction set
This also fixes the following error when compiling minnowboard,
up_squared and up_squared_sbl boards with ZEPHYR_TOOLCHAIN_VARIANT=host:
cc1: error: -mpreferred-stack-boundary=2 is not between 3 and 12
This fix alone is not enough to compile any of these boards; however it
moves compilation much further to the next, unrelated failure(s),
namely: 'undefined __udivdi3' and other libgcc symbols for all x86
boards; + some other, additional issues for some boards. See next
commit.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
A GCC-based toolchain may require additional, toolchain-specific
values in CMAKE_REQUIRED_FLAGS to perform compiler checks properly,
but gcc.cmake clobbers any values the user provides.
Preserve them instead, allowing users to give their own compiler
checking flags at generation time.
The details for the particular issue that inspired this are described
in https://github.com/pulp-platform/pulpino/issues/240.
Signed-off-by: Marti Bolivar <marti@foundries.io>
Host toolchains don't tend to provide an x32 libgcc. But we don't
actually need one for existing code. This is fragile, but better to
work for all but obscure cases than break outright.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Cosmetics, no functional change expected.
Fixed leading space alignment.
Replaced tabs with spaces.
Emulation error message output is now aligned.
To locate tabs in cmake, the following bash is useful:
grep -PRil "\t" * | grep -i cmake | grep -v ^sanity
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>
When building with clang symbols from the runtime library, like
__divdi3 were not being resolved. To fix this we add the "library path
for the currently used compiler runtime library" to the link path.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Align 'clang' with 'gcc' by having it also use 'find_program' instead
of 'set' to assign toolchain paths.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Align 'clang' with gcc by having it also set CMAKE_C_COMPILER in the
'compiler' build script instead of the 'toolchain' build script.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The 'llvm' and 'clang' build scripts have been named strangely. It is
more natural for 'clang' to be the compiler, and 'llvm' to be the
toolchain.
This commit rectifies this by renaming the files.
This also fixes#11187
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Fixed whitespace such that 'XTOOLS_TOOLCHAIN_PATH' is vertically
aligned.
Also, combined two cmake invocations of 'list' into one.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Some toolchains are built with multilib enabled in order to provide
multiple versions of the same library, optimized for different ABI
or architecture. They require the the ABI/architecture/CPU selection
options to be passed at linked time. This is important for example
when linking with newlib.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
MSYS support was added as a stop-gap while native windows support was
unsupported. Now that Native windows support is stable we can drop
support for MSYS.
Dropping support for MSYS fixes#11260 and allows us to spend more
resources on native windows support.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Not all compiles/linkers support the GCC flags to not include standard
defines, include files and libraries. So make these parameters such
that the toolchain can define them when supported.
Also, according to documentation, -nostdlib does the same for both
-nostartfiles and -nodefaultlibs. So remove the redundant ones.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This re-applies a patch that was merged in pr #6989, but then
accidentally reverted in a bad merge conflict resolution in pr #6842.
The actual behaviour of CONIG_FP_SOFTABI has not been matching the
documenation. The Kconfig documentation states that floating point
instructions should be generated, but this Kconfig option has been
turning off floating point instructions instead.
This commit causes floating point instructions to be generated when
CONFIG_FP_SOFTABI is enabled, as was originally intended and
documented.
This commit can cause regressions if users have been relying on the
actual behaviour instead of the documented behaviour.
Kconfig documentation:
config FP_SOFTABI
help
This option selects the Floating point ABI in which hardware
floating point instructions are generated but soft-float calling
conventions.
GCC documentation:
Specifying ‘soft’ causes GCC to generate output containing library
calls for floating-point operations. ‘softfp’ allows the generation of
code using hardware floating-point instructions, but still uses the
soft-float calling conventions. ‘hard’ allows generation of
floating-point instructions and uses FPU-specific calling conventions.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
'find_program' should be used instead of 'set' for determining the
paths of host programs. It resolves#9582 and various other issues.
Signed-off-by: Sebastian Bøe <sebastian.boe@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>
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 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>
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>
Improve the error feedback when the toolchain is not found.
Currently, for some setups, presumably primarily SDK-less setups,
users can get an error message like this for certain types of
misconfigurations:
CMake Error at zephyr/cmake/extensions.cmake:984 (message):
No such file or directory: CMAKE_READELF: 'CMAKE_READELF-NOTFOUND'
Call Stack (most recent call first):
zephyr/cmake/compiler/gcc.cmake:14 (assert_exists)
zephyr/cmake/toolchain.cmake:38 (include)
zephyr/cmake/app/boilerplate.cmake:243 (include)
CMakeLists.txt:1 (include)
This commit will improve the error feedback to give a explanation for
what kind of failure has occured and will also dump relevant variables
to ease debugging.
This fixes#7075
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The actual behaviour of CONIG_FP_SOFTABI has not been matching the
documenation. The Kconfig documentation states that floating point
instructions should be generated, but this Kconfig option has been
turning off floating point instructions instead.
This commit causes floating point instructions to be generated when
CONFIG_FP_SOFTABI is enabled, as was originally intended and
documented.
This commit can cause regressions if users have been relying on the
actual behaviour instead of the documented behaviour.
Kconfig documentation:
config FP_SOFTABI
help
This option selects the Floating point ABI in which hardware
floating point instructions are generated but soft-float calling
conventions.
GCC documentation:
Specifying ‘soft’ causes GCC to generate output containing library
calls for floating-point operations. ‘softfp’ allows the generation of
code using hardware floating-point instructions, but still uses the
soft-float calling conventions. ‘hard’ allows generation of
floating-point instructions and uses FPU-specific calling conventions.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Move toolchain definitions into toolchain/ and move compilers to
compilers/
Usage of toolchain- for everything was confusing, there are the actual
compiler related definitions and there is the toolchain/SDK related
configs, so keeping them separate helps understand the different and
prevents confusion.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>