Compilation issue "unsupported relocation on symbol" with clang 3.7.1

Hi List,

I’m trying to build llvm-5.0.0 with clang-3.7.1 on ARM (native building). At some point I have the following issue :

My best guess is that this is PR30279
https://bugs.llvm.org/show_bug.cgi?id=30279 which was fixed in r280651
in September 2016. Can you try again with a version of clang/llvm from
after that point? Some versions of aeabi_memcpy.S contain an
unconditional branch to memcpy (a branch out of section that can't be
resolved at assembly time). The v6m unconditional branch has a very
short range and earlier versions of llvm did not support the
relocation.

Hope this helps

Peter

My best guess is that this is PR30279
https://bugs.llvm.org/show_bug.cgi?id=30279 which was fixed in r280651
in September 2016. Can you try again with a version of clang/llvm from
after that point? Some versions of aeabi_memcpy.S contain an
unconditional branch to memcpy (a branch out of section that can't be
resolved at assembly time). The v6m unconditional branch has a very
short range and earlier versions of llvm did not support the
relocation.

Hope this helps

Hi Peter,

Thank you for your answer. I saw that pages before but I didn't find any
information about how to fix this. And unfortunately, I can't use a different
version of clang/llvm.

Thanks

A very recent change to compiler-rt https://reviews.llvm.org/D39700
recently the unconditional branch for v6-m in some of the aeabi_
functions, if you are able to use compiler-rt from trunk or alter the
compiler-rt source yourself you may be able to work around the problem
without changing versions of llvm.

I'm not sure what to recommend otherwise, you may be able to turn off
the integrated assembler and use arm-non-eabi-as for the files with
unconditional branches, but I couldn't guarantee that would wouldn't
result in other problems.

Peter

Thank you Peter, I will try to patch instead.

Cheers

Hi again,

So I applied the patch but I have still the same issue.

The file builtins/assembly.h has code to define things like
USE_THUMB_1. Depending on how old your version of compiler-rt is, the
chances are that you don't have an up to date assembly.h so
USE_THUMB_1 isn't going to be defined. Are you able to take the latest
version of compiler-rt? That would minimise your chances of running
into problems like this. If you must keep the existing version of
compiler-rt that you have I suggest that you either adapt USE_THUMB_1
to the defines in your assembly.h or add USE_THUMB_1 to your
assembly.h in the appropriate place.

Peter

Hi,

I downloaded the all LLVM suite version 5.0.0 from LLVM website. So I'm trying to compiler
compiler-rt version 5.0.0. But looking at git mirror I noticed the assembly.h was different.
So yes, USE_THUMB_1 is defined and I can patch assembly.h.

However, is version 5.0.0 the latest one ?

Well, it's better to take the whole git repository as a lot of files reflect assembly.h changes.