[RFC] make arm-use-movt and arm-reserve-r9 options available for all arm

Jeroen Hofstee llvm at myspectrum.nl
Sat Aug 10 04:37:47 PDT 2013


Hello,

In order to build and run the ARM targets of U-boot successfully with
clang / llvm, some small changes are needed. This request for comment
is how to add them properly.

+ The first issue is U-boot's use of global registers. As this is not 
supported by
clang / llvm, it looks like a show stopper. However the use of r9 is 
defined as
platform specific in the eabi and that is actually supported by llvm, 
but limited
to IOS for the moment. Making this general available for ARM solves this 
issue.

IOS does this conditionally IsR9Reserved = ReserveR9 | !HasV6Ops; but I
don't understand why, therefore I just left it untouched.

+ The second issue is the use of movt / movw.
U-boot relies on gcc emitting code that can be made position independent by
the linker (since this is smaller, also with clang). This fails for 
these instruction
and ld will error out that the code needs to be recompiled with -fPIC. 
Also for
this case IOS has an flag (arm-darwin-use-movt), which I just make more 
commonly
available. (The hasV6T2Ops make sense here since these instruction are not
supported prior to that). The patch _renames_ this flag since Jim Grosbach
mentioned on IRC it is merely a debug flag. I did find the flag used in 
clang though
(lib/Driver/Tools.cpp), which at least raises the question if there are 
more front ends
using this flag and if this is the right thing to do.

And if renaming is fine, how to do that... I guess the easiest way would 
be to send
the clang patch along with the llvm patch to this list, so they can be 
applied together..

patch attached (hopefully unified, it at least applies with patch -u -p0).

Regards,
Jeroen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.patch
Type: text/x-patch
Size: 1607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130810/96d7636f/attachment.bin>


More information about the llvm-commits mailing list