Skip to content

[libc][docs] Update full host build docs #97643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

michaelrj-google
Copy link
Contributor

Add a note explaining how to fix the missing asm folder, as well as a
warning about installing without setting a sysroot.

Add a note explaining how to fix the missing `asm` folder, as well as a
warning about installing without setting a sysroot.
@llvmbot
Copy link
Member

llvmbot commented Jul 3, 2024

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

Changes

Add a note explaining how to fix the missing asm folder, as well as a
warning about installing without setting a sysroot.


Full diff: https://github.com/llvm/llvm-project/pull/97643.diff

1 Files Affected:

  • (modified) libc/docs/full_host_build.rst (+15)
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:

Copy link
Contributor

@aaryanshukla aaryanshukla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -76,6 +84,13 @@ above.
Build and install
=================

.. warning::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we should add this warning message to our cmake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a TODO

@michaelrj-google michaelrj-google merged commit 2ef5b82 into llvm:main Jul 3, 2024
5 of 6 checks passed
@michaelrj-google michaelrj-google deleted the libcDocsSymlink branch July 3, 2024 23:29
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
Add a note explaining how to fix the missing `asm` folder, as well as a
warning about installing without setting a sysroot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants