Skip to content

Commit 2ef5b82

Browse files
[libc][docs] Update full host build docs (#97643)
Add a note explaining how to fix the missing `asm` folder, as well as a warning about installing without setting a sysroot.
1 parent 3eebeb7 commit 2ef5b82

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

libc/docs/full_host_build.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ we've set the Ninja generator, enabled a full compiler suite, set the build
3535
type to "Debug", and enabled the Scudo allocator. The build also tells clang
3636
to use the freshly built lld and compiler-rt.
3737

38+
.. note::
39+
if your build fails with an error saying the compiler can't find
40+
``<asm/unistd.h>`` or similar then you're probably missing the symlink from
41+
``/usr/include/asm`` to ``/usr/include/<TARGET TRIPLE>/asm``. Installing the
42+
``gcc-multilib`` package creates this symlink, or you can do it manually with
43+
this command:
44+
``sudo ln -s /usr/include/<TARGET TRIPLE>/asm /usr/include/asm``
45+
3846
.. code-block:: sh
3947
4048
$> cd llvm-project # The llvm-project checkout
@@ -76,6 +84,14 @@ above.
7684
Build and install
7785
=================
7886

87+
.. TODO: add this warning to the cmake
88+
.. warning::
89+
Running these install commands without setting a ``$SYSROOT`` will install
90+
them into your system include path, which may break your system. If you're
91+
just trying to develop libc, then just run ``ninja check-libc`` to build the
92+
libc and run the tests. If you've already accidentally installed the headers,
93+
you may need to delete them from ``/usr/local/include``.
94+
7995
After configuring the build with the above ``cmake`` command, one can build and
8096
install the libc, clang (and its support libraries and builtins), lld and
8197
compiler-rt, with the following command:

0 commit comments

Comments
 (0)