aboutsummaryrefslogtreecommitdiff
path: root/doc/build
diff options
context:
space:
mode:
authorLeo Yan2023-05-04 15:54:59 +0800
committerTom Rini2023-06-01 12:32:03 -0400
commite45fcb0e76b51d1e805f077ec160f99ff2edfa36 (patch)
treead178e55db3db36d4fd3b6b5b0899bf30e662a42 /doc/build
parent4787c764f98ac9d4670ff45e11676c28fb61b882 (diff)
doc: Add info for building Xen target with Clang
When build Xen target with Clang, the linker reports failure. This patch adds the related info in the documentation as a known issue and gives details for how to dismiss the building failure with Clang. Signed-off-by: Leo Yan <leo.yan@linaro.org>
Diffstat (limited to 'doc/build')
-rw-r--r--doc/build/clang.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/build/clang.rst b/doc/build/clang.rst
index 1d35616eb5e..cc265506c2f 100644
--- a/doc/build/clang.rst
+++ b/doc/build/clang.rst
@@ -74,3 +74,39 @@ simplified with a simple wrapper script - saved as
#!/bin/sh
exec clang -target arm-freebsd-eabi --sysroot /usr/arm-freebsd "$@"
+
+
+Known Issues
+------------
+
+When build U-boot for `xenguest_arm64_defconfig` target, it reports linkage
+error:
+
+.. code-block:: bash
+
+ aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `do_hypervisor_callback':
+ /home/leoy/Dev2/u-boot/drivers/xen/hypervisor.c:188: undefined reference to `__aarch64_swp8_acq_rel'
+ aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_set_bit':
+ /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel'
+ aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_clear_bit':
+ /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel'
+ aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_set_bit':
+ /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel'
+ aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_clear_bit':
+ /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel'
+ aarch64-linux-gnu-ld.bfd: drivers/xen/events.o: in function `synch_test_and_clear_bit':
+ /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel'
+ aarch64-linux-gnu-ld.bfd: drivers/xen/events.o: in function `synch_test_and_set_bit':
+ /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel'
+ aarch64-linux-gnu-ld.bfd: drivers/xen/gnttab.o: in function `gnttab_end_access':
+ /home/leoy/Dev2/u-boot/drivers/xen/gnttab.c:109: undefined reference to `__aarch64_cas2_acq_rel'
+ Segmentation fault
+
+To fix the failure, we need to append option `-mno-outline-atomics` in Clang
+command to not generate local calls to out-of-line atomic operations:
+
+.. code-block:: bash
+
+ make HOSTCC=clang xenguest_arm64_defconfig
+ make HOSTCC=clang CROSS_COMPILE=aarch64-linux-gnu- \
+ CC="clang -target aarch64-linux-gnueabi -mno-outline-atomics" -j8