[libc-commits] [libc] [libc][docs] Update full host build docs (PR #97643)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Wed Jul 3 14:40:37 PDT 2024
https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/97643
Add a note explaining how to fix the missing `asm` folder, as well as a
warning about installing without setting a sysroot.
>From b7b2becfd77e24363a5052c90a593191d0b0d4b0 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Wed, 3 Jul 2024 14:39:07 -0700
Subject: [PATCH] [libc][docs] Update full host build docs
Add a note explaining how to fix the missing `asm` folder, as well as a
warning about installing without setting a sysroot.
---
libc/docs/full_host_build.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libc/docs/full_host_build.rst b/libc/docs/full_host_build.rst
index 709ba70b22de4..80b2cb2b5bb64 100644
--- a/libc/docs/full_host_build.rst
+++ b/libc/docs/full_host_build.rst
@@ -35,6 +35,14 @@ we've set the Ninja generator, enabled a full compiler suite, set the build
type to "Debug", and enabled the Scudo allocator. The build also tells clang
to use the freshly built lld and compiler-rt.
+.. note::
+ 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/<TARGET TRIPLE>/asm``. Installing the
+ ``gcc-multilib`` package creates this symlink, or you can do it manually with
+ this command:
+ ``sudo ln -s /usr/include/<TARGET TRIPLE>/asm /usr/include/asm``
+
.. code-block:: sh
$> cd llvm-project # The llvm-project checkout
@@ -76,6 +84,13 @@ above.
Build and install
=================
+.. warning::
+ Running these install commands without setting a ``$SYSROOT`` will install
+ them into your system include path, which may break your system. If you're
+ just trying to develop libc, then just run ``ninja check-libc`` to build the
+ libc and run the tests. If you've already accidentally installed the headers,
+ you may need to delete them from ``/usr/local/include``.
+
After configuring the build with the above ``cmake`` command, one can build and
install the libc, clang (and its support libraries and builtins), lld and
compiler-rt, with the following command:
More information about the libc-commits
mailing list