Skip to content

Commit 85711bd

Browse files
[libc][docs] update docs on how to build linux kernel headers from src (llvm#122381)
It's simpler than the directions we have; which are very very Debian specific.
1 parent 7979e1b commit 85711bd

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

libc/docs/full_host_build.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,15 @@ Linux Headers
175175
=============
176176

177177
If you are using the full libc on Linux, then you will also need to install
178-
Linux headers in your sysroot. The way to do this varies per system.
179-
180-
These instructions should work on a Debian-based x86_64 system:
178+
Linux headers in your sysroot. Let's build them from source.
181179

182180
.. code-block:: sh
183181
184-
$> apt download linux-libc-dev
185-
$> dpkg -x linux-libc-dev*deb .
186-
$> cp -r usr/* /path/to/sysroot/
187-
$> rm -r usr linux-libc-dev*deb
188-
$> ln -s /path/to/sysroot/include/x86_64-linux-gnu/asm /path/to/sysroot/include/asm
182+
$> git clone --depth=1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git /tmp/linux
183+
$> make LLVM=1 INSTALL_HDR_PATH=/path/to/sysroot -C /tmp/linux headers_install
184+
185+
The headers can be built to target non-host architectures by adding the
186+
``ARCH={arm|arm64|i386}`` to the above invocation of ``make``.
189187

190188
Using your newly built libc
191189
===========================

0 commit comments

Comments
 (0)