[libc-commits] [libc] [libc] Rewrite "Full Host Build" instructions (PR #180439)
Jeff Bailey via libc-commits
libc-commits at lists.llvm.org
Wed Feb 11 23:52:51 PST 2026
================
@@ -13,36 +13,29 @@ Full Host Build
pyyaml. The minimum versions are listed on the :ref:`header_generation`
page, as well as additional information.
-In this document, we will present a recipe to build the full libc for the host.
-When we say *build the libc for the host*, the goal is to build the libc for
-the same system on which the libc is being built. First, we will explain how to
-build for developing LLVM-libc, then we will explain how to build LLVM-libc as
-part of a complete toolchain.
-
-Configure the build for development
-===================================
-
-
-Below is the list of commands for a simple recipe to build LLVM-libc for
-development. In this we've set the Ninja generator, set the build type to
-"Debug", and enabled the Scudo allocator. This build also enables generating the
-documentation and verbose cmake logging, which are useful development features.
+Standard Building and Testing
+=============================
.. note::
- if your build fails with an error saying the compiler can't find
+ If your build fails with an error saying the compiler can't find
``<asm/unistd.h>`` or similar then you're probably missing the symlink from
``/usr/include/asm`` to ``/usr/include/<HOST TRIPLE>/asm``. Installing the
``gcc-multilib`` package creates this symlink, or you can do it manually with
this command:
``sudo ln -s /usr/include/<HOST TRIPLE>/asm /usr/include/asm``
(your host triple will probably be similar to ``x86_64-linux-gnu``)
+For basic development, such as adding new functions or fixing bugs, you can build
+and test the libc directly without setting up a full sysroot. This approach
+is faster and sufficient for most contributors.
+
+To configure the build, create a build directory and run ``cmake``:
+
.. code-block:: sh
- $> cd llvm-project # The llvm-project checkout
- $> mkdir build
- $> cd build
- $> cmake ../runtimes \
+ cmake \
----------------
kaladron wrote:
The build tree will be created automatically if it does not already exist. It looks like this behaviour was added at the same time as the -B and -S parameters were introduced.
https://cmake.org/cmake/help/latest/manual/cmake.1.html#generate-a-project-buildsystem
I could see us maybe setting a variable for $BUILD and using that throughout, but then if someone misses that when cutting and pasting they're going to get errors. I found this out several times when running the instructions below and forgot to set SYSROOT. =/
https://github.com/llvm/llvm-project/pull/180439
More information about the libc-commits
mailing list