diff --git a/.shippable.yml b/.shippable.yml index 1506d523869..5ef8594c3b4 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -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: diff --git a/CMakeLists.txt b/CMakeLists.txt index eaa25c4ce08..ef662a8bfd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/boards/riscv32/zedboard_pulpino/doc/zedboard_pulpino.rst b/boards/riscv32/zedboard_pulpino/doc/zedboard_pulpino.rst index 46f8aa11a60..70343a8252c 100644 --- a/boards/riscv32/zedboard_pulpino/doc/zedboard_pulpino.rst +++ b/boards/riscv32/zedboard_pulpino/doc/zedboard_pulpino.rst @@ -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 diff --git a/boards/xtensa/esp32/doc/esp32.rst b/boards/xtensa/esp32/doc/esp32.rst index 49b1cf396a1..11c1b086b57 100644 --- a/boards/xtensa/esp32/doc/esp32.rst +++ b/boards/xtensa/esp32/doc/esp32.rst @@ -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/" diff --git a/boards/xtensa/xt-sim/doc/xt-sim.rst b/boards/xtensa/xt-sim/doc/xt-sim.rst index ced6f005404..7227954a6b5 100644 --- a/boards/xtensa/xt-sim/doc/xt-sim.rst +++ b/boards/xtensa/xt-sim/doc/xt-sim.rst @@ -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" diff --git a/cmake/extensions.cmake b/cmake/extensions.cmake index 36367dad9d1..7b261df4e16 100644 --- a/cmake/extensions.cmake +++ b/cmake/extensions.cmake @@ -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 diff --git a/cmake/toolchain-cross-compile.cmake b/cmake/toolchain-cross-compile.cmake index 60aec8fc4ef..5d3fb680818 100644 --- a/cmake/toolchain-cross-compile.cmake +++ b/cmake/toolchain-cross-compile.cmake @@ -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. diff --git a/cmake/toolchain.cmake b/cmake/toolchain.cmake index 0dbf6f89802..5d40d459105 100644 --- a/cmake/toolchain.cmake +++ b/cmake/toolchain.cmake @@ -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 diff --git a/doc/README.rst b/doc/README.rst index d027b3b5e0e..4680daf0742 100644 --- a/doc/README.rst +++ b/doc/README.rst @@ -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``. diff --git a/doc/getting_started/getting_started.rst b/doc/getting_started/getting_started.rst index a16cbb11015..0f2559c68e3 100644 --- a/doc/getting_started/getting_started.rst +++ b/doc/getting_started/getting_started.rst @@ -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= # On Windows - set ZEPHYR_GCC_VARIANT=zephyr + set ZEPHYR_TOOLCHAIN_VARIANT=zephyr set ZEPHYR_SDK_INSTALL_DIR= + .. 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 source zephyr-env.sh # On Windows - set ZEPHYR_GCC_VARIANT= + set ZEPHYR_TOOLCHAIN_VARIANT= set ZEPHYR_SDK_INSTALL_DIR= cd 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 diff --git a/doc/getting_started/installation_linux.rst b/doc/getting_started/installation_linux.rst index 8fb424d37a5..2cc7e93786f 100644 --- a/doc/getting_started/installation_linux.rst +++ b/doc/getting_started/installation_linux.rst @@ -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= 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 < ~/.zephyrrc - export ZEPHYR_GCC_VARIANT=zephyr + export ZEPHYR_TOOLCHAIN_VARIANT=zephyr export ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk EOF diff --git a/doc/getting_started/installation_mac.rst b/doc/getting_started/installation_mac.rst index ab3e5a96198..4076745ae36 100644 --- a/doc/getting_started/installation_mac.rst +++ b/doc/getting_started/installation_mac.rst @@ -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 < ~/.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/ diff --git a/doc/getting_started/installation_win.rst b/doc/getting_started/installation_win.rst index ec573a2651c..c4de14a62b8 100644 --- a/doc/getting_started/installation_win.rst +++ b/doc/getting_started/installation_win.rst @@ -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 diff --git a/doc/subsystems/test/sanitycheck.rst b/doc/subsystems/test/sanitycheck.rst index ca2193eb3e7..809b9d35abb 100644 --- a/doc/subsystems/test/sanitycheck.rst +++ b/doc/subsystems/test/sanitycheck.rst @@ -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. diff --git a/lib/libc/newlib/CMakeLists.txt b/lib/libc/newlib/CMakeLists.txt index 57855267813..f1e6f48fb34 100644 --- a/lib/libc/newlib/CMakeLists.txt +++ b/lib/libc/newlib/CMakeLists.txt @@ -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. diff --git a/scripts/sanitycheck b/scripts/sanitycheck index f0253cbf29d..1e01b699945 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -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