2021-07-03 17:23:16 +02:00
|
|
|
.. SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
Arch Support
|
|
|
|
============
|
|
|
|
|
|
|
|
Currently, the Rust compiler (``rustc``) uses LLVM for code generation,
|
|
|
|
which limits the supported architectures that can be targeted. In addition,
|
|
|
|
support for building the kernel with LLVM/Clang varies (please see
|
|
|
|
Documentation/kbuild/llvm.rst). This support is needed for ``bindgen``
|
|
|
|
which uses ``libclang``.
|
|
|
|
|
|
|
|
Below is a general summary of architectures that currently work. Level of
|
|
|
|
support corresponds to ``S`` values in the ``MAINTAINERS`` file.
|
|
|
|
|
2024-01-17 12:43:00 +08:00
|
|
|
============= ================ ==============================================
|
|
|
|
Architecture Level of support Constraints
|
|
|
|
============= ================ ==============================================
|
2023-10-20 16:50:56 +01:00
|
|
|
``arm64`` Maintained Little Endian only.
|
2024-03-24 09:09:15 +08:00
|
|
|
``loongarch`` Maintained \-
|
2024-04-09 18:25:16 +01:00
|
|
|
``riscv`` Maintained ``riscv64`` only.
|
arch: um: rust: Add i386 support for Rust
At present, Rust in the kernel only supports 64-bit x86, so UML has
followed suit. However, it's significantly easier to support 32-bit i386
on UML than on bare metal, as UML does not use the -mregparm option
(which alters the ABI), which is not yet supported by rustc[1].
Add support for CONFIG_RUST on um/i386, by adding a new target config to
generate_rust_target, and replacing various checks on CONFIG_X86_64 to
also support CONFIG_X86_32.
We still use generate_rust_target, rather than a built-in rustc target,
in order to match x86_64, provide a future place for -mregparm, and more
easily disable floating point instructions.
With these changes, the KUnit tests pass with:
kunit.py run --make_options LLVM=1 --kconfig_add CONFIG_RUST=y
--kconfig_add CONFIG_64BIT=n --kconfig_add CONFIG_FORTIFY_SOURCE=n
An earlier version of these changes was proposed on the Rust-for-Linux
github[2].
[1]: https://github.com/rust-lang/rust/issues/116972
[2]: https://github.com/Rust-for-Linux/linux/pull/966
Signed-off-by: David Gow <davidgow@google.com>
Link: https://patch.msgid.link/20240604224052.3138504-1-davidgow@google.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-06-05 06:40:50 +08:00
|
|
|
``um`` Maintained \-
|
2024-01-17 12:43:00 +08:00
|
|
|
``x86`` Maintained ``x86_64`` only.
|
|
|
|
============= ================ ==============================================
|
2023-02-13 15:59:20 +07:00
|
|
|
|