build: deprecate ZEPHYR_GCC_VARIANT
We want to support other toolchain not based on GCC, so the variable is confusing, use ZEPHYR_TOOLCHAIN_VARIANT instead. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
5478d57911
commit
7ee8bb9677
|
@ -8,7 +8,7 @@ env:
|
|||
- SANITYCHECK_OPTIONS=" --inline-logs"
|
||||
- SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
|
||||
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.2
|
||||
- ZEPHYR_GCC_VARIANT=zephyr
|
||||
- ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
- MATRIX_BUILDS="4"
|
||||
- MATRIX_BUILDS_EXTRA="4"
|
||||
matrix:
|
||||
|
|
|
@ -234,7 +234,7 @@ else() # GCC assumed
|
|||
-Wno-unused-but-set-variable
|
||||
-fno-reorder-functions
|
||||
)
|
||||
if(NOT ${ZEPHYR_GCC_VARIANT} STREQUAL "xcc")
|
||||
if(NOT ${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "xcc")
|
||||
zephyr_cc_option(-fno-defer-pop)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -17,4 +17,4 @@ an application.
|
|||
To setup the build system with the correct toolchain use::
|
||||
|
||||
export RISCV32_TOOLCHAIN_PATH=~/path/to/pulpino/toolchain
|
||||
export ZEPHYR_GCC_VARIANT=riscv32
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=riscv32
|
||||
|
|
|
@ -64,13 +64,13 @@ Set up build environment
|
|||
|
||||
With both the toolchain and SDK installed, the Zephyr build system must be
|
||||
instructed to use this particular variant by setting the
|
||||
``ZEPHYR_GCC_VARIANT`` shell variable. Two other environment variables
|
||||
``ZEPHYR_TOOLCHAIN_VARIANT`` shell variable. Two other environment variables
|
||||
should also be set, pointing to, respectively, the path where ESP-IDF can be
|
||||
located, and where the toolchain has been installed:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
export ZEPHYR_GCC_VARIANT="espressif"
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT="espressif"
|
||||
export ESP_IDF_PATH="/path/to/esp-idf"
|
||||
export ESPRESSIF_TOOLCHAIN_PATH="/path/to/xtensa-esp32-elf/"
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ You can use the following code to create that file:
|
|||
then
|
||||
export ARCH=xtensa
|
||||
export BOARD=xt-sim
|
||||
export ZEPHYR_GCC_VARIANT=xcc
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=xcc
|
||||
export XTENSA_TOOLS_PATH=/opt/xtensa/XtDevTools/install/tools/RG-2016.4-linux/XtensaTools
|
||||
export XTENSA_BUILDS_PATH=/opt/xtensa/XtDevTools/install/builds/RG-2016.4-linux
|
||||
#export XTENSA_BUILD_DIR= #Keep empty to use default directory
|
||||
|
@ -90,13 +90,13 @@ You can use the following code to create that file:
|
|||
then
|
||||
export ARCH=xtensa
|
||||
export BOARD=qemu
|
||||
export ZEPHYR_GCC_VARIANT=zephyr
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
export ZEPHYR_SDK_INSTALL_DIR=/opt/xtensa/zephyr-sdk-64-INTERNAL-11-22-2016
|
||||
elif test "${CROSS}" = zephyr-x86
|
||||
then
|
||||
export ARCH=x86
|
||||
export BOARD=qemu_x86
|
||||
export ZEPHYR_GCC_VARIANT=zephyr
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
export ZEPHYR_SDK_INSTALL_DIR=/opt/xtensa/zephyr-sdk-64-INTERNAL-11-22-2016
|
||||
else
|
||||
echo "Unsupported compiler '${CROSS}' defined by environment variable CROSS"
|
||||
|
|
|
@ -952,7 +952,7 @@ function(print arg)
|
|||
endfunction()
|
||||
|
||||
# Usage:
|
||||
# assert(ZEPHYR_GCC_VARIANT "ZEPHYR_GCC_VARIANT not set.")
|
||||
# assert(ZEPHYR_TOOLCHAIN_VARIANT "ZEPHYR_TOOLCHAIN_VARIANT not set.")
|
||||
#
|
||||
# will cause a FATAL_ERROR and print an error message if the first
|
||||
# expression is false
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
# toolchain with a single environment variable.
|
||||
#
|
||||
# It is a legacy mechanism that will in Zephyr translate to
|
||||
# specififying ZEPHYR_GCC_VARIANT to 'cross-compile' with the location
|
||||
# specififying ZEPHYR_TOOLCHAIN_VARIANT to 'cross-compile' with the location
|
||||
# 'CROSS_COMPILE'.
|
||||
#
|
||||
# New users should set the env var 'ZEPHYR_GCC_VARIANT' to
|
||||
# New users should set the env var 'ZEPHYR_TOOLCHAIN_VARIANT' to
|
||||
# 'cross-compile' and the 'CROSS_COMPILE' env var to the toolchain
|
||||
# prefix. This interface is consisent with the other non-"Zephyr SDK"
|
||||
# toolchains.
|
||||
|
|
|
@ -8,23 +8,29 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
if(NOT ZEPHYR_GCC_VARIANT)
|
||||
if(DEFINED ENV{ZEPHYR_GCC_VARIANT})
|
||||
set(ZEPHYR_GCC_VARIANT $ENV{ZEPHYR_GCC_VARIANT})
|
||||
# Until we completely deprecate it
|
||||
if(DEFINED ENV{ZEPHYR_GCC_VARIANT})
|
||||
message(WARNING "ZEPHYR_GCC_VARIANT is deprecated, please use ZEPHYR_TOOLCHAIN_VARIANT instead")
|
||||
set(ZEPHYR_TOOLCHAIN_VARIANT $ENV{ZEPHYR_GCC_VARIANT})
|
||||
endif()
|
||||
|
||||
if(NOT ZEPHYR_TOOLCHAIN_VARIANT)
|
||||
if(DEFINED ENV{ZEPHYR_TOOLCHAIN_VARIANT})
|
||||
set(ZEPHYR_TOOLCHAIN_VARIANT $ENV{ZEPHYR_TOOLCHAIN_VARIANT})
|
||||
elseif(CROSS_COMPILE OR CONFIG_CROSS_COMPILE OR (DEFINED ENV{CROSS_COMPILE}))
|
||||
set(ZEPHYR_GCC_VARIANT cross-compile)
|
||||
set(ZEPHYR_TOOLCHAIN_VARIANT cross-compile)
|
||||
endif()
|
||||
endif()
|
||||
set(ZEPHYR_GCC_VARIANT ${ZEPHYR_GCC_VARIANT} CACHE STRING "Zephyr GCC variant")
|
||||
assert(ZEPHYR_GCC_VARIANT "Zephyr GCC variant invalid: please set the ZEPHYR_GCC_VARIANT-variable")
|
||||
set(ZEPHYR_TOOLCHAIN_VARIANT ${ZEPHYR_TOOLCHAIN_VARIANT} CACHE STRING "Zephyr toolchain variant")
|
||||
assert(ZEPHYR_TOOLCHAIN_VARIANT "Zephyr toolchain variant invalid: please set the ZEPHYR_TOOLCHAIN_VARIANT-variable")
|
||||
|
||||
if(CONFIG_ARCH_POSIX OR (ZEPHYR_GCC_VARIANT STREQUAL "host"))
|
||||
if(CONFIG_ARCH_POSIX OR (ZEPHYR_TOOLCHAIN_VARIANT STREQUAL "host"))
|
||||
set(COMPILER host-gcc)
|
||||
endif()
|
||||
|
||||
# Configure the toolchain based on what SDK/toolchain is in use.
|
||||
if(NOT (COMPILER STREQUAL "host-gcc"))
|
||||
include(${ZEPHYR_BASE}/cmake/toolchain-${ZEPHYR_GCC_VARIANT}.cmake)
|
||||
include(${ZEPHYR_BASE}/cmake/toolchain-${ZEPHYR_TOOLCHAIN_VARIANT}.cmake)
|
||||
endif()
|
||||
|
||||
# Configure the toolchain based on what toolchain technology is used
|
||||
|
|
|
@ -55,7 +55,7 @@ Our documentation processing has been tested to run with:
|
|||
Begin by cloning a copy of the git repository for the zephyr project and
|
||||
setting up your development environment as described in :ref:`getting_started`
|
||||
or specifically for Ubuntu in :ref:`installation_linux`. (Be sure to
|
||||
export the environment variables ``ZEPHYR_GCC_VARIANT`` and
|
||||
export the environment variables ``ZEPHYR_TOOLCHAIN_VARIANT`` and
|
||||
``ZEPHYR_SDK_INSTALL_DIR`` as documented there.)
|
||||
|
||||
Other than ``doxygen``, the documentation tools should be installed using ``pip``.
|
||||
|
|
|
@ -92,12 +92,15 @@ To build an example application follow these steps:
|
|||
|
||||
|
||||
# On Linux/macOS
|
||||
export ZEPHYR_GCC_VARIANT=zephyr
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
export ZEPHYR_SDK_INSTALL_DIR=<sdk installation directory>
|
||||
# On Windows
|
||||
set ZEPHYR_GCC_VARIANT=zephyr
|
||||
set ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
set ZEPHYR_SDK_INSTALL_DIR=<sdk installation directory>
|
||||
|
||||
.. note:: In previous releases of Zephyr, the ``ZEPHYR_TOOLCHAIN_VARIANT``
|
||||
variable was called ``ZEPHYR_GCC_VARIANT``.
|
||||
|
||||
#. Navigate to the main project directory:
|
||||
|
||||
.. code-block:: console
|
||||
|
@ -182,12 +185,12 @@ must be installed.
|
|||
.. code-block:: console
|
||||
|
||||
# On Linux/macOS
|
||||
unset ZEPHYR_GCC_VARIANT
|
||||
unset ZEPHYR_TOOLCHAIN_VARIANT
|
||||
unset ZEPHYR_SDK_INSTALL_DIR
|
||||
cd <zephyr git clone location>
|
||||
source zephyr-env.sh
|
||||
# On Windows
|
||||
set ZEPHYR_GCC_VARIANT=
|
||||
set ZEPHYR_TOOLCHAIN_VARIANT=
|
||||
set ZEPHYR_SDK_INSTALL_DIR=
|
||||
cd <zephyr git clone location>
|
||||
zephyr-env.cmd
|
||||
|
@ -234,10 +237,10 @@ without the Zephyr SDK`_ for details.
|
|||
|
||||
# On Linux/macOS
|
||||
export GCCARMEMB_TOOLCHAIN_PATH="~/gcc-arm-none-eabi-5_3-2016q1/"
|
||||
export ZEPHYR_GCC_VARIANT=gccarmemb
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=gccarmemb
|
||||
# On Windows
|
||||
set GCCARMEMB_TOOLCHAIN_PATH="%userprofile%\gcc-arm-none-eabi-5_3-2016q1\"
|
||||
set ZEPHYR_GCC_VARIANT=gccarmemb
|
||||
set ZEPHYR_TOOLCHAIN_VARIANT=gccarmemb
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
|
|
|
@ -153,7 +153,7 @@ Follow these steps to install the SDK on your Linux host system.
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
export ZEPHYR_GCC_VARIANT=zephyr
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
export ZEPHYR_SDK_INSTALL_DIR=<sdk installation directory>
|
||||
|
||||
To use the same toolchain in new sessions in the future you can set the
|
||||
|
@ -162,7 +162,7 @@ Follow these steps to install the SDK on your Linux host system.
|
|||
.. code-block:: console
|
||||
|
||||
cat <<EOF > ~/.zephyrrc
|
||||
export ZEPHYR_GCC_VARIANT=zephyr
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
||||
export ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk
|
||||
EOF
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ and use the target location where the toolchain was installed, type:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
export ZEPHYR_GCC_VARIANT=xtools
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=xtools
|
||||
export XTOOLS_TOOLCHAIN_PATH=/Volumes/CrossToolNG/x-tools
|
||||
|
||||
|
||||
|
@ -248,7 +248,7 @@ variables in the file :file:`${HOME}/.zephyrrc`, for example:
|
|||
|
||||
cat <<EOF > ~/.zephyrrc
|
||||
export XTOOLS_TOOLCHAIN_PATH=/Volumes/CrossToolNG/x-tools
|
||||
export ZEPHYR_GCC_VARIANT=xtools
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=xtools
|
||||
EOF
|
||||
|
||||
.. _Homebrew site: http://brew.sh/
|
||||
|
|
|
@ -122,7 +122,7 @@ packages from their respective websites.
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
set ZEPHYR_GCC_VARIANT=issm
|
||||
set ZEPHYR_TOOLCHAIN_VARIANT=issm
|
||||
set ISSM_INSTALLATION_PATH=c:\issm0-toolchain-windows-2017-01-25
|
||||
|
||||
Use the path where you extracted the ISSM toolchain.
|
||||
|
@ -131,7 +131,7 @@ packages from their respective websites.
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
set ZEPHYR_GCC_VARIANT=gccarmemb
|
||||
set ZEPHYR_TOOLCHAIN_VARIANT=gccarmemb
|
||||
set GCCARMEMB_TOOLCHAIN_PATH=c:\gccarmemb
|
||||
|
||||
To use the same toolchain in new sessions in the future you can set the
|
||||
|
@ -281,7 +281,7 @@ environment for Windows. Follow the steps below to set it up:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
export ZEPHYR_GCC_VARIANT=issm
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=issm
|
||||
export ISSM_INSTALLATION_PATH=/c/issm0-toolchain-windows-2017-01-25
|
||||
|
||||
Use the path where you extracted the ISSM toolchain.
|
||||
|
@ -290,7 +290,7 @@ environment for Windows. Follow the steps below to set it up:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
export ZEPHYR_GCC_VARIANT=gccarmemb
|
||||
export ZEPHYR_TOOLCHAIN_VARIANT=gccarmemb
|
||||
export GCCARMEMB_TOOLCHAIN_PATH=/c/gccarmemb
|
||||
|
||||
And for either, run the provided script to set up zephyr project specific
|
||||
|
|
|
@ -191,7 +191,7 @@ arch:
|
|||
Architecture of the board
|
||||
toolchain:
|
||||
The list of supported toolchains that can build this board. This should match
|
||||
one of the values used for 'ZEPHYR_GCC_VARIANT' when building on the command line
|
||||
one of the values used for 'ZEPHYR_TOOLCHAIN_VARIANT' when building on the command line
|
||||
ram:
|
||||
Available RAM on the board (specified in KB). This is used to match testcase
|
||||
requirements. If not specified we default to 128KB.
|
||||
|
|
|
@ -2,7 +2,7 @@ zephyr_library()
|
|||
zephyr_library_sources(libc-hooks.c)
|
||||
|
||||
# LIBC_*_DIR may or may not have been set by the toolchain. E.g. when
|
||||
# using ZEPHYR_GCC_VARIANT=cross-compile it will be either up to the
|
||||
# using ZEPHYR_TOOLCHAIN_VARIANT=cross-compile it will be either up to the
|
||||
# toolchain to know where it's libc implementation is, or if it is
|
||||
# unable to, it will be up to the user to specify LIBC_*_DIR vars to
|
||||
# point to a newlib implementation.
|
||||
|
|
|
@ -1544,7 +1544,7 @@ class TestSuite:
|
|||
|
||||
def apply_filters(self):
|
||||
|
||||
toolchain = os.environ.get("ZEPHYR_GCC_VARIANT", None)
|
||||
toolchain = os.environ.get("ZEPHYR_TOOLCHAIN_VARIANT", None)
|
||||
instances = []
|
||||
discards = {}
|
||||
platform_filter = options.platform
|
||||
|
|
Loading…
Reference in a new issue