Skip to content

Commit b89fef8

Browse files
authoredAug 21, 2024··
[libc][docs] Update docs to reflect new headergen (#102381)
Since new headergen is now the default for building LLVM-libc, the docs need to be updated to reflect that. While I was editing those docs, I took a quick pass at updating other out-of-date pages.
1 parent c975dc1 commit b89fef8

15 files changed

+154
-242
lines changed
 

‎libc/docs/build_and_test.rst

-7
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ The libc can be built and tested in two different modes:
3838
3939
$> ninja libc-integration-tests
4040
41-
#. API verification test - See :ref:`api_test` for more information about
42-
the API test. It can be run by the command:
43-
44-
.. code-block:: sh
45-
46-
$> ninja libc-api-test
47-
4841
Building with VSCode
4942
====================
5043

‎libc/docs/contributing.rst

+1-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Contributing to the libc Project
55
================================
66

7-
LLVM's libc is being developed as part of the LLVM project so contributions
7+
LLVM-libc is being developed as part of the LLVM project so contributions
88
to the libc project should also follow the general LLVM
99
`contribution guidelines <https://llvm.org/docs/Contributing.html>`_. Below is
1010
a list of open projects that one can start with:
@@ -31,24 +31,12 @@ a list of open projects that one can start with:
3131
directory. So, a simple but mechanical project would be to move the parts
3232
following the old styles to the new style.
3333

34-
#. **Integrating with the rest of the LLVM project** - There are two parts to
35-
this project:
36-
37-
#. One is about adding CMake facilities to optionally link the libc's overlay
38-
static archive (see :ref:`overlay_mode`) with other LLVM tools/executables.
39-
#. The other is about putting plumbing in place to release the overlay static
40-
archive (see :ref:`overlay_mode`) as part of the LLVM binary releases.
41-
4234
#. **Implement Linux syscall wrappers** - A large portion of the POSIX API can
4335
be implemented as syscall wrappers on Linux. A good number have already been
4436
implemented but many more are yet to be implemented. So, a project of medium
4537
complexity would be to implement syscall wrappers which have not yet been
4638
implemented.
4739

48-
#. **Add a better random number generator** - The current random number
49-
generator has a very small range. This has to be improved or switched over
50-
to a fast random number generator with a large range.
51-
5240
#. **Update the clang-tidy lint rules and use them in the build and/or CI** -
5341
Currently, the :ref:`clang_tidy_checks` have gone stale and are mostly unused
5442
by the developers and on the CI builders. This project is about updating

‎libc/docs/dev/api_test.rst

-25
This file was deleted.

‎libc/docs/dev/ground_truth_specification.rst

-11
This file was deleted.

‎libc/docs/dev/header_generation.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _header_generation:
2+
13
Generating Public and Internal headers
24
======================================
35

‎libc/docs/dev/index.rst

-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ Navigate to the links below for information on the respective topics:
1515
config_options
1616
clang_tidy_checks
1717
fuzzing
18-
ground_truth_specification
1918
header_generation
2019
implementation_standard
2120
undefined_behavior
2221
printf_behavior
23-
api_test
24-
mechanics_of_public_api

‎libc/docs/dev/mechanics_of_public_api.rst

-29
This file was deleted.

‎libc/docs/dev/source_tree_layout.rst

+17-7
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ directories::
1414
- docs
1515
- examples
1616
- fuzzing
17+
- hdr
1718
- include
1819
- lib
19-
- spec
20+
- newhdrgen
2021
- src
2122
- startup
2223
- test
@@ -62,6 +63,14 @@ The directory structure within this directory mirrors the directory structure
6263
of the top-level ``libc`` directory itself. For more details, see
6364
:doc:`fuzzing`.
6465

66+
The ``hdr`` directory
67+
---------------------
68+
69+
This directory contains proxy headers which are included from the files in the
70+
src directory. These proxy headers either include our internal type or macro
71+
definitions, or the system's type or macro definitions, depending on if we are
72+
in fullbuild or overlay mode.
73+
6574
The ``include`` directory
6675
-------------------------
6776

@@ -80,13 +89,14 @@ The ``lib`` directory
8089
This directory contains a ``CMakeLists.txt`` file listing the targets for the
8190
public libraries ``libc.a``, ``libm.a`` etc.
8291

83-
The ``spec`` directory
84-
----------------------
92+
The ``newhdrgen`` directory
93+
---------------------------
8594

86-
This directory contains the specifications for the types, macros, and entrypoint
87-
functions. These definitions come from the various standards and extensions
88-
LLVM-libc supports, and they are used along with the ``*.h.def`` files and the
89-
config files to generate the headers for fullbuild mode.
95+
This directory contains the sources and specifications for the types, macros
96+
and entrypoint functions. These definitions are organized in the ``yaml``
97+
subdirectory and match the organization of the ``*.h.def`` files. This folder
98+
also contains the python sources for new headergen, which is what generates the
99+
headers.
90100

91101
The ``src`` directory
92102
---------------------

‎libc/docs/full_cross_build.rst

+15-100
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,33 @@ Full Cross Build
88
:depth: 1
99
:local:
1010

11+
.. note::
12+
Fullbuild requires running headergen, which is a python program that depends on
13+
pyyaml. The minimum versions are listed on the :ref:`header_generation`
14+
page, as well as additional information.
15+
1116
In this document, we will present recipes to cross build the full libc. When we
1217
say *cross build* a full libc, we mean that we will build the full libc for a
1318
target system which is not the same as the system on which the libc is being
1419
built. For example, you could be building for a bare metal aarch64 *target* on a
1520
Linux x86_64 *host*.
1621

17-
There are three main recipes to cross build the full libc. Each one serves a
22+
There are two main recipes to cross build the full libc. Each one serves a
1823
different use case. Below is a short description of these recipes to help users
1924
pick the recipe that best suites their needs and contexts.
2025

2126
* **Standalone cross build** - Using this recipe one can build the libc using a
2227
compiler of their choice. One should use this recipe if their compiler can
2328
build for the host as well as the target.
24-
* **Runtimes cross build** - In this recipe, one will have to first build the
25-
libc build tools for the host separately and then use those build tools to
26-
build the libc. Users can use the compiler of their choice to build the
27-
libc build tools as well as the libc. One should use this recipe if they
28-
have to use a host compiler to build the build tools for the host and then
29-
use a target compiler (which is different from the host compiler) to build
30-
the libc.
3129
* **Bootstrap cross build** - In this recipe, one will build the ``clang``
3230
compiler and the libc build tools for the host first, and then use them to
33-
build the libc for the target. Unlike with the runtimes build recipe, the
34-
user does not have explicitly build ``clang`` and other libc build tools.
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.
3533
They get built automatically before building the libc. One should use this
3634
recipe if they intend use the built ``clang`` and the libc as part of their
3735
toolchain for the target.
3836

39-
The following sections present the three recipes in detail.
37+
The following sections present the two recipes in detail.
4038

4139
Standalone cross build
4240
======================
@@ -61,9 +59,9 @@ Below is the CMake command to configure the standalone crossbuild of the libc.
6159
$> cd build
6260
$> C_COMPILER=<C compiler> # For example "clang"
6361
$> CXX_COMPILER=<C++ compiler> # For example "clang++"
64-
$> cmake ../llvm \
62+
$> cmake ../runtimes \
6563
-G Ninja \
66-
-DLLVM_ENABLE_PROJECTS=libc \
64+
-DLLVM_ENABLE_RUNTIMES=libc \
6765
-DCMAKE_C_COMPILER=$C_COMPILER \
6866
-DCMAKE_CXX_COMPILER=$CXX_COMPILER \
6967
-DLLVM_LIBC_FULL_BUILD=ON \
@@ -72,8 +70,8 @@ Below is the CMake command to configure the standalone crossbuild of the libc.
7270
7371
We will go over the special options passed to the ``cmake`` command above.
7472

75-
* **Enabled Projects** - Since we want to build the libc project, we list
76-
``libc`` as the enabled project.
73+
* **Enabled Runtimes** - Since we want to build LLVM-libc, we list
74+
``libc`` as the enabled runtime.
7775
* **The full build option** - Since we want to build the full libc, we pass
7876
``-DLLVM_LIBC_FULL_BUILD=ON``.
7977
* **The target triple** - This is the target triple of the target for which
@@ -94,88 +92,6 @@ The above ``ninja`` command will build the libc static archives ``libc.a`` and
9492
``libm.a`` for the target specified with ``-DLIBC_TARGET_TRIPLE`` in the CMake
9593
configure step.
9694

97-
.. _runtimes_cross_build:
98-
99-
Runtimes cross build
100-
====================
101-
102-
The *runtimes cross build* is very similar to the standalone crossbuild but the
103-
user will have to first build the libc build tools for the host separately. One
104-
should use this recipe if they want to use a different host and target compiler.
105-
Note that the libc build tools MUST be in sync with the libc. That is, the
106-
libc build tools and the libc, both should be built from the same source
107-
revision. At the time of this writing, there is only one libc build tool that
108-
has to be built separately. It is done as follows:
109-
110-
.. code-block:: sh
111-
112-
$> cd llvm-project # The llvm-project checkout
113-
$> mkdir build-libc-tools # A different build directory for the build tools
114-
$> cd build-libc-tools
115-
$> HOST_C_COMPILER=<C compiler for the host> # For example "clang"
116-
$> HOST_CXX_COMPILER=<C++ compiler for the host> # For example "clang++"
117-
$> cmake ../llvm \
118-
-G Ninja \
119-
-DLLVM_ENABLE_PROJECTS=libc \
120-
-DCMAKE_C_COMPILER=$HOST_C_COMPILER \
121-
-DCMAKE_CXX_COMPILER=$HOST_CXX_COMPILER \
122-
-DLLVM_LIBC_FULL_BUILD=ON \
123-
-DCMAKE_BUILD_TYPE=Debug # User can choose to use "Release" build type
124-
$> ninja libc-hdrgen
125-
126-
The above commands should build a binary named ``libc-hdrgen``. Copy this binary
127-
to a directory of your choice.
128-
129-
CMake configure step
130-
--------------------
131-
132-
After copying the ``libc-hdrgen`` binary to say ``/path/to/libc-hdrgen``,
133-
configure the libc build using the following command:
134-
135-
.. code-block:: sh
136-
137-
$> cd llvm-project # The llvm-project checkout
138-
$> mkdir build
139-
$> cd build
140-
$> TARGET_C_COMPILER=<C compiler for the target>
141-
$> TARGET_CXX_COMPILER=<C++ compiler for the target>
142-
$> HDRGEN=</path/to/libc-hdrgen>
143-
$> TARGET_TRIPLE=<Your target triple>
144-
$> cmake ../runtimes \
145-
-G Ninja \
146-
-DLLVM_ENABLE_RUNTIMES=libc \
147-
-DCMAKE_C_COMPILER=$TARGET_C_COMPILER \
148-
-DCMAKE_CXX_COMPILER=$TARGET_CXX_COMPILER \
149-
-DLLVM_LIBC_FULL_BUILD=ON \
150-
-DLIBC_HDRGEN_EXE=$HDRGEN \
151-
-DLIBC_TARGET_TRIPLE=$TARGET_TRIPLE \
152-
-DCMAKE_BUILD_TYPE=Debug # User can choose to use "Release" build type
153-
154-
Note the differences in the above cmake command versus the one used in the
155-
CMake configure step of the standalone build recipe:
156-
157-
* Instead of listing ``libc`` in ``LLVM_ENABLED_PROJECTS``, we list it in
158-
``LLVM_ENABLED_RUNTIMES``.
159-
* Instead of using ``llvm-project/llvm`` as the root CMake source directory,
160-
we use ``llvm-project/runtimes`` as the root CMake source directory.
161-
* The path to the ``libc-hdrgen`` binary built earlier is specified with
162-
``-DLIBC_HDRGEN_EXE=/path/to/libc-hdrgen``.
163-
164-
Build step
165-
----------
166-
167-
The build step in the runtimes build recipe is exactly the same as that of
168-
the standalone build recipe:
169-
170-
.. code-block:: sh
171-
172-
$> ninja libc libm
173-
174-
As with the standalone build recipe, the above ninja command will build the
175-
libc static archives for the target specified with ``-DLIBC_TARGET_TRIPLE`` in
176-
the CMake configure step.
177-
178-
17995
Bootstrap cross build
18096
=====================
18197

@@ -203,8 +119,7 @@ CMake configure step
203119
-DLLVM_RUNTIME_TARGETS=$TARGET_TRIPLE \
204120
-DCMAKE_BUILD_TYPE=Debug
205121
206-
Note how the above cmake command differs from the one used in the other two
207-
recipes:
122+
Note how the above cmake command differs from the one used in the other recipe:
208123

209124
* ``clang`` is listed in ``-DLLVM_ENABLE_PROJECTS`` and ``libc`` is
210125
listed in ``-DLLVM_ENABLE_RUNTIMES``.
@@ -214,7 +129,7 @@ recipes:
214129
Build step
215130
----------
216131

217-
The build step is similar to the other two recipes:
132+
The build step is similar to the other recipe:
218133

219134
.. code-block:: sh
220135

‎libc/docs/full_host_build.rst

+79-8
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,97 @@ Full Host Build
88
:depth: 1
99
:local:
1010

11+
.. note::
12+
Fullbuild requires running headergen, which is a python program that depends on
13+
pyyaml. The minimum versions are listed on the :ref:`header_generation`
14+
page, as well as additional information.
15+
1116
In this document, we will present a recipe to build the full libc for the host.
1217
When we say *build the libc for the host*, the goal is to build the libc for
13-
the same system on which the libc is being built. Also, we will take this
14-
opportunity to demonstrate how one can set up a *sysroot* (see the documentation
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
20+
part of a complete toolchain.
21+
22+
Configure the build for development
23+
===================================
24+
25+
26+
Below is the list of commands for a simple recipe to build LLVM-libc for
27+
development. In this we've set the Ninja generator, set the build type to
28+
"Debug", and enabled the Scudo allocator. This build also enables generating the
29+
documentation and verbose cmake logging, which are useful development features.
30+
31+
.. note::
32+
if your build fails with an error saying the compiler can't find
33+
``<asm/unistd.h>`` or similar then you're probably missing the symlink from
34+
``/usr/include/asm`` to ``/usr/include/<HOST TRIPLE>/asm``. Installing the
35+
``gcc-multilib`` package creates this symlink, or you can do it manually with
36+
this command:
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``)
39+
40+
.. code-block:: sh
41+
42+
$> cd llvm-project # The llvm-project checkout
43+
$> mkdir build
44+
$> cd build
45+
$> cmake ../runtimes \
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
59+
60+
Build and test
61+
==============
62+
63+
After configuring the build with the above ``cmake`` command, one can build test
64+
libc with the following command:
65+
66+
.. code-block:: sh
67+
68+
$> ninja libc libm check-libc
69+
70+
To build the docs run this command:
71+
72+
73+
.. code-block:: sh
74+
75+
$> ninja docs-libc-html
76+
77+
To run a specific test, use the following:
78+
79+
.. code-block:: sh
80+
81+
$> ninja libc.test.src.<HEADER>.<FUNCTION>_test.__unit__
82+
$> ninja libc.test.src.ctype.isalpha_test.__unit__ # EXAMPLE
83+
84+
Configure the complete toolchain build
85+
======================================
86+
87+
For a complete toolchain we recommend creating a *sysroot* (see the documentation
1588
of the ``--sysroot`` option here:
1689
`<https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html>`_) which includes
1790
not only the components of LLVM's libc, but also a full LLVM only toolchain
1891
consisting of the `clang <https://clang.llvm.org/>`_ compiler, the
1992
`lld <https://lld.llvm.org/>`_ linker and the
20-
`compiler-rt <https://compiler-rt.llvm.org/>`_ runtime libraries. LLVM's libc is
21-
not yet complete enough to allow using and linking a C++ application against
93+
`compiler-rt <https://compiler-rt.llvm.org/>`_ runtime libraries. LLVM-libc is
94+
not quite complete enough to allow using and linking a C++ application against
2295
a C++ standard library (like libc++). Hence, we do not include
2396
`libc++ <https://libcxx.llvm.org/>`_ in the sysroot.
2497

2598
.. note:: When the libc is complete enough, we should be able to include
2699
`libc++ <https://libcxx.llvm.org/>`_, libcxx-abi and libunwind in the
27100
LLVM only toolchain and use them to build and link C++ applications.
28101

29-
Configure the full libc build
30-
===============================
31-
32102
Below is the list of commands for a simple recipe to build and install the
33103
libc components along with other components of an LLVM only toolchain. In this
34104
we've set the Ninja generator, enabled a full compiler suite, set the build
@@ -43,6 +113,7 @@ to use the freshly built lld and compiler-rt.
43113
this command:
44114
``sudo ln -s /usr/include/<TARGET TRIPLE>/asm /usr/include/asm``
45115

116+
.. TODO: Move from projects to runtimes for libc, compiler-rt
46117
.. code-block:: sh
47118
48119
$> cd llvm-project # The llvm-project checkout
@@ -51,7 +122,7 @@ to use the freshly built lld and compiler-rt.
51122
$> SYSROOT=/path/to/sysroot # Remember to set this!
52123
$> cmake ../llvm \
53124
-G Ninja \
54-
-DLLVM_ENABLE_PROJECTS="clang;libc;lld;compiler-rt" \
125+
-DLLVM_ENABLE_PROJECTS="clang;lld;libc;compiler-rt" \
55126
-DCMAKE_BUILD_TYPE=Debug \
56127
-DCMAKE_C_COMPILER=clang \
57128
-DCMAKE_CXX_COMPILER=clang++ \

‎libc/docs/fullbuild_mode.rst

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
Fullbuild Mode
55
==============
66

7+
.. note::
8+
Fullbuild requires running headergen, which is a python program that depends on
9+
pyyaml. The minimum versions are listed on the :ref:`header_generation`
10+
page, as well as additional information.
11+
712
The *fullbuild* mode of LLVM's libc is the mode in which it is to be used as
813
the only libc (as opposed to the :ref:`overlay_mode` in which it is used along
914
with the system libc.) In order to use it as the only libc, one will have to

‎libc/docs/gpu/building.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,13 @@ targeting the default host environment as well.
6363
Runtimes cross build
6464
--------------------
6565

66+
.. note::
67+
These instructions need to be updated for new headergen. They may be
68+
inaccurate.
69+
6670
For users wanting more direct control over the build process, the build steps
6771
can be done manually instead. This build closely follows the instructions in the
68-
:ref:`main documentation<runtimes_cross_build>` but is specialized for the GPU
72+
:ref:`main documentation<full_cross_build>` but is specialized for the GPU
6973
build. We follow the same steps to first build the libc tools and a suitable
7074
compiler. These tools must all be up-to-date with the libc source.
7175

‎libc/docs/index.rst

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
The LLVM C Library
33
==================
44

5-
.. warning::
6-
The libc is not complete. If you need a fully functioning C library right
7-
now, you should continue to use your standard system libraries.
5+
.. note::
6+
LLVM-libc is not fully complete right now. Some programs may fail to build due
7+
to missing functions (especially C++ ones). If you would like to help us
8+
finish LLVM-libc, check out "Contributing to the libc project" in the sidebar
9+
or ask on discord.
810

911
Introduction
1012
============
1113

12-
The libc aspires to a unique place in the software ecosystem. The goals are:
14+
LLVM-libc aspires to a unique place in the software ecosystem. The goals are:
1315

1416
- Fully compliant with current C standards (C17 and upcoming C2x) and POSIX.
1517
- Easily decomposed and embedded: Supplement or replace system C library
@@ -32,16 +34,17 @@ The libc aspires to a unique place in the software ecosystem. The goals are:
3234
Platform Support
3335
================
3436

35-
Most development is currently targeting x86_64 and aarch64 on Linux. Several
36-
functions in the libc have been tested on Windows. The Fuchsia platform is
37+
Most development is currently targeting Linux on x86_64, aarch64, arm, and
38+
RISC-V. Embedded/baremetal targets are supported on arm and RISC-V, and Windows
39+
and MacOS have limited support (may be broken). The Fuchsia platform is
3740
slowly replacing functions from its bundled libc with functions from this
3841
project.
3942

4043
ABI Compatibility
4144
=================
4245

4346
The libc is written to be ABI independent. Interfaces are generated using
44-
LLVM's tablegen, so supporting arbitrary ABIs is possible. In it's initial
47+
headergen, so supporting arbitrary ABIs is possible. In it's initial
4548
stages there is no ABI stability in any form.
4649

4750
.. toctree::

‎libc/docs/overlay_mode.rst

+20-16
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ Also, if users choose to mix more than one libc with the system libc, then
2828
the name ``libllvmlibc.a`` makes it absolutely clear that it is the static
2929
archive of LLVM's libc.
3030

31-
Building the static archive with libc as a normal LLVM project
32-
--------------------------------------------------------------
31+
Building LLVM-libc as a standalone runtime
32+
------------------------------------------
3333

34-
We can treat the ``libc`` project as any other normal LLVM project and perform
35-
the CMake configure step as follows:
34+
We can treat the ``libc`` project like any other normal LLVM runtime library by
35+
building it with the following cmake command:
3636

3737
.. code-block:: sh
3838
3939
$> cd llvm-project # The llvm-project checkout
4040
$> mkdir build
4141
$> cd build
42-
$> cmake ../llvm -G Ninja -DLLVM_ENABLE_RUNTIMES="libc" \
42+
$> cmake ../runtimes -G Ninja -DLLVM_ENABLE_RUNTIMES="libc" \
4343
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
4444
-DCMAKE_BUILD_TYPE=<Debug|Release> \ # Select build type
4545
-DCMAKE_INSTALL_PREFIX=<Your prefix of choice> # Optional
@@ -50,24 +50,29 @@ Next, build the libc:
5050
5151
$> ninja libc
5252
53+
Then, run the tests:
54+
55+
.. code-block:: sh
56+
57+
$> ninja check-libc
58+
5359
The build step will build the static archive the in the directory
5460
``build/projects/libc/lib``. Notice that the above CMake configure step also
55-
specified an install prefix. This is optional, but if one uses it, then they
56-
can follow up the build step with an install step:
61+
specified an install prefix. This is optional, but it's used, then the following
62+
command will install the static archive to the install path:
5763

5864
.. code-block:: sh
5965
60-
$> ninja install-llvmlibc
66+
$> ninja install-libc
6167
6268
Building the static archive as part of the bootstrap build
6369
----------------------------------------------------------
6470

6571
The bootstrap build is a build mode in which runtime components like libc++,
6672
libcxx-abi, libc etc. are built using the ToT clang. The idea is that this build
67-
produces an in-sync toolchain of compiler + runtime libraries. Such a synchrony
68-
is not essential for the libc but can one still build the overlay static archive
69-
as part of the bootstrap build if one wants to. The first step is to configure
70-
appropriately:
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
75+
performance possible.
7176

7277
.. code-block:: sh
7378
@@ -77,14 +82,13 @@ appropriately:
7782
-DCMAKE_BUILD_TYPE=<Debug|Release> \ # Select build type
7883
-DCMAKE_INSTALL_PREFIX=<Your prefix of choice> # Optional
7984
80-
The build and install steps are similar to the those used when configured
81-
as a normal project. Note that the build step takes much longer this time
82-
as ``clang`` will be built before building ``libllvmlibc.a``.
85+
The build and install steps are the same as above, but the build step will take
86+
much longer since ``clang`` will be built before building ``libllvmlibc.a``.
8387

8488
.. code-block:: sh
8589
8690
$> ninja libc
87-
$> ninja install-llvmlibc
91+
$> ninja check-libc
8892
8993
Using the overlay static archive
9094
================================

‎libc/docs/porting.rst

-15
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,6 @@ have their own config directory.
4343
config directory for Fuchsia as the bring up is being done in the Fuchsia
4444
source tree.
4545

46-
The api.td file
47-
---------------
48-
49-
If the :ref:`fullbuild_mode` is to be supported on the new operating system,
50-
then a file named ``api.td`` should be added in its config directory. It is
51-
written in the
52-
`LLVM tablegen language <https://llvm.org/docs/TableGen/ProgRef.html>`_.
53-
It lists all the relevant macros and type definitions we want in the
54-
public libc header files. See the existing Linux
55-
`api.td <https://github.com/llvm/llvm-project/blob/main/libc/config/linux/api.td>`_
56-
file as an example to prepare the ``api.td`` file for the new operating system.
57-
58-
.. note:: In future, LLVM tablegen will be replaced with a different DSL to list
59-
config information.
60-
6146
Architecture Subdirectory
6247
=========================
6348

0 commit comments

Comments
 (0)
Please sign in to comment.