Lines Matching +full:built +full:- +full:docs
18 the same system on which the libc is being built. First, we will explain how to
19 build for developing LLVM-libc, then we will explain how to build LLVM-libc as
26 Below is the list of commands for a simple recipe to build LLVM-libc for
35 ``gcc-multilib`` package creates this symlink, or you can do it manually with
37 ``sudo ln -s /usr/include/<HOST TRIPLE>/asm /usr/include/asm``
38 (your host triple will probably be similar to ``x86_64-linux-gnu``)
40 .. code-block:: sh
42 $> cd llvm-project # The llvm-project checkout
46 -G Ninja \
47 -DCMAKE_C_COMPILER=clang \
48 -DCMAKE_CXX_COMPILER=clang++ \
49 -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt" \
50 -DLLVM_LIBC_FULL_BUILD=ON \
51 -DCMAKE_BUILD_TYPE=Debug \
52 -DLLVM_LIBC_INCLUDE_SCUDO=ON \
53 -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON \
54 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF \
55 -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF \
56 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
57 -DLLVM_ENABLE_SPHINX=ON -DLIBC_INCLUDE_DOCS=ON \
58 -DLIBC_CMAKE_VERBOSE_LOGGING=ON
66 .. code-block:: sh
68 $> ninja libc libm check-libc
70 To build the docs run this command:
73 .. code-block:: sh
75 $> ninja docs-libc-html
79 .. code-block:: sh
88 of the ``--sysroot`` option here:
89 `<https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html>`_) which includes
93 `compiler-rt <https://compiler-rt.llvm.org/>`_ runtime libraries. LLVM-libc is
99 `libc++ <https://libcxx.llvm.org/>`_, libcxx-abi and libunwind in the
103 clang and lld with the current system's toolchain, then build compiler-rt and
104 LLVM-libc with that freshly built clang. This ensures that LLVM-libc can take
107 This build also uses Ninja as cmake's generator, and sets lld and compiler-rt as
109 should still work without them. The compiler-rt options are required for
110 building `Scudo <https://llvm.org/docs/ScudoHardenedAllocator.html>`_ as the
111 allocator for LLVM-libc.
117 ``gcc-multilib`` package creates this symlink, or you can do it manually with
119 ``sudo ln -s /usr/include/<TARGET TRIPLE>/asm /usr/include/asm``
121 .. code-block:: sh
123 $> cd llvm-project # The llvm-project checkout
128 -G Ninja \
129 -DLLVM_ENABLE_PROJECTS="clang;lld" \
130 -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt" \
131 -DCMAKE_BUILD_TYPE=Release \
132 -DCMAKE_C_COMPILER=clang \
133 -DCMAKE_CXX_COMPILER=clang++ \
134 -DLLVM_LIBC_FULL_BUILD=ON \
135 -DLLVM_LIBC_INCLUDE_SCUDO=ON \
136 -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON \
137 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF \
138 -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF \
139 -DCLANG_DEFAULT_LINKER=lld \
140 -DCLANG_DEFAULT_RTLIB=compiler-rt \
141 -DCMAKE_INSTALL_PREFIX=$SYSROOT
150 just trying to develop libc, then just run ``ninja check-libc`` to build the
157 .. code-block:: sh
159 $> ninja install-clang install-builtins install-compiler-rt \
160 install-core-resource-headers install-libc install-lld
164 .. code-block:: sh
169 have specified with the CMake configure step above will contain a full LLVM-only
170 toolchain with which you can build practical/real-world C applications. See
171 `<https://github.com/llvm/llvm-project/tree/main/libc/examples>`_ for examples
180 .. code-block:: sh
182 $> git clone --depth=1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git /tmp/linux
183 $> make LLVM=1 INSTALL_HDR_PATH=/path/to/sysroot -C /tmp/linux headers_install
185 The headers can be built to target non-host architectures by adding the
188 Using your newly built libc
191 You can now use your newly built libc nearly like you would use any compiler
194 .. code-block:: sh
196 $> /path/to/sysroot/bin/clang -static main.c
199 Because the libc does not yet support dynamic linking, the -static parameter
203 You can make sure you're using the newly built toolchain by trying out features
207 .. code-block:: C
209 // $ $SYSROOT/bin/clang example.c -static -ffixed-point --sysroot=$SYSROOT