[llvm-dev] Compilation issue "unsupported relocation on symbol" with clang 3.7.1

Peter Smith via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 27 03:12:54 PST 2017


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

On 27 November 2017 at 11:02,  <shiftag at nanotek.info> wrote:
> November 27, 2017 2:43 PM, "Peter Smith" <peter.smith at linaro.org> wrote:
>
>> 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
>
>> On 26 November 2017 at 12:09, via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>>> 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 :
>>>
>>> ----
>>>
>>> [1588/5024] Building C object
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-arm.dir/cpu_model.c.o
>>> ../projects/compiler-rt/lib/builtins/cpu_model.c:596:7: warning: ISO C
>>> requires a translation unit to contain at least one declaration
>>> [-Wempty-translation-unit]
>>> #endif
>>> ^
>>> 1 warning generated.
>>> [1786/5024] Building C object
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/cpu_model.c.o
>>> ../projects/compiler-rt/lib/builtins/cpu_model.c:596:7: warning: ISO C
>>> requires a translation unit to contain at least one declaration
>>> [-Wempty-translation-unit]
>>> #endif
>>> ^
>>> 1 warning generated.
>>> [1915/5024] Building ASM object
>>> projects/compiler-rt/lib/built...s/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcmp.S.o
>>> FAILED:
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcmp.S.o
>>> /usr/bin/clang -DLLVM_BUILD_GLOBAL_ISEL -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
>>> -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
>>> -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/builtins
>>> -I../projects/compiler-rt/lib/builtins -Iinclude -I../include -fPIC -O3
>>> -DNDEBUG -march=armv6m -mfloat-abi=soft -fno-lto -MD -MT
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcmp.S.o
>>> -MF
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcmp.S.o.d
>>> -o
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcmp.S.o
>>> -c ../projects/compiler-rt/lib/builtins/arm/aeabi_memcmp.S
>>> clang -cc1as: fatal error: error in backend: unsupported relocation on
>>> symbol
>>> [1917/5024] Building ASM object
>>> projects/compiler-rt/lib/built.../CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memmove.S.o
>>> FAILED:
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memmove.S.o
>>> /usr/bin/clang -DLLVM_BUILD_GLOBAL_ISEL -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
>>> -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
>>> -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/builtins
>>> -I../projects/compiler-rt/lib/builtins -Iinclude -I../include -fPIC -O3
>>> -DNDEBUG -march=armv6m -mfloat-abi=soft -fno-lto -MD -MT
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memmove.S.o
>>> -MF
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memmove.S.o.d
>>> -o
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins----armv6m.dir/arm/aeabi_memmove.S.o
>>> -c ../projects/compiler-rt/lib/builtins/arm/aeabi_memmove.S
>>> clang -cc1as: fatal error: error in backend: unsupported relocation on
>>> symbol
>>> [1918/5024] Building ASM object
>>> projects/compiler-rt/lib/built...s/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcpy.S.o
>>> FAILED:
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcpy.S.o
>>> /usr/bin/clang -DLLVM_BUILD_GLOBAL_ISEL -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
>>> -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
>>> -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/builtins
>>> -I../projects/compiler-rt/lib/builtins -Iinclude -I../include -fPIC -O3
>>> -DNDEBUG -march=armv6m -mfloat-abi=soft -fno-lto -MD -MT
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcpy.S.o
>>> -MF
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcpy.S.o.d
>>> -o
>>> projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-armv6m.dir/arm/aeabi_memcpy.S.o
>>> -c ../projects/compiler-rt/lib/builtins/arm/aeabi_memcpy.S
>>> clang -cc1as: fatal error: error in backend: unsupported relocation on
>>> symbol
>>> [1920/5024] Building CXX object
>>> lib/Target/ARM/MCTargetDesc/CMakeFiles/LLVMARMDesc.dir/ARMMCTargetDesc.cpp.o
>>> ninja: build stopped: subcommand failed.
>>>
>>> ----
>>>
>>> Relevant stuff:
>>> clang -cc1as: fatal error: error in backend: unsupported relocation on
>>> symbol
>>>
>>> Well, I don't know how to fix that. Any ideas ?
>>>
>>> Let me know if you need further info.
>>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list