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

Configure Feed

Select the types of activity you want to include in your feed.

Documentation/llvm: update CROSS_COMPILE inferencing

As noted by Masahiro, document how we can generally infer CROSS_COMPILE
(and the more specific details about --target and --prefix) based on
ARCH.

Change use of env vars to command line parameters.

Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Fangrui Song <maskray@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Nick Desaulniers and committed by
Masahiro Yamada
e08831ba 231ad7f4

+18 -1
+18 -1
Documentation/kbuild/llvm.rst
··· 38 38 A single Clang compiler binary will typically contain all supported backends, 39 39 which can help simplify cross compiling. :: 40 40 41 - ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang 41 + make ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- 42 42 43 43 ``CROSS_COMPILE`` is not used to prefix the Clang compiler binary, instead 44 44 ``CROSS_COMPILE`` is used to set a command line flag: ``--target=<triple>``. For ··· 62 62 63 63 Currently, the integrated assembler is disabled by default. You can pass 64 64 ``LLVM_IAS=1`` to enable it. 65 + 66 + Omitting CROSS_COMPILE 67 + ---------------------- 68 + 69 + As explained above, ``CROSS_COMPILE`` is used to set ``--target=<triple>``. 70 + 71 + Unless ``LLVM_IAS=1`` is specified, ``CROSS_COMPILE`` is also used to derive 72 + ``--prefix=<path>`` to search for the GNU assembler and linker. 73 + 74 + If ``CROSS_COMPILE`` is not specified, the ``--target=<triple>`` is inferred 75 + from ``ARCH``. 76 + 77 + That means if you use only LLVM tools, ``CROSS_COMPILE`` becomes unnecessary. 78 + 79 + For example, to cross-compile the arm64 kernel:: 80 + 81 + make ARCH=arm64 LLVM=1 LLVM_IAS=1 65 82 66 83 Supported Architectures 67 84 -----------------------