Lines Matching +full:ninja +full:- +full:build
4 Full Cross Build
16 In this document, we will present recipes to cross build the full libc. When we
17 say *cross build* a full libc, we mean that we will build the full libc for a
22 There are two main recipes to cross build the full libc. Each one serves a
26 * **Standalone cross build** - Using this recipe one can build the libc using a
28 build for the host as well as the target.
29 * **Bootstrap cross build** - In this recipe, one will build the ``clang``
30 compiler and the libc build tools for the host first, and then use them to
31 build the libc for the target. Unlike with the standalone build recipe, the
32 user does not have explicitly build ``clang`` and other build tools.
39 Standalone cross build
43 of user's choice is used to build the libc. The necessary build tools for the
44 host are built first, and those build tools are then used to build the libc for
46 to explicitly build the build tools first and then build the libc. A point to
51 --------------------
55 .. code-block:: sh
57 $> cd llvm-project # The llvm-project checkout
58 $> mkdir build
59 $> cd build
63 -G Ninja \
64 -DLLVM_ENABLE_RUNTIMES=libc \
65 -DCMAKE_C_COMPILER=$C_COMPILER \
66 -DCMAKE_CXX_COMPILER=$CXX_COMPILER \
67 -DLLVM_LIBC_FULL_BUILD=ON \
68 -DLIBC_TARGET_TRIPLE=<Your target triple> \
69 -DCMAKE_BUILD_TYPE=<Release|Debug>
73 * **Enabled Runtimes** - Since we want to build LLVM-libc, we list
75 * **The full build option** - Since we want to build the full libc, we pass
76 ``-DLLVM_LIBC_FULL_BUILD=ON``.
77 * **The target triple** - This is the target triple of the target for which
78 we are building the libc. For example, for a Linux 32-bit Arm target,
79 one can specify it as ``arm-linux-eabi``.
81 Build step
82 ----------
84 After configuring the build with the above ``cmake`` command, one can build the
87 .. code-block:: sh
89 $> ninja libc libm
91 The above ``ninja`` command will build the libc static archives ``libc.a`` and
92 ``libm.a`` for the target specified with ``-DLIBC_TARGET_TRIPLE`` in the CMake
95 Bootstrap cross build
102 --------------------
104 .. code-block:: sh
106 $> cd llvm-project # The llvm-project checkout
107 $> mkdir build
108 $> cd build
113 -G Ninja \
114 -DCMAKE_C_COMPILER=$C_COMPILER \
115 -DCMAKE_CXX_COMPILER=$CXX_COMPILER \
116 -DLLVM_ENABLE_PROJECTS=clang \
117 -DLLVM_ENABLE_RUNTIMES=libc \
118 -DLLVM_LIBC_FULL_BUILD=ON \
119 -DLLVM_RUNTIME_TARGETS=$TARGET_TRIPLE \
120 -DCMAKE_BUILD_TYPE=Debug
124 * ``clang`` is listed in ``-DLLVM_ENABLE_PROJECTS`` and ``libc`` is
125 listed in ``-DLLVM_ENABLE_RUNTIMES``.
126 * The CMake root source directory is ``llvm-project/llvm``.
127 * The target triple is specified with ``-DLLVM_RUNTIME_TARGETS``.
129 Build step
130 ----------
132 The build step is similar to the other recipe:
134 .. code-block:: sh
136 $> ninja libc
138 The above ninja command should build the libc static archives for the target
139 specified with ``-DLLVM_RUNTIME_TARGETS``.
144 To build for bare metal, all one has to do is to specify the
145 `system <https://clang.llvm.org/docs/CrossCompilation.html#target-triple>`_
146 component of the target triple as ``none``. For example, to build for a
147 32-bit arm target on bare metal, one can use a target triple like
148 ``arm-none-eabi``. Other than that, the libc for a bare metal target can be
154 To build for a GPU architecture, it should only be necessary to specify the
156 ``nvptx64-nvidia-cuda`` for NVIDIA GPUs or ``amdgcn-amd-amdhsa`` for AMD GPUs.