[PATCH] D76848: [CodeGen][ARM] Error when writing to specific reserved registers in inline asm

Manoj Gupta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 14:02:30 PDT 2020


manojgupta added a comment.

In D76848#2008278 <https://reviews.llvm.org/D76848#2008278>, @efriedma wrote:

> @manojgupta can you give a build recipe?  None of the buildbots are failing.


Here is how I cam able to replicate on a debian :

  1. Install gcc/g++ for arm gnueabi
  $ sudo apt-get install  gcc-9-arm-linux-gnueabi  g++-9-arm-linux-gnueabi
  
  2. build clang locally and create armv7a-linux-gnueabi-clang/clang++ symlinks
  $ cd /path/to/build/bin/ 
  $ ln -s clang++ armv7a-linux-gnueabi-clang++ 
  $ ln -s clang armv7a-linux-gnueabi-clang
  
  3. do a compiler-rt standalone build
  $ mkdir /path/to/compiler-rt-build && cd  /path/to/compiler-rt-build
  $ CFLAGS="-mthumb -I/usr/arm-linux-gnueabi/include/" CXXFLAGS="-mthumb -I/usr/arm-linux-gnueabi/include/c++/9/arm-linux-gnueabi/" CC= /path/to/build/bin/armv7a-linux-gnueabi-clang CXX= /path/to/build/bin/armv7a-linux-gnueabi-clang++ cmake -GNinja "-DCOMPILER_RT_TEST_TARGET_TRIPLE=arm-linux-gnueabi" -DCOMPILER_RT_DEBUG=ON /path/to/llvm-project/compiler-rt
  $ ninja builtins -> fails with:
  
   llvm-project/compiler-rt/lib/builtins/clear_cache.c:80:20: error: write to reserved register 'R7'
    __asm __volatile("svc 0x0"
                     ^
  1 error generated.

Regarding buildbots, they may not be using build config (thumb/gnueabi/COMPILER_RT_DEBUG=ON etc.) so thats why they may not see this problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76848/new/

https://reviews.llvm.org/D76848





More information about the llvm-commits mailing list