1.. _toolchain_armclang:
2
3Arm Compiler 6
4##############
5
6#. Download and install a development suite containing the `Arm Compiler 6`_
7   for your operating system.
8
9#. :ref:`Set these environment variables <env_vars>`:
10
11   - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``armclang``.
12   - Set :envvar:`ARMCLANG_TOOLCHAIN_PATH` to the toolchain installation
13     directory.
14
15#. The Arm Compiler 6 needs the :envvar:`ARMLMD_LICENSE_FILE` environment
16   variable to point to your license file or server.
17
18For example:
19
20   .. code-block:: bash
21
22      # Linux, macOS, license file:
23      export ARMLMD_LICENSE_FILE=/<path>/license_armds.dat
24      # Linux, macOS, license server:
25      export ARMLMD_LICENSE_FILE=8224@myserver
26
27   .. code-block:: batch
28
29      # Windows, license file:
30      set ARMLMD_LICENSE_FILE=c:\<path>\license_armds.dat
31      # Windows, license server:
32      set ARMLMD_LICENSE_FILE=8224@myserver
33
34#. If the Arm Compiler 6 was installed as part of an Arm Development Studio, then
35   you must set the :envvar:`ARM_PRODUCT_DEF` to point to the product definition file:
36   See also: `Product and toolkit configuration <https://developer.arm.com/tools-and-software/software-development-tools/license-management/resources/product-and-toolkit-configuration>`_.
37   For example if the Arm Development Studio is installed in:
38   ``/opt/armds-2020-1`` with a Gold license, then set :envvar:`ARM_PRODUCT_DEF`
39   to point to ``/opt/armds-2020-1/gold.elmap``.
40
41   .. note::
42
43      The Arm Compiler 6 uses ``armlink`` for linking. This is incompatible
44      with Zephyr's linker script template, which works with GNU ld. Zephyr's
45      Arm Compiler 6 support Zephyr's CMake linker script generator, which
46      supports generating scatter files. Basic scatter file support is in
47      place, but there are still areas covered in ld templates which are not
48      fully supported by the CMake linker script generator.
49
50      Some Zephyr subsystems or modules may also contain C or assembly code
51      that relies on GNU intrinsics and have not yet been updated to work fully
52      with ``armclang``.
53
54.. _Arm Compiler 6: https://developer.arm.com/tools-and-software/embedded/arm-compiler/downloads/version-6
55