Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation/llvm: Add a section about supported architectures

The most common question around building the Linux kernel with clang is
"does it work?" and the answer has always been "it depends on your
architecture, configuration, and LLVM version" with no hard answers for
users wanting to experiment. LLVM support has significantly improved
over the past couple of years, resulting in more architectures and
configurations supported, and continuous integration has made it easier
to see what works and what does not.

Add a section that goes over what architectures are supported in the
current kernel version, how they should be built (with just clang or the
LLVM utilities as well), and the level of support they receive. This
will make it easier for people to try out building their kernel with
LLVM and reporting issues that come about from it.

Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulnier@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Nathan Chancellor and committed by
Masahiro Yamada
ed4e9e61 ae9162e2

+44
+44
Documentation/kbuild/llvm.rst
··· 63 63 Currently, the integrated assembler is disabled by default. You can pass 64 64 ``LLVM_IAS=1`` to enable it. 65 65 66 + Supported Architectures 67 + ----------------------- 68 + 69 + LLVM does not target all of the architectures that Linux supports and 70 + just because a target is supported in LLVM does not mean that the kernel 71 + will build or work without any issues. Below is a general summary of 72 + architectures that currently work with ``CC=clang`` or ``LLVM=1``. Level 73 + of support corresponds to "S" values in the MAINTAINERS files. If an 74 + architecture is not present, it either means that LLVM does not target 75 + it or there are known issues. Using the latest stable version of LLVM or 76 + even the development tree will generally yield the best results. 77 + An architecture's ``defconfig`` is generally expected to work well, 78 + certain configurations may have problems that have not been uncovered 79 + yet. Bug reports are always welcome at the issue tracker below! 80 + 81 + .. list-table:: 82 + :widths: 10 10 10 83 + :header-rows: 1 84 + 85 + * - Architecture 86 + - Level of support 87 + - ``make`` command 88 + * - arm 89 + - Supported 90 + - ``LLVM=1`` 91 + * - arm64 92 + - Supported 93 + - ``LLVM=1`` 94 + * - mips 95 + - Maintained 96 + - ``CC=clang`` 97 + * - powerpc 98 + - Maintained 99 + - ``CC=clang`` 100 + * - riscv 101 + - Maintained 102 + - ``CC=clang`` 103 + * - s390 104 + - Maintained 105 + - ``CC=clang`` 106 + * - x86 107 + - Supported 108 + - ``LLVM=1`` 109 + 66 110 Getting Help 67 111 ------------ 68 112