[libc-commits] [libc] [libc][docs][NFC] Add Build Concepts and consolidate patterns (PR #187490)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Thu Mar 19 07:05:22 PDT 2026


================
@@ -0,0 +1,75 @@
+.. _build_concepts:
+
+==============
+Build Concepts
+==============
+
+Most people don't need to build their own C library — the one provided by their
+system works well. However, LLVM-libc's **Overlay Mode** can provide key updates
+like faster or more consistent math functions for projects that need them.
+
+For those who do need a full C library, LLVM-libc supports several build
+configurations depending on your target environment and intended usage.
+
+The Five Build Scenarios
+========================
+
+1. Overlay Mode (Incremental Adoption)
+--------------------------------------
+
+In Overlay Mode, LLVM-libc functions are compiled alongside the host's existing 
+system library (like ``glibc``). Only the functions explicitly implemented in 
+LLVM-libc are used; the rest "fall back" to the system library. This is the 
+preferred method for most contributors as it is the fastest to build and test.
+
+To configure for an overlay build, point CMake to the ``runtimes`` directory 
+and set ``LLVM_LIBC_FULL_BUILD=OFF`` (which is the default):
+
+.. code-block:: sh
+
+   cmake -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt" \
----------------
kaladron wrote:

That's an excellent question. I've always built it with that. Let me try

https://github.com/llvm/llvm-project/pull/187490


More information about the libc-commits mailing list