|
3 | 3 | Arm Toolchain for Embedded (ATfE)
|
4 | 4 | #################################
|
5 | 5 |
|
6 |
| -#. LLVM toolchain by ARM |
7 | 6 |
|
8 |
| - #. Arm Toolchain for Embedded (ATfE) is a C and C++ toolchain from Arm based |
9 |
| - on the free and open-source LLVM Compiler Infrastructure and the Picolib C |
10 |
| - library for baremetal targets. |
| 7 | +Arm Toolchain for Embedded (ATfE) is a C and C++ toolchain from Arm based |
| 8 | + on the free and open-source LLVM Compiler Infrastructure and the Picolib C |
| 9 | + library for baremetal targets. |
11 | 10 |
|
12 |
| - #. ATfE is fined-tuned with a particular focus on performance for newer |
13 |
| - ARM products (post 2024) like 64-bit Arm Architectures (AArch64), |
14 |
| - or the M-Profile Vector Extension (MVE, a 32-bit Armv8.1-M extension). |
| 11 | +ATfE is fined-tuned with a particular focus on performance for newer |
| 12 | + ARM products (post 2024) like 64-bit Arm Architectures (AArch64), |
| 13 | + or the M-Profile Vector Extension (MVE, a 32-bit Armv8.1-M extension). |
15 | 14 |
|
16 |
| -#. Installation |
| 15 | +Installation |
| 16 | +************ |
17 | 17 |
|
18 |
| - #. Download and install a `Arm toolchain for embedded`_ build for your operating system |
19 |
| - and extract it on your file system. |
| 18 | +#. Download and install a `Arm toolchain for embedded`_ build for your operating system |
| 19 | + and extract it on your file system. |
20 | 20 |
|
21 |
| - #. :ref:`Set these environment variables <env_vars>`: |
| 21 | +#. :ref:`Set these environment variables <env_vars>`: |
22 | 22 |
|
23 |
| - - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``llvm``. |
24 |
| - - Set :envvar:`LLVM_TOOLCHAIN_PATH` to the toolchain installation directory. |
| 23 | + - Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``llvm``. |
| 24 | + - Set :envvar:`LLVM_TOOLCHAIN_PATH` to the toolchain installation directory. |
25 | 25 |
|
26 |
| - #. To check that you have set these variables correctly in your current |
27 |
| - environment, follow these example shell sessions (the |
28 |
| - :envvar:`LLVM_TOOLCHAIN_PATH` values may be different on your system): |
| 26 | +#. To check that you have set these variables correctly in your current |
| 27 | + environment, follow these example shell sessions (the |
| 28 | + :envvar:`LLVM_TOOLCHAIN_PATH` values may be different on your system): |
29 | 29 |
|
30 |
| - .. tabs:: |
| 30 | + .. tabs:: |
31 | 31 |
|
32 |
| - .. group-tab:: Ubuntu |
| 32 | + .. group-tab:: Ubuntu |
33 | 33 |
|
34 |
| - .. code-block:: bash |
| 34 | + .. code-block:: bash |
35 | 35 |
|
36 |
| - echo $ZEPHYR_TOOLCHAIN_VARIANT |
37 |
| - llvm |
38 |
| - echo $LLVM_TOOLCHAIN_PATH |
39 |
| - /home/you/Downloads/ATfE |
| 36 | + echo $ZEPHYR_TOOLCHAIN_VARIANT |
| 37 | + llvm |
| 38 | + echo $LLVM_TOOLCHAIN_PATH |
| 39 | + /home/you/Downloads/ATfE |
40 | 40 |
|
41 |
| - .. group-tab:: macOS |
| 41 | + .. group-tab:: macOS |
42 | 42 |
|
43 |
| - .. code-block:: bash |
| 43 | + .. code-block:: bash |
44 | 44 |
|
45 |
| - echo $ZEPHYR_TOOLCHAIN_VARIANT |
46 |
| - llvm |
47 |
| - echo $LLVM_TOOLCHAIN_PATH |
48 |
| - /home/you/Downloads/ATfE |
| 45 | + echo $ZEPHYR_TOOLCHAIN_VARIANT |
| 46 | + llvm |
| 47 | + echo $LLVM_TOOLCHAIN_PATH |
| 48 | + /home/you/Downloads/ATfE |
49 | 49 |
|
50 |
| - .. group-tab:: Windows |
| 50 | + .. group-tab:: Windows |
51 | 51 |
|
52 |
| - .. code-block:: powershell |
| 52 | + .. code-block:: powershell |
53 | 53 |
|
54 |
| - > echo %ZEPHYR_TOOLCHAIN_VARIANT% |
55 |
| - llvm |
56 |
| - > echo %LLVM_TOOLCHAIN_PATH% |
57 |
| - C:\ATfE |
| 54 | + > echo %ZEPHYR_TOOLCHAIN_VARIANT% |
| 55 | + llvm |
| 56 | + > echo %LLVM_TOOLCHAIN_PATH% |
| 57 | + C:\ATfE |
58 | 58 |
|
59 |
| - .. _toolchain_env_var: |
| 59 | + .. _toolchain_env_var: |
60 | 60 |
|
61 |
| - #. You can also set ``ZEPHYR_TOOLCHAIN_VARIANT`` and ``LLVM_TOOLCHAIN_PATH`` as CMake |
62 |
| - variables when generating a build system for a Zephyr application, like so: |
| 61 | +#. You can also set ``ZEPHYR_TOOLCHAIN_VARIANT`` and ``LLVM_TOOLCHAIN_PATH`` as CMake |
| 62 | + variables when generating a build system for a Zephyr application, like so: |
63 | 63 |
|
64 |
| - .. code-block:: console |
| 64 | + .. code-block:: console |
65 | 65 |
|
66 |
| - west build ... -- -DZEPHYR_TOOLCHAIN_VARIANT=llvm -DLLVM_TOOLCHAIN_PATH=... |
| 66 | + west build ... -- -DZEPHYR_TOOLCHAIN_VARIANT=llvm -DLLVM_TOOLCHAIN_PATH=... |
67 | 67 |
|
68 |
| -#. Toolchain settings |
| 68 | +Toolchain settings |
| 69 | +****************** |
69 | 70 |
|
70 |
| - #. Because LLVM is widely compatible with GNU tools, When builiding with any |
71 |
| - LLVM toolchain, you have to specify some settings to let the compiler |
72 |
| - know what tools to use: |
| 71 | +Because LLVM is widely compatible with GNU tools, When builiding with any |
| 72 | + LLVM toolchain, you have to specify some settings to let the compiler |
| 73 | + know what tools to use: |
73 | 74 |
|
74 |
| - #. Linker: |
75 |
| - Set :envvar:`CONFIG_LLVM_USE_LLD=y` to use LLVM linker. |
76 |
| - set :envvar:`CONFIG_LLVM_USE_LD=y` to use the GNU LD linker. |
| 75 | +Linker: |
| 76 | + Set :envvar:`CONFIG_LLVM_USE_LLD=y` to use LLVM linker. |
| 77 | + set :envvar:`CONFIG_LLVM_USE_LD=y` to use the GNU LD linker. |
77 | 78 |
|
78 |
| - #. Runtime library: |
79 |
| - Set :envvar:`CONFIG_COMPILER_RT_RTLIB=y` to use LLVM runtime library. |
80 |
| - Set :envvar:`CONFIG_LIBGCC_RTLIB=y` to use LibGCC runtime library. |
| 79 | +Runtime library: |
| 80 | + Set :envvar:`CONFIG_COMPILER_RT_RTLIB=y` to use LLVM runtime library. |
| 81 | + Set :envvar:`CONFIG_LIBGCC_RTLIB=y` to use LibGCC runtime library. |
81 | 82 |
|
82 |
| - .. code-block:: console |
| 83 | +.. code-block:: console |
83 | 84 |
|
84 |
| - west build ... -- -DZEPHYR_TOOLCHAIN_VARIANT=llvm -DLLVM_TOOLCHAIN_PATH=... -DCONFIG_LLVM_USE_LLD=y -DCONFIG_COMPILER_RT_RTLIB=y |
| 85 | + west build ... -- -DZEPHYR_TOOLCHAIN_VARIANT=llvm -DLLVM_TOOLCHAIN_PATH=... -DCONFIG_LLVM_USE_LLD=y -DCONFIG_COMPILER_RT_RTLIB=y |
85 | 86 |
|
86 | 87 | .. _Arm Toolchain for Embedded: https://developer.arm.com/Tools%20and%20Software/Arm%20Toolchain%20for%20Embedded
|
0 commit comments