[PATCH] D23931: [XRay] ARM 32-bit no-Thumb support in LLVM

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 06:31:26 PDT 2016


rengolin added a comment.

In https://reviews.llvm.org/D23931#538093, @rSerge wrote:

> I don't yet understand how these commits could break build-bots. Did someone add `-fxray-instrument` clang option to bots which generate Thumb code?


Nope. The error was when compiling `xray_trampoline_arm.S`.

Compiler-RT's patch enables XRay on ARM, which means it'll run all the existing XRay tests on ARM buildbots, which also mean Thumb ones, which also build XRay's sources.

This was the error message:

  FAILED: /usr/lib/ccache/cc  -DXRAY_HAS_EXCEPTIONS=1 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/xray -I/home/linaro/devel/buildbot/clang-cmake-thumbv7-a15-full-sh/llvm/projects/compiler-rt/lib/xray -Iinclude -I/home/linaro/devel/buildbot/clang-cmake-thumbv7-a15-full-sh/llvm/include -I/home/linaro/devel/buildbot/clang-cmake-thumbv7-a15-full-sh/llvm/projects/compiler-rt/lib/xray/.. -I/home/linaro/devel/buildbot/clang-cmake-thumbv7-a15-full-sh/llvm/projects/compiler-rt/lib/xray/../../include -fPIC -O3 -DNDEBUG   -UNDEBUG  -march=armv7-a -mfloat-abi=hard -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fvisibility-inlines-hidden -fno-function-sections -fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtual-dtor -MMD -MT projects/compiler-rt/lib/xray/CMakeFiles/clang_rt.xray-armhf.dir/xray_trampoline_arm.S.o -MF projects/compiler-rt/lib/xray/CMakeFiles/clang_rt.xray-armhf.dir/xray_trampoline_arm.S.o.d -o projects/compiler-rt/lib/xray/CMakeFiles/clang_rt.xray-armhf.dir/xray_trampoline_arm.S.o -c /home/linaro/devel/buildbot/clang-cmake-thumbv7-a15-full-sh/llvm/projects/compiler-rt/lib/xray/xray_trampoline_arm.S
  
  llvm/projects/compiler-rt/lib/xray/xray_trampoline_arm.S: Assembler messages:
  llvm/projects/compiler-rt/lib/xray/xray_trampoline_arm.S:17: Error: attempt to use an ARM instruction on a Thumb-only processor -- `push {r1-r3,lr}'

My patch didn't work because this is using the system compiler, and not Clang, and GCC was picky about assembling ARM instructions (from `xray_trampoline_arm.S`) into an object that will be linked with other Thumb-only objects.

This will require some experimentation with a cross GCC/binutils, to make sure that -mthumb won't generate the NOPs as well as not try to link the code. An `#ifndef __thumb__` in `xray_trampoline_arm.S` to omit everything could work, so if the Clang implementation is wrong, we get a compiler error instead of a run-time error.

cheers,
--renato


Repository:
  rL LLVM

https://reviews.llvm.org/D23931





More information about the llvm-commits mailing list