ojeda · GitHub

@ojeda

@ojeda ojeda mentioned this pull request

Apr 13, 2025

Open

2 tasks

nathanchance

nathanchance

nathanchance

@ojeda

nathanchance

This reverts commit  744315b .
This was fine at the time that it was committed but now we want to use
the output of build-llvm.py to build Rust from source and that does not
work too well with thin archives.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
We will be adding Rust support in the future, so pull out common git
repository management code from LLVMSourceManager that can be shared
with a RustSourceManager.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Currently, the distribution created by LLVMSlimBuilder is not very
flexible, even though it may be used in two different but similar
manners: creating a slim toolchain for LLVM to build itself or creating
a slim toolchain for building the Linux kernel. While there is a lot of
overlap between the two, there may not be much overlap for other
purposes that may come up in the future, like building Rust.
Introduce the concept of distribution profiles, which allow customizing
the distribution based on use case.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Allow the user to customize the final stage's distribution based on the
available profiles.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Building Rust requires many more components that can significantly
increase the size of a distribution installation. Add a Rust
distribution profile so that these things can be included only when a
user cares about building Rust.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

@ojeda

There a lot of options missing and it does not do any fancy kind of
build. But it is a start, and it is already useful, e.g. Peter could
have used it to test the new KCFI arity flag that requires LLVM 21 but
upstream Rust still uses LLVM 20.
I took the approach that the new script only takes care of building Rust
provided an existing LLVM, which seemed simple and clear.
Thus add the basic infrastructure, plus a bit of documentation. Add it
to the CI, too.
I successfully built it in a clean Debian 12 and Fedora 41.
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
By default, configure shortens its output but it is worth printing all
of the information to allow the user to verify everything is correct.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

@ojeda

@nathanchance

@ojeda

@ojeda ojeda mentioned this pull request

Mar 7, 2026

Merged

Read the original on github.com ↗