All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] clang: Update documentation
@ 2018-04-22 23:15 Tom Rini
  2018-04-27 23:27 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rini @ 2018-04-22 23:15 UTC (permalink / raw)
  To: u-boot

As of clang-5.0, things have changed a bit.  First, we cannot
automatically guess -target values as if we do not pass one with CC then
cc-option will fail.  Second, to disable movt/movw relocations the
argument has become -mno-movt.

Related to the target part, we cannot use arm-none-eabi as that ends up
being too generic of an ARM target for things like say rpi_3_32b to
work.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/config.mk |  5 ++---
 doc/README.clang   | 18 +++++++-----------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 9c213b897cd5..b448ed0b3ebd 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -23,9 +23,8 @@ PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \
       $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
 # LLVM support
-LLVMS_RELFLAGS		:= $(call cc-option,-mllvm,) \
-			$(call cc-option,-target arm-none-eabi,) \
-			$(call cc-option,-arm-use-movt=0,)
+LLVM_RELFLAGS		:= $(call cc-option,-mllvm,) \
+			$(call cc-option,-mno-movt,)
 PLATFORM_RELFLAGS	+= $(LLVM_RELFLAGS)
 
 PLATFORM_CPPFLAGS += -D__ARM__
diff --git a/doc/README.clang b/doc/README.clang
index e0491b2d7e6b..475bb1e2ed8b 100644
--- a/doc/README.clang
+++ b/doc/README.clang
@@ -10,16 +10,11 @@ used to get its value. This does lead 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: Most notably boards which aren't using
-the generic board will fail to compile, but since those are expected
-to be converted this will solve itself. 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.
-
-NOTE: without the -mllvm -arm-use-movt=0 flags U-Boot will compile
-fine, but llvm might hardcode addresses in movw / movt pairs, which
-cannot be relocated and U-Boot will fail at runtime.
+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)
 --------------
@@ -29,7 +24,8 @@ 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.:
 make HOSTCC=clang rpi_2_defconfig
-make HOSTCC=clang CROSS_COMPILE=arm-linux-gnueabi- CC=clang -j8
+make HOSTCC=clang CROSS_COMPILE=arm-linux-gnueabi- \
+    CC="clang -target arm-linux-gnueabi" -j8
 
 It can also be used to compile sandbox:
 make HOSTCC=clang sandbox_defconfig
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] clang: Update documentation
  2018-04-22 23:15 [U-Boot] [PATCH] clang: Update documentation Tom Rini
@ 2018-04-27 23:27 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2018-04-27 23:27 UTC (permalink / raw)
  To: u-boot

On Sun, Apr 22, 2018 at 07:15:03PM -0400, Tom Rini wrote:

> As of clang-5.0, things have changed a bit.  First, we cannot
> automatically guess -target values as if we do not pass one with CC then
> cc-option will fail.  Second, to disable movt/movw relocations the
> argument has become -mno-movt.
> 
> Related to the target part, we cannot use arm-none-eabi as that ends up
> being too generic of an ARM target for things like say rpi_3_32b to
> work.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180427/9e7db62f/attachment.sig>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-27 23:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-22 23:15 [U-Boot] [PATCH] clang: Update documentation Tom Rini
2018-04-27 23:27 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.