[llvm-dev] Error compiling libc++ for ARMv6

Richard Pennington via llvm-dev llvm-dev at lists.llvm.org
Fri Sep 25 13:46:59 PDT 2015


Hi,

I was compiling libc++ with a recent TOT (248571) and when I got to the 
ARMv6, I got a code generation error in memory.cpp:

fatal error: error in backend: Cannot select: intrinsic %llvm.arm.clrex
ecc: error: clang frontend command failed with exit code 70 (use -v to 
see invocation)
clang version 3.8.0 (trunk)

It looks as if the newly added emitAtomicCmpXchgNoStoreLLBalance() 
function is the culprit.  Does this seem like a resaonable fix, or do I 
need to do something different for v6 and earlier?

void ARMTargetLowering::emitAtomicCmpXchgNoStoreLLBalance(
     IRBuilder<> &Builder) const {
   if (Subtarget->hasV7Ops()) {
     Module *M = Builder.GetInsertBlock()->getParent()->getParent();
     Builder.CreateCall(llvm::Intrinsic::getDeclaration(M,
Intrinsic::arm_clrex));
   }
}

-Rich


More information about the llvm-dev mailing list