Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions Documentation/rust/quick-start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Quick Start
This document describes how to get started with kernel development in Rust.
If you have worked previously with Rust, this will only take a moment.

Please note that, at the moment, a very restricted subset of architectures
is supported, see :doc:`/rust/arch-support`.


Requirements: Building
----------------------
Expand Down Expand Up @@ -49,6 +52,29 @@ repository into the installation folder of your nightly toolchain::
git clone --recurse-submodules https://github.com/rust-lang/rust $(rustc --print sysroot)/lib/rustlib/src/rust


libclang
********

``libclang`` (part of LLVM) is used by ``bindgen`` to understand the C code
in the kernel, which means you will need a recent LLVM installed; like when
you compile the kernel with ``CC=clang`` or ``LLVM=1``.

Your Linux distribution is likely to have a suitable one available, so it is
best if you check that first.

There are also some binaries for several systems and architectures uploaded at:

https://releases.llvm.org/download.html

For Debian-based distributions, you can also fetch them from:

https://apt.llvm.org

Otherwise, building LLVM takes quite a while, but it is not a complex process:

https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm


bindgen
*******

Expand All @@ -57,11 +83,7 @@ the ``bindgen`` tool. A recent version should work, e.g. ``0.56.0``.

Install it via (this will build the tool from source)::

cargo install --version 0.56.0 bindgen

This tool uses ``libclang`` (LLVM) to understand the C code in the kernel,
which means you will need a recent LLVM installed; like when you compile
the kernel with ``CC=clang`` or ``LLVM=1``.
cargo install --locked --version 0.56.0 bindgen


Requirements: Developing
Expand Down