Building the Kernel with Clang and LLVM
Most Linux kernels are compiled with GCC, but Rust's compiler is built on a different toolchain called LLVM. To make Rust and C parts of the kernel agree, you build the whole kernel with LLVM's C compiler, clang, by passing one option to the build. Mixing the two toolchains produces confusing link and type errors. Choosing LLVM up front removes a whole class of problems.
Questions this Concept answers
- Why is the whole kernel, C sources included, built with clang once Rust support is enabled?
This Concept is waiting for its first lesson!
Most Linux kernels are compiled with GCC, but Rust's compiler is built on a different toolchain called LLVM. To make Rust and C parts of the kernel agree, you build the whole kernel with LLVM's C compiler, clang, by passing one option to the build. Mixing the two toolchains produces confusing link and type errors. Choosing LLVM up front removes a whole class of problems.
Are you a teacher? Sign in to start contributing.
Sign In