Commit 3b6407b8ed95594de6ee4fddd3239e8841b4d2d6

Authored by Tom Rini
1 parent 4760fe26c7

clang: Update documentation

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>

Showing 2 changed files with 9 additions and 14 deletions Side-by-side Diff

... ... @@ -23,9 +23,8 @@
23 23 $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
24 24  
25 25 # LLVM support
26   -LLVMS_RELFLAGS := $(call cc-option,-mllvm,) \
27   - $(call cc-option,-target arm-none-eabi,) \
28   - $(call cc-option,-arm-use-movt=0,)
  26 +LLVM_RELFLAGS := $(call cc-option,-mllvm,) \
  27 + $(call cc-option,-mno-movt,)
29 28 PLATFORM_RELFLAGS += $(LLVM_RELFLAGS)
30 29  
31 30 PLATFORM_CPPFLAGS += -D__ARM__
... ... @@ -10,17 +10,12 @@
10 10 necessary, but at least works.
11 11  
12 12 NOTE: target compilation only work for _some_ ARM boards at the moment.
13   -Also Aarch64 is not supported: Most notably boards which aren't using
14   -the generic board will fail to compile, but since those are expected
15   -to be converted this will solve itself. Boards which reassign gd in c
16   -will also fail to compile, but there is in no strict reason to do so
17   -in the ARM world, since crt0.S takes care of this. These assignments
18   -can be avoided by changing the init calls but this is not in mainline yet.
  13 +Also AArch64 is not supported currently due to a lack of private libgcc
  14 +support. Boards which reassign gd in c will also fail to compile, but there is
  15 +in no strict reason to do so in the ARM world, since crt0.S takes care of this.
  16 +These assignments can be avoided by changing the init calls but this is not in
  17 +mainline yet.
19 18  
20   -NOTE: without the -mllvm -arm-use-movt=0 flags U-Boot will compile
21   -fine, but llvm might hardcode addresses in movw / movt pairs, which
22   -cannot be relocated and U-Boot will fail at runtime.
23   -
24 19 Debian (based)
25 20 --------------
26 21 Binary packages can be installed as usual, e.g.:
... ... @@ -29,7 +24,8 @@
29 24 Note that we still use binutils for some tools so we must continue to set
30 25 CROSS_COMPILE. To compile U-Boot with clang on linux without IAS use e.g.:
31 26 make HOSTCC=clang rpi_2_defconfig
32   -make HOSTCC=clang CROSS_COMPILE=arm-linux-gnueabi- CC=clang -j8
  27 +make HOSTCC=clang CROSS_COMPILE=arm-linux-gnueabi- \
  28 + CC="clang -target arm-linux-gnueabi" -j8
33 29  
34 30 It can also be used to compile sandbox:
35 31 make HOSTCC=clang sandbox_defconfig