Hope this helps
Peter
> _______________________________________________
> LLVM Developers mailing list
> llvm...@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 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
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
Cheers
So I applied the patch but I have still the same issue.
---
-- Build files have been written to: /tmp/aki/llvm-5.0.0.src/build
[1465/5024] Creating library symlink lib/libc++.so.1 lib/libc++.so
GENERATING SCRIPT: 'INPUT(libc++.so.1 -lc++abi)' as file /tmp/aki/llvm-5.0.0.src/build/lib/libc++.so
[1588/5024] Building C object projects/compiler-rt/lib...ins/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.../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/l...iles/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/l...iles/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
[1918/5024] Building ASM object projects/compiler-rt/l...les/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
[1920/5024] Building CXX object lib/Target/ARM/MCTargetDesc/CMakeFiles/LLVMARMDesc.dir/ARMMCTargetDesc.cpp.o
ninja: build stopped: subcommand failed
---
So if we check the content of the following file :
projects/compiler-rt/lib/builtins/arm/aeabi_memcmp.S
---
//===-- aeabi_memcmp.S - EABI memcmp implementation -----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "../assembly.h"
// void __aeabi_memcmp(void *dest, void *src, size_t n) { memcmp(dest, src, n); }
.syntax unified
.p2align 2
DEFINE_COMPILERRT_FUNCTION(__aeabi_memcmp)
#ifdef USE_THUMB_1
push {r7, lr}
bl memcmp
pop {r7, pc}
#else
b memcmp
#endif
END_COMPILERRT_FUNCTION(__aeabi_memcmp)
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memcmp4, __aeabi_memcmp)
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memcmp8, __aeabi_memcmp)
NO_EXEC_STACK_DIRECTIVE
---
The file has been correctly patch but do I need to provide a switch to the pre-processor
for USE_THUMB_1 like "-DUSE_THUMB_1" ?
Cheers
Peter
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 ?