[LLVMdev] compiler-rt for ARM-Linux with CMake?

Alexey Samsonov samsonov at google.com
Thu Jan 23 00:59:40 PST 2014


Hi Renato,

On Wed, Jan 22, 2014 at 9:06 PM, Renato Golin <renato.golin at linaro.org> wrote:
> On 20 December 2013 10:43, Alexey Samsonov <samsonov at google.com> wrote:
>>
>> There are simply no CMake build rules for building compiler-rt
>> libraries targeting ARM (see compiler-rt/lib/CMakeLists.txt).
>
>
> Hi Alexey,
>
> I've added the ARM files on that CMake file but I got nothing compiled on
> ARM. Am I missing something?

DId you do this locally? I can't see a commit. I think that to add
support for compiler-rt on ARM you need to:
1) Specify arm_SOURCES and add "arm" to this loop in
compiler-rt/lib/CMakeLists.txt
  foreach(arch x86_64 i386)
    if(CAN_TARGET_${arch})
      add_compiler_rt_static_runtime(clang_rt.${arch} ${arch}
        SOURCES ${${arch}_SOURCES}
        CFLAGS "-std=c99")
    endif()
  endforeach()
2) Make sure CAN_TARGET_arm is properly defined in
compiler-rt/CMakeLists.txt. See test_target_arch function
and places where it's called. Note that at the moment the CMake build
uses host compiler (not just-built Clang) to
build compiler-rt libraries, so building compiler-rt targeting arm on
x86_64 host might be a problem.

> About the sanitizers, is there anyone that is known to work on ARM? If not,
> I should disable all tests on ARM for all sanitizers.

We run AddressSanitizer tests on arm-android. Probably it should work
fine on ARM+Linux, but we don't have a buildbot
or continuous testing for that (and you'd have to add support for
building sanitizers on ARM Linux in a similar way).

>
> cheers,
> --renato



-- 
Alexey Samsonov, MSK



More information about the llvm-dev mailing list