aboutsummaryrefslogtreecommitdiff
path: root/doc/build
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-11-21 10:41:07 -0500
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-12-05 01:38:56 +0100
commit463e341348738151df6fadcae0cd459ea431bbce (patch)
tree6d3507845cb9825a73b77e8b409f5c0729e47686 /doc/build
parenta6ac50cad59825087510a1e5db41551cc91d5529 (diff)
downloadu-boot-463e341348738151df6fadcae0cd459ea431bbce.zip
u-boot-463e341348738151df6fadcae0cd459ea431bbce.tar.gz
u-boot-463e341348738151df6fadcae0cd459ea431bbce.tar.bz2
doc: clang: Update and correct support notes
At this point, clang can be used on both 32bit and 64bit targets without issue. Make note of logic we have that will inform clang of the architecture to build for. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'doc/build')
-rw-r--r--doc/build/clang.rst22
1 files changed, 10 insertions, 12 deletions
diff --git a/doc/build/clang.rst b/doc/build/clang.rst
index cc26550..09bb988 100644
--- a/doc/build/clang.rst
+++ b/doc/build/clang.rst
@@ -11,14 +11,6 @@ The ARM backend can be instructed not to use the r9 and x18 registers using
supported inline assembly is needed to get and set the r9 or x18 value. This
leads to larger code then strictly necessary, but at least works.
-**NOTE:** target compilation only work for _some_ ARM boards at the moment.
-Also AArch64 is not supported currently due to a lack of private libgcc
-support. Boards which reassign gd in c will also fail to compile, but there is
-in no strict reason to do so in the ARM world, since crt0.S takes care of this.
-These assignments can be avoided by changing the init calls but this is not in
-mainline yet.
-
-
Debian based
------------
@@ -28,14 +20,20 @@ Required packages can be installed via apt, e.g.
sudo apt-get install clang
-Note that we still use binutils for some tools so we must continue to set
-CROSS_COMPILE. To compile U-Boot with Clang on Linux without IAS use e.g.
+We make use of the CROSS_COMPILE variable to derive the build target which is
+passed as the --target parameter to clang.
+
+The CROSS_COMPILE variable further determines the paths to other build
+tools. As assembler we use the binary pointed to by '$(CROSS_COMPILE)as'
+instead of the LLVM integrated assembler (IAS).
+
+Here is an example demonstrating building U-Boot for the Raspberry Pi 2
+using clang:
.. code-block:: bash
make HOSTCC=clang rpi_2_defconfig
- make HOSTCC=clang CROSS_COMPILE=arm-linux-gnueabi- \
- CC="clang -target arm-linux-gnueabi" -j8
+ make HOSTCC=clang CROSS_COMPILE=arm-linux-gnueabi- CC=clang -j8
It can also be used to compile sandbox: