Lines Matching +full:libc +full:- +full:build
11 One can choose to use LLVM's libc in the overlay mode. In this mode, the link
14 libc. The user programs also have to use header files from the system libc.
20 Building the libc in the overlay mode
23 There are two different ways in which the libc can be built for use in the
24 overlay mode. In both the ways, we build a static archive named
26 it clear that it is not the system libc, which is typically named ``libc.a``.
27 Also, if users choose to mix more than one libc with the system libc, then
29 archive of LLVM's libc.
31 Building LLVM-libc as a standalone runtime
32 ------------------------------------------
34 We can treat the ``libc`` project like any other normal LLVM runtime library by
37 .. code-block:: sh
39 $> cd llvm-project # The llvm-project checkout
40 $> mkdir build
41 $> cd build
42 $> cmake ../runtimes -G Ninja -DLLVM_ENABLE_RUNTIMES="libc" \
43 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
44 -DCMAKE_BUILD_TYPE=<Debug|Release> \ # Select build type
45 -DCMAKE_INSTALL_PREFIX=<Your prefix of choice> # Optional
47 Next, build the libc:
49 .. code-block:: sh
51 $> ninja libc
55 .. code-block:: sh
57 $> ninja check-libc
59 The build step will build the static archive the in the directory
60 ``build/projects/libc/lib``. Notice that the above CMake configure step also
64 .. code-block:: sh
66 $> ninja install-libc
68 Building the static archive as part of the bootstrap build
69 ----------------------------------------------------------
71 The bootstrap build is a build mode in which runtime components like libc++,
72 libcxx-abi, libc etc. are built using the ToT clang. The idea is that this build
73 produces an in-sync toolchain of compiler + runtime libraries. This ensures that
74 LLVM-libc has access to the latest clang features, which should provide the best
77 .. code-block:: sh
79 $> cmake ../llvm -G Ninja -DLLVM_ENABLE_PROJECTS="clang" \
80 -DLLVM_ENABLE_RUNTIMES="libc" \ # libc is listed as runtime and not as a project
81 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
82 -DCMAKE_BUILD_TYPE=<Debug|Release> \ # Select build type
83 -DCMAKE_INSTALL_PREFIX=<Your prefix of choice> # Optional
85 The build and install steps are the same as above, but the build step will take
88 .. code-block:: sh
90 $> ninja libc
91 $> ninja check-libc
101 .. code-block:: sh
104 -L <path to the directory in which libllvmlibc.a is installed> \ # Optional
105 -lllvmlibc
109 static archive using the ``-L`` option is not necessary.
112 -------------------------------------------------
114 Since the libc and other LLVM binaries are developed in the same source tree,
118 if you want to link ``libllvmlibc.a`` to ``llvm-objcopy``, all you have to do
121 .. code-block:: cmake
123 target_link_libraries(llvm-objcopy PRIVATE llvmlibc)